diff --git a/charts/hdfs-datanode-k8s/templates/datanode-daemonset.yaml b/charts/hdfs-datanode-k8s/templates/datanode-daemonset.yaml index 09445ed..9238dfd 100644 --- a/charts/hdfs-datanode-k8s/templates/datanode-daemonset.yaml +++ b/charts/hdfs-datanode-k8s/templates/datanode-daemonset.yaml @@ -94,6 +94,9 @@ spec: - name: JSVC_HOME value: /jsvc-home {{- end }} +{{- if .Values.env }} +{{ toYaml .Values.env | indent 12 }} +{{- end }} livenessProbe: exec: command: @@ -108,6 +111,8 @@ spec: periodSeconds: 30 securityContext: privileged: true + resources: +{{ toYaml .Values.resources | indent 12 }} volumeMounts: - name: dn-scripts mountPath: /dn-scripts diff --git a/charts/hdfs-journalnode-k8s/templates/journalnode-statefulset.yaml b/charts/hdfs-journalnode-k8s/templates/journalnode-statefulset.yaml index 22a4a2b..f95afd0 100644 --- a/charts/hdfs-journalnode-k8s/templates/journalnode-statefulset.yaml +++ b/charts/hdfs-journalnode-k8s/templates/journalnode-statefulset.yaml @@ -91,6 +91,9 @@ spec: env: - name: HADOOP_CUSTOM_CONF_DIR value: /etc/hadoop-custom-conf +{{- if .Values.env }} +{{ toYaml .Values.env | indent 12 }} +{{- end }} command: ["/entrypoint.sh"] args: ["/opt/hadoop-2.7.2/bin/hdfs", "--config", "/etc/hadoop", "journalnode"] ports: @@ -98,6 +101,8 @@ spec: name: jn - containerPort: 8480 name: http + resources: +{{ toYaml .Values.resources | indent 12 }} volumeMounts: # Mount a subpath of the volume so that the journal subdir would be # a brand new empty dir. This way, we won't get affected by diff --git a/charts/hdfs-k8s/values.yaml b/charts/hdfs-k8s/values.yaml index 77ca3fe..8ebb8eb 100644 --- a/charts/hdfs-k8s/values.yaml +++ b/charts/hdfs-k8s/values.yaml @@ -4,7 +4,7 @@ zookeeper: ## Configure Zookeeper resource requests and limits ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ - resources: ~ + resources: {} ## The JVM heap size to allocate to Zookeeper env: @@ -48,6 +48,20 @@ hdfs-journalnode-k8s: accessMode: ReadWriteOnce size: 20Gi + resources: {} + ## Optionally specify how much CPU and memory (RAM) each container needs. + ## + # limits: + # cpu: 1 + # memory: 512Mi + # requests: + # cpu: 100m + # memory: 128Mi + + env: [] + ## Optional environment variables + + ## Node labels and tolerations for pod assignment nodeSelector: {} tolerations: [] @@ -89,6 +103,19 @@ hdfs-namenode-k8s: accessMode: ReadWriteOnce size: 100Gi + + resources: {} + ## Optionally specify how much CPU and memory (RAM) each container needs. + ## + # limits: + # cpu: 1 + # memory: 512Mi + # requests: + # cpu: 100m + # memory: 128Mi + + env: [] + ## Optional environment variables ## Whether or not to use hostNetwork in namenode pods. Disabling this will break ## data locality as namenode will see pod virtual IPs and fails to equate them with @@ -110,6 +137,19 @@ hdfs-simple-namenode-k8s: ## volume. nameNodeHostPath: /hdfs-name + resources: {} + ## Optionally specify how much CPU and memory (RAM) each container needs. + ## + # limits: + # cpu: 1 + # memory: 512Mi + # requests: + # cpu: 100m + # memory: 128Mi + + env: [] + ## Optional environment variables + ## Node labels and tolerations for pod assignment nodeSelector: {} tolerations: [] @@ -119,6 +159,19 @@ hdfs-simple-namenode-k8s: ## hdfs-datanode-k8s: ## ------------------------------------------------------------------------------ hdfs-datanode-k8s: + resources: {} + ## Optionally specify how much CPU and memory (RAM) each container needs. + ## + # limits: + # cpu: 1 + # memory: 512Mi + # requests: + # cpu: 100m + # memory: 128Mi + + env: [] + ## Optional environment variables + ## Node labels and tolerations for pod assignment nodeSelector: {} tolerations: [] diff --git a/charts/hdfs-namenode-k8s/templates/namenode-statefulset.yaml b/charts/hdfs-namenode-k8s/templates/namenode-statefulset.yaml index 44e8fc6..d9c2134 100644 --- a/charts/hdfs-namenode-k8s/templates/namenode-statefulset.yaml +++ b/charts/hdfs-namenode-k8s/templates/namenode-statefulset.yaml @@ -188,6 +188,9 @@ spec: value: {{ template "namenode-pod-0" . }} - name: NAMENODE_POD_1 value: {{ template "namenode-pod-1" . }} +{{- if .Values.env }} +{{ toYaml .Values.env | indent 12 }} +{{- end }} command: ['/bin/sh', '-c'] # The start script is provided by a config map. args: @@ -197,6 +200,8 @@ spec: name: fs - containerPort: 50070 name: http + resources: +{{ toYaml .Values.resources | indent 12 }} volumeMounts: - name: nn-scripts mountPath: /nn-scripts diff --git a/charts/hdfs-simple-namenode-k8s/templates/namenode-statefulset.yaml b/charts/hdfs-simple-namenode-k8s/templates/namenode-statefulset.yaml index ab92efa..fa36757 100644 --- a/charts/hdfs-simple-namenode-k8s/templates/namenode-statefulset.yaml +++ b/charts/hdfs-simple-namenode-k8s/templates/namenode-statefulset.yaml @@ -66,6 +66,8 @@ spec: ports: - containerPort: 8020 name: fs + resources: +{{ toYaml .Values.resources | indent 12 }} volumeMounts: - name: hdfs-name mountPath: /hadoop/dfs/name