Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add resource limits/requests to helm charts #74

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions charts/hdfs-datanode-k8s/templates/datanode-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ spec:
- name: JSVC_HOME
value: /jsvc-home
{{- end }}
{{- if .Values.env }}
{{ toYaml .Values.env | indent 12 }}
{{- end }}
livenessProbe:
exec:
command:
Expand All @@ -108,6 +111,8 @@ spec:
periodSeconds: 30
securityContext:
privileged: true
resources:
{{ toYaml .Values.resources | indent 12 }}
volumeMounts:
- name: dn-scripts
mountPath: /dn-scripts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,18 @@ 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:
- containerPort: 8485
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
Expand Down
55 changes: 54 additions & 1 deletion charts/hdfs-k8s/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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: []
Expand Down Expand Up @@ -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
Expand All @@ -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: []
Expand All @@ -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: []
Expand Down
5 changes: 5 additions & 0 deletions charts/hdfs-namenode-k8s/templates/namenode-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -197,6 +200,8 @@ spec:
name: fs
- containerPort: 50070
name: http
resources:
{{ toYaml .Values.resources | indent 12 }}
volumeMounts:
- name: nn-scripts
mountPath: /nn-scripts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ spec:
ports:
- containerPort: 8020
name: fs
resources:
{{ toYaml .Values.resources | indent 12 }}
volumeMounts:
- name: hdfs-name
mountPath: /hadoop/dfs/name
Expand Down