Collectd operator utilties
[demo.git] / vnfs / DAaaS / training-core / charts / kubernetes-HDFS / charts / hdfs-simple-namenode-k8s / templates / namenode-statefulset.yaml
1 # A headless service to create DNS records.
2 apiVersion: v1
3 kind: Service
4 metadata:
5   name: {{ template "hdfs-k8s.namenode.fullname" . }}
6   labels:
7     app: {{ template "hdfs-k8s.namenode.name" . }}
8     chart: {{ template "hdfs-k8s.subchart" . }}
9     release: {{ .Release.Name }}
10 spec:
11   ports:
12   - port: 8020
13     name: fs
14   clusterIP: None
15   selector:
16     app: {{ template "hdfs-k8s.namenode.name" . }}
17     release: {{ .Release.Name }}
18 ---
19 apiVersion: apps/v1beta1
20 kind: StatefulSet
21 metadata:
22   name: {{ template "hdfs-k8s.namenode.fullname" . }}
23   labels:
24     app: {{ template "hdfs-k8s.namenode.name" . }}
25     chart: {{ template "hdfs-k8s.subchart" . }}
26     release: {{ .Release.Name }}
27 spec:
28   serviceName: {{ template "hdfs-k8s.namenode.fullname" . }}
29   # Create a size-1 set.
30   replicas: 1
31   template:
32     metadata:
33       labels:
34         app: {{ template "hdfs-k8s.namenode.name" . }}
35         release: {{ .Release.Name }}
36       {{- if .Values.podAnnotations }}
37       annotations:
38 {{ toYaml .Values.podAnnotations | indent 8 }}
39       {{- end }}
40     spec:
41       {{- if .Values.affinity }}
42       affinity:
43 {{ toYaml .Values.affinity | indent 8 }}
44       {{- end }}
45       {{- if .Values.nodeSelector }}
46       nodeSelector:
47 {{ toYaml .Values.nodeSelector | indent 8 }}
48       {{- end }}
49       {{- if .Values.tolerations }}
50       tolerations:
51 {{ toYaml .Values.tolerations | indent 8 }}
52       {{- end }}
53       # Use hostNetwork so datanodes connect to namenode without going through an overlay network
54       # like weave. Otherwise, namenode fails to see physical IP address of datanodes.
55       hostNetwork: true
56       hostPID: true
57       dnsPolicy: ClusterFirstWithHostNet
58       containers:
59         - name: hdfs-namenode
60           image: uhopper/hadoop-namenode:2.7.2
61           env:
62             - name: HADOOP_CUSTOM_CONF_DIR
63               value: /etc/hadoop-custom-conf
64             - name: CLUSTER_NAME
65               value: hdfs-k8s
66           ports:
67           - containerPort: 8020
68             name: fs
69           volumeMounts:
70             - name: hdfs-name
71               mountPath: /hadoop/dfs/name
72             - name: hdfs-config
73               mountPath: /etc/hadoop-custom-conf
74               readOnly: true
75       restartPolicy: Always
76       volumes:
77         - name: hdfs-name
78           hostPath:
79             path: {{ .Values.nameNodeHostPath }}
80         - name: hdfs-config
81           configMap:
82             name: {{ template "hdfs-k8s.config.fullname" . }}