auth-test.yaml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # Copyright 2020 Crown Copyright
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. apiVersion: v1
  15. kind: Pod
  16. metadata:
  17. name: {{ template "hdfs.fullname" . }}-auth-test
  18. annotations:
  19. helm.sh/hook: test
  20. helm.sh/hook-delete-policy: hook-succeeded
  21. labels:
  22. {{- include "hdfs.labels" . | nindent 4 }}
  23. app.kubernetes.io/component: test
  24. spec:
  25. restartPolicy: Never
  26. containers:
  27. - name: test
  28. image: {{ .Values.shell.repository }}:{{ .Values.shell.tag }}
  29. imagePullPolicy: {{ .Values.shell.imagePullPolicy }}
  30. command: ["/bin/sh", "-c", "hadoop fs -put -f /opt/hadoop/LICENSE.txt / && hadoop fs -ls / && hadoop fs -rm /LICENSE.txt; rc=$?; echo $rc; [ $rc {{ if hasKey .Values.config.hdfsSite "hadoop.security.forward.authentication.url" }}!={{ else }}={{ end }} 0 ]"]
  31. env:
  32. - name: HADOOP_CONF_DIR
  33. value: {{ .Values.config.path }}
  34. volumeMounts:
  35. - name: config
  36. mountPath: {{ .Values.config.path }}
  37. readOnly: true
  38. volumes:
  39. - name: config
  40. configMap:
  41. name: {{ template "hdfs.fullname" . }}
  42. optional: false
  43. {{- with .Values.shell.imagePullSecrets }}
  44. imagePullSecrets:
  45. {{- range . }}
  46. - name: {{ . }}
  47. {{- end }}
  48. {{- end }}