shell.yaml 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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 .Values.shell.enabled }}
  14. apiVersion: apps/v1
  15. kind: Deployment
  16. metadata:
  17. name: {{ template "hdfs.fullname" . }}-shell
  18. labels:
  19. {{- include "hdfs.labels" . | nindent 4 }}
  20. app.kubernetes.io/component: shell
  21. spec:
  22. replicas: 1
  23. selector:
  24. matchLabels:
  25. {{- include "hdfs.selectorLabels" . | nindent 6 }}
  26. app.kubernetes.io/component: shell
  27. template:
  28. metadata:
  29. annotations:
  30. checksum/config: {{ include (print $.Template.BasePath "/config.yaml") . | sha256sum }}
  31. checksum/secrets: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }}
  32. labels:
  33. {{- include "hdfs.labels" . | nindent 8 }}
  34. app.kubernetes.io/component: shell
  35. spec:
  36. containers:
  37. - name: shell
  38. image: {{ .Values.shell.repository }}:{{ .Values.shell.tag }}
  39. imagePullPolicy: {{ .Values.shell.imagePullPolicy }}
  40. command:
  41. - /bin/bash
  42. stdin: true
  43. tty: true
  44. env:
  45. - name: HADOOP_CONF_DIR
  46. value: {{ .Values.config.path }}
  47. volumeMounts:
  48. - name: config
  49. mountPath: {{ .Values.config.path }}
  50. readOnly: true
  51. - name: secrets
  52. mountPath: {{ .Values.secrets.path }}
  53. readOnly: true
  54. resources:
  55. {{- toYaml .Values.shell.resources | nindent 10 }}
  56. volumes:
  57. - name: config
  58. configMap:
  59. name: {{ template "hdfs.fullname" . }}
  60. optional: false
  61. - name: secrets
  62. secret:
  63. secretName: {{ template "hdfs.fullname" . }}
  64. optional: false
  65. {{- with .Values.shell.affinity }}
  66. affinity:
  67. {{- toYaml . | nindent 8 }}
  68. {{- end }}
  69. {{- with .Values.shell.nodeSelector }}
  70. nodeSelector:
  71. {{- toYaml . | nindent 8 }}
  72. {{- end }}
  73. {{- with .Values.shell.tolerations }}
  74. tolerations:
  75. {{- toYaml . | nindent 8 }}
  76. {{- end }}
  77. {{- with .Values.shell.imagePullSecrets }}
  78. imagePullSecrets:
  79. {{- range . }}
  80. - name: {{ . }}
  81. {{- end }}
  82. {{- end }}
  83. {{- end }}