Skip to content

Commit ab652ce

Browse files
hunterkimoonkim
authored andcommitted
Use ClusterFirstWithHostNet to replace resolv.conf override (#16)
1 parent 9543385 commit ab652ce

File tree

2 files changed

+2
-22
lines changed

2 files changed

+2
-22
lines changed

charts/hdfs-datanode-k8s/templates/datanode-daemonset.yaml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ spec:
2727
spec:
2828
hostNetwork: true
2929
hostPID: true
30+
dnsPolicy: ClusterFirstWithHostNet
3031
containers:
3132
- name: datanode
3233
image: uhopper/hadoop-datanode:2.7.2
@@ -62,11 +63,6 @@ spec:
6263
- name: hdfs-data-{{ $index }}
6364
mountPath: /hadoop/dfs/data/{{ $index }}
6465
{{- end }}
65-
# Use subPath below to mount only a single file.
66-
# See https://github.com/dshulyak/kubernetes.github.io/commit/d58ba7b075bb4848349a2c920caaa08ff3773d70
67-
- name: resolv-conf-volume
68-
mountPath: /etc/resolv.conf
69-
subPath: resolv.conf
7066
affinity:
7167
nodeAffinity:
7268
requiredDuringSchedulingIgnoredDuringExecution:
@@ -81,9 +77,3 @@ spec:
8177
hostPath:
8278
path: {{ $path }}
8379
{{- end }}
84-
- configMap:
85-
name: hdfs-resolv-conf
86-
items:
87-
- key: resolv.conf
88-
path: resolv.conf
89-
name: resolv-conf-volume

charts/hdfs-namenode-k8s/templates/namenode-statefulset.yaml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ spec:
4646
# like weave. Otherwise, namenode fails to see physical IP address of datanodes.
4747
hostNetwork: true
4848
hostPID: true
49+
dnsPolicy: ClusterFirstWithHostNet
4950
containers:
5051
- name: hdfs-namenode
5152
image: uhopper/hadoop-namenode:2.7.2
@@ -58,11 +59,6 @@ spec:
5859
volumeMounts:
5960
- name: hdfs-name
6061
mountPath: /hadoop/dfs/name
61-
# Use subPath below to mount only a single file.
62-
# See https://github.com/dshulyak/kubernetes.github.io/commit/d58ba7b075bb4848349a2c920caaa08ff3773d70
63-
- name: resolv-conf-volume
64-
mountPath: /etc/resolv.conf
65-
subPath: resolv.conf
6662
# Pin the pod to a node. You can label your node like below:
6763
# $ kubectl label nodes YOUR-NODE hdfs-namenode-selector=hdfs-namenode-0
6864
nodeSelector:
@@ -72,9 +68,3 @@ spec:
7268
- name: hdfs-name
7369
hostPath:
7470
path: {{ .Values.nameNodeHostPath }}
75-
- configMap:
76-
name: hdfs-resolv-conf
77-
items:
78-
- key: resolv.conf
79-
path: resolv.conf
80-
name: resolv-conf-volume

0 commit comments

Comments
 (0)