From 55280ab09b0e15acc66fa77306acaefbfd5a5740 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Serv=C3=A9n=20Mar=C3=ADn?= Date: Fri, 17 May 2019 22:29:49 +0200 Subject: [PATCH] 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. --- manifests/kilo-bootkube-flannel.yaml | 6 ++++++ manifests/kilo-bootkube.yaml | 6 ++++++ manifests/kilo-k3s-flannel.yaml | 6 ++++++ manifests/kilo-k3s.yaml | 6 ++++++ manifests/kilo-kubeadm-flannel.yaml | 6 ++++++ manifests/kilo-kubeadm.yaml | 6 ++++++ manifests/kilo-typhoon-flannel.yaml | 6 ++++++ manifests/kilo-typhoon.yaml | 6 ++++++ 8 files changed, 48 insertions(+) diff --git a/manifests/kilo-bootkube-flannel.yaml b/manifests/kilo-bootkube-flannel.yaml index e1cac32..7391fb9 100644 --- a/manifests/kilo-bootkube-flannel.yaml +++ b/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: diff --git a/manifests/kilo-bootkube.yaml b/manifests/kilo-bootkube.yaml index 34b33e7..426441d 100644 --- a/manifests/kilo-bootkube.yaml +++ b/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: diff --git a/manifests/kilo-k3s-flannel.yaml b/manifests/kilo-k3s-flannel.yaml index 99a5234..7de0022 100644 --- a/manifests/kilo-k3s-flannel.yaml +++ b/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: diff --git a/manifests/kilo-k3s.yaml b/manifests/kilo-k3s.yaml index dcdb925..b1768bb 100644 --- a/manifests/kilo-k3s.yaml +++ b/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: diff --git a/manifests/kilo-kubeadm-flannel.yaml b/manifests/kilo-kubeadm-flannel.yaml index 10d7f56..701dbea 100644 --- a/manifests/kilo-kubeadm-flannel.yaml +++ b/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: diff --git a/manifests/kilo-kubeadm.yaml b/manifests/kilo-kubeadm.yaml index 59e83aa..057a3a5 100644 --- a/manifests/kilo-kubeadm.yaml +++ b/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: diff --git a/manifests/kilo-typhoon-flannel.yaml b/manifests/kilo-typhoon-flannel.yaml index c3885b2..dc74d85 100644 --- a/manifests/kilo-typhoon-flannel.yaml +++ b/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: diff --git a/manifests/kilo-typhoon.yaml b/manifests/kilo-typhoon.yaml index 2a09cc1..e6ae7c2 100644 --- a/manifests/kilo-typhoon.yaml +++ b/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: