apiVersion: apps/v1beta1 kind: StatefulSet metadata: name: {{ template "hbase.name" . }}-hdfs-nn 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-nn spec: serviceName: {{ template "hbase.name" . }}-hdfs-nn replicas: 1 template: metadata: labels: app: {{ template "hadoop.name" . }} release: {{ .Release.Name }} component: hdfs-nn 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-nn {{- 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-nn {{- end }} terminationGracePeriodSeconds: 0 containers: - name: hdfs-nn image: {{ .Values.image }} imagePullPolicy: {{ .Values.imagePullPolicy }} command: - "/bin/bash" - "/tmp/hadoop-config/bootstrap.sh" - "-d" resources: {{ toYaml .Values.hdfs.nameNode.resources | indent 10 }} readinessProbe: httpGet: path: / port: 50070 initialDelaySeconds: 5 timeoutSeconds: 2 livenessProbe: httpGet: path: / port: 50070 initialDelaySeconds: 10 timeoutSeconds: 2 volumeMounts: - name: hadoop-config mountPath: /tmp/hadoop-config - name: dfs mountPath: /root/hdfs/namenode volumes: - name: hadoop-config configMap: name: hadoop-configmap {{- if .Values.persistence.nameNode.enabled }} volumeClaimTemplates: - metadata: name: dfs labels: app: {{ template "hadoop.name" . }} chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} component: hdfs-nn spec: accessModes: - {{ .Values.persistence.nameNode.accessMode | quote }} resources: requests: storage: {{ .Values.persistence.nameNode.size | quote }} {{- if .Values.persistence.nameNode.storageClass }} {{- if (eq "-" .Values.persistence.nameNode.storageClass) }} storageClassName: "" {{- else }} storageClassName: "{{ .Values.persistence.nameNode.storageClass }}" {{- end }} {{- end }} {{- end }}