12345678910111213141516171819202122232425262728293031 |
- # Copyright 2020 Crown Copyright
- #
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
- # You may obtain a copy of the License at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
- apiVersion: v1
- kind: Pod
- metadata:
- name: {{ template "hdfs.fullname" . }}-webhdfs-test
- annotations:
- helm.sh/hook: test
- helm.sh/hook-delete-policy: hook-succeeded
- labels:
- {{- include "hdfs.labels" . | nindent 4 }}
- app.kubernetes.io/component: test
- spec:
- restartPolicy: Never
- containers:
- - name: test
- image: {{ .Values.alpine.repository}}:{{ .Values.alpine.tag }}
- imagePullPolicy: {{ .Values.alpine.imagePullPolicy }}
- command: ["/bin/sh", "-c", "apk update && apk add curl && statusCode=$(curl -f -s -o /dev/null -w \"%{http_code}\" http://{{ template "hdfs.fullname" . }}-namenodes:{{ .Values.namenode.ports.http }}/webhdfs/v1?op=LISTSTATUS) && echo \"${statusCode}\" && [ \"${statusCode}\" {{ if hasKey .Values.config.hdfsSite "dfs.web.authentication.type" }}!={{ else }}={{ end }} \"200\" ]"]
|