Skip to content

Commit

Permalink
fix hardcoded project id and make kube-vip version configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
davidspek committed Apr 8, 2022
1 parent d95b01a commit 088bbf9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions templates/cluster-template-crs-cni.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ spec:
postKubeadmCommands:
- |
if [ -f "/run/kubeadm/kubeadm-join-config.yaml" ]; then
KVVERSION="v0.4.2"
KVVERSION="${KUBE_VIP_VERSION:=v0.4.2}"
ctr image pull ghcr.io/kube-vip/kube-vip:$${KVVERSION}
ctr run --rm --net-host ghcr.io/kube-vip/kube-vip:$${KVVERSION} vip /kube-vip manifest pod --interface "lo" --vip "{{ .controlPlaneEndpoint }}" --controlplane --bgp --metal --metalKey "{{ .apiKey }}" --metalProjectID "b264ba74-f3bd-49f0-ae24-b0953765b7aa" | tee /etc/kubernetes/manifests/kube-vip.yaml
ctr run --rm --net-host ghcr.io/kube-vip/kube-vip:$${KVVERSION} vip /kube-vip manifest pod --interface "lo" --vip "{{ .controlPlaneEndpoint }}" --controlplane --bgp --metal --metalKey "{{ .apiKey }}" --metalProjectID "${PROJECT_ID}" | tee /etc/kubernetes/manifests/kube-vip.yaml
fi
- |
if [ -f "/run/kubeadm/kubeadm.yaml" ]; then
Expand Down Expand Up @@ -186,10 +186,10 @@ spec:
- systemctl start containerd
- |
if [ -f "/run/kubeadm/kubeadm.yaml" ]; then
KVVERSION="v0.4.2"
KVVERSION="${KUBE_VIP_VERSION:=v0.4.2}"
ctr image pull ghcr.io/kube-vip/kube-vip:$${KVVERSION}
mkdir -p /etc/kubernetes/manifests/
ctr run --rm --net-host ghcr.io/kube-vip/kube-vip:$${KVVERSION} vip /kube-vip manifest pod --interface "lo" --vip "{{ .controlPlaneEndpoint }}" --controlplane --bgp --metal --metalKey "{{ .apiKey }}" --metalProjectID "b264ba74-f3bd-49f0-ae24-b0953765b7aa" | tee /etc/kubernetes/manifests/kube-vip.yaml
ctr run --rm --net-host ghcr.io/kube-vip/kube-vip:$${KVVERSION} vip /kube-vip manifest pod --interface "lo" --vip "{{ .controlPlaneEndpoint }}" --controlplane --bgp --metal --metalKey "{{ .apiKey }}" --metalProjectID "${PROJECT_ID}" | tee /etc/kubernetes/manifests/kube-vip.yaml
fi
machineTemplate:
infrastructureRef:
Expand Down
8 changes: 4 additions & 4 deletions templates/cluster-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,17 @@ spec:
- systemctl start containerd
- |
if [ -f "/run/kubeadm/kubeadm.yaml" ]; then
KVVERSION="v0.4.2"
KVVERSION="${KUBE_VIP_VERSION:=v0.4.2}"
ctr image pull ghcr.io/kube-vip/kube-vip:$${KVVERSION}
mkdir -p /etc/kubernetes/manifests/
ctr run --rm --net-host ghcr.io/kube-vip/kube-vip:$${KVVERSION} vip /kube-vip manifest pod --interface "lo" --vip "{{ .controlPlaneEndpoint }}" --controlplane --bgp --metal --metalKey "{{ .apiKey }}" --metalProjectID "b264ba74-f3bd-49f0-ae24-b0953765b7aa" | tee /etc/kubernetes/manifests/kube-vip.yaml
ctr run --rm --net-host ghcr.io/kube-vip/kube-vip:$${KVVERSION} vip /kube-vip manifest pod --interface "lo" --vip "{{ .controlPlaneEndpoint }}" --controlplane --bgp --metal --metalKey "{{ .apiKey }}" --metalProjectID "${PROJECT_ID}" | tee /etc/kubernetes/manifests/kube-vip.yaml
fi
postKubeadmCommands:
- |
if [ -f "/run/kubeadm/kubeadm-join-config.yaml" ]; then
KVVERSION="v0.4.2"
KVVERSION="${KUBE_VIP_VERSION:=v0.4.2}"
ctr image pull ghcr.io/kube-vip/kube-vip:$${KVVERSION}
ctr run --rm --net-host ghcr.io/kube-vip/kube-vip:$${KVVERSION} vip /kube-vip manifest pod --interface "lo" --vip "{{ .controlPlaneEndpoint }}" --controlplane --bgp --metal --metalKey "{{ .apiKey }}" --metalProjectID "b264ba74-f3bd-49f0-ae24-b0953765b7aa" | tee /etc/kubernetes/manifests/kube-vip.yaml
ctr run --rm --net-host ghcr.io/kube-vip/kube-vip:$${KVVERSION} vip /kube-vip manifest pod --interface "lo" --vip "{{ .controlPlaneEndpoint }}" --controlplane --bgp --metal --metalKey "{{ .apiKey }}" --metalProjectID "${PROJECT_ID}" | tee /etc/kubernetes/manifests/kube-vip.yaml
fi
- |
if [ -f "/run/kubeadm/kubeadm.yaml" ]; then
Expand Down

0 comments on commit 088bbf9

Please sign in to comment.