Просмотр исходного кода

manifests: default hostname to spec.nodeName

Not all K8s installs will correctly match the node's hostname to the
node's name in the API. We can get around this by setting the name Kilo
uses to the node name in the API.
Lucas Servén Marín 7 лет назад
Родитель
Сommit
55280ab09b

+ 6 - 0
manifests/kilo-bootkube-flannel.yaml

@@ -65,9 +65,15 @@ spec:
         image: squat/kilo
         args:
         - --kubeconfig=/etc/kubernetes/kubeconfig
+        - --hostname=$(NODE_NAME)
         - --cni=false
         - --compatibility=flannel
         - --local=false
+        env:
+        - name: NODE_NAME
+          valueFrom:
+            fieldRef:
+              fieldPath: spec.nodeName
         securityContext:
           privileged: true
         volumeMounts:

+ 6 - 0
manifests/kilo-bootkube.yaml

@@ -97,6 +97,12 @@ spec:
         image: squat/kilo
         args:
         - --kubeconfig=/etc/kubernetes/kubeconfig
+        - --hostname=$(NODE_NAME)
+        env:
+        - name: NODE_NAME
+          valueFrom:
+            fieldRef:
+              fieldPath: spec.nodeName
         securityContext:
           privileged: true
         volumeMounts:

+ 6 - 0
manifests/kilo-k3s-flannel.yaml

@@ -65,9 +65,15 @@ spec:
         image: squat/kilo
         args:
         - --kubeconfig=/etc/kubernetes/kubeconfig
+        - --hostname=$(NODE_NAME)
         - --cni=false
         - --compatibility=flannel
         - --local=false
+        env:
+        - name: NODE_NAME
+          valueFrom:
+            fieldRef:
+              fieldPath: spec.nodeName
         securityContext:
           privileged: true
         volumeMounts:

+ 6 - 0
manifests/kilo-k3s.yaml

@@ -97,6 +97,12 @@ spec:
         image: squat/kilo
         args:
         - --kubeconfig=/etc/kubernetes/kubeconfig
+        - --hostname=$(NODE_NAME)
+        env:
+        - name: NODE_NAME
+          valueFrom:
+            fieldRef:
+              fieldPath: spec.nodeName
         securityContext:
           privileged: true
         volumeMounts:

+ 6 - 0
manifests/kilo-kubeadm-flannel.yaml

@@ -65,9 +65,15 @@ spec:
         image: squat/kilo
         args:
         - --kubeconfig=/etc/kubernetes/kubeconfig
+        - --hostname=$(NODE_NAME)
         - --cni=false
         - --compatibility=flannel
         - --local=false
+        env:
+        - name: NODE_NAME
+          valueFrom:
+            fieldRef:
+              fieldPath: spec.nodeName
         securityContext:
           privileged: true
         volumeMounts:

+ 6 - 0
manifests/kilo-kubeadm.yaml

@@ -97,6 +97,12 @@ spec:
         image: squat/kilo
         args:
         - --kubeconfig=/etc/kubernetes/kubeconfig
+        - --hostname=$(NODE_NAME)
+        env:
+        - name: NODE_NAME
+          valueFrom:
+            fieldRef:
+              fieldPath: spec.nodeName
         securityContext:
           privileged: true
         volumeMounts:

+ 6 - 0
manifests/kilo-typhoon-flannel.yaml

@@ -65,9 +65,15 @@ spec:
         image: squat/kilo
         args:
         - --kubeconfig=/etc/kubernetes/kubeconfig
+        - --hostname=$(NODE_NAME)
         - --cni=false
         - --compatibility=flannel
         - --local=false
+        env:
+        - name: NODE_NAME
+          valueFrom:
+            fieldRef:
+              fieldPath: spec.nodeName
         securityContext:
           privileged: true
         volumeMounts:

+ 6 - 0
manifests/kilo-typhoon.yaml

@@ -97,6 +97,12 @@ spec:
         image: squat/kilo
         args:
         - --kubeconfig=/etc/kubernetes/kubeconfig
+        - --hostname=$(NODE_NAME)
+        env:
+        - name: NODE_NAME
+          valueFrom:
+            fieldRef:
+              fieldPath: spec.nodeName
         securityContext:
           privileged: true
         volumeMounts: