| apiVersion: apps/v1beta1 |
| kind: StatefulSet |
| metadata: |
| name: {{ template "hbase.name" . }}-hdfs-dn |
| annotations: |
| checksum/config: {{ include (print $.Template.BasePath "/hadoop-configmap.yaml") . | sha256sum }} |
| labels: |
| app: {{ template "hadoop.name" . }} |
| chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
| release: {{ .Release.Name }} |
| heritage: {{ .Release.Service }} |
| component: hdfs-dn |
| spec: |
| serviceName: {{ template "hbase.name" . }}-hdfs-dn |
| replicas: {{ .Values.hdfs.dataNode.replicas }} |
| template: |
| metadata: |
| labels: |
| app: {{ template "hadoop.name" . }} |
| release: {{ .Release.Name }} |
| component: hdfs-dn |
| spec: |
| affinity: |
| podAntiAffinity: |
| {{- if eq .Values.antiAffinity "hard" }} |
| requiredDuringSchedulingIgnoredDuringExecution: |
| - topologyKey: "kubernetes.io/hostname" |
| labelSelector: |
| matchLabels: |
| app: {{ template "hadoop.name" . }} |
| release: {{ .Release.Name | quote }} |
| component: hdfs-dn |
| {{- else if eq .Values.antiAffinity "soft" }} |
| preferredDuringSchedulingIgnoredDuringExecution: |
| - weight: 5 |
| podAffinityTerm: |
| topologyKey: "kubernetes.io/hostname" |
| labelSelector: |
| matchLabels: |
| app: {{ template "hadoop.name" . }} |
| release: {{ .Release.Name | quote }} |
| component: hdfs-dn |
| {{- end }} |
| terminationGracePeriodSeconds: 0 |
| containers: |
| - name: hdfs-dn |
| image: {{ .Values.image }} |
| imagePullPolicy: {{ .Values.imagePullPolicy }} |
| command: |
| - "/bin/bash" |
| - "/tmp/hadoop-config/bootstrap.sh" |
| - "-d" |
| resources: |
| {{ toYaml .Values.hdfs.dataNode.resources | indent 10 }} |
| readinessProbe: |
| httpGet: |
| path: / |
| port: 50075 |
| initialDelaySeconds: 5 |
| timeoutSeconds: 2 |
| livenessProbe: |
| httpGet: |
| path: / |
| port: 50075 |
| initialDelaySeconds: 10 |
| timeoutSeconds: 2 |
| volumeMounts: |
| - name: hadoop-config |
| mountPath: /tmp/hadoop-config |
| - name: dfs |
| mountPath: /root/hdfs/datanode |
| volumes: |
| - name: hadoop-config |
| configMap: |
| name: hadoop-configmap |
| - name: dfs |
| {{- if .Values.persistence.dataNode.enabled }} |
| persistentVolumeClaim: |
| claimName: {{ template "hbase.name" . }}-hdfs-dn |
| {{- else }} |
| emptyDir: {} |
| {{- end }} |