rack-awareness-test.yaml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. {{- /*
  2. Copyright 2020 Crown Copyright
  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. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */ -}}
  13. {{- if and .Values.config.rackAwareness .Values.config.rackAwareness.nodeTopologyLabel -}}
  14. apiVersion: v1
  15. kind: Pod
  16. metadata:
  17. name: {{ template "hdfs.fullname" . }}-rack-awareness-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", "hdfs dfsadmin -printTopology | grep Rack: | grep -v /default-rack"]
  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 }}
  49. {{- end -}}