Skip to content

Commit 0f4ad8c

Browse files
authored
Making script more self-explanatory (#232)
Making script more self-explanatory for users because after they join the node they also have to apply the cni daemonset/service and the kube-proxy and they have to change the k8s version of the kube-proxy.yml file to match their own.
1 parent 5cfc90d commit 0f4ad8c

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

kubeadm/scripts/PrepareNode.ps1

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,25 @@ if ($ContainerRuntime -eq "Docker") {
145145
}
146146

147147
New-NetFirewallRule -Name kubelet -DisplayName 'kubelet' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 10250
148+
149+
Write-Output "Please remember that after you have joined the node to the cluster, that you have to apply the cni daemonset/service and the kube-proxy"
150+
Write-Output "Also remember that for kube-proxy you have to change the its version from the name of the image in the kube-proxy.yml to that of your kubernetes version `n"
151+
# rancher commands
152+
Write-Output "In case you use rancher, use the following commands:"
153+
Write-Output "For Windows you can use the following command: "
154+
Write-Output "(Get-Content `"$(git rev-parse --show-toplevel)/kubeadm/kube-proxy/kube-proxy.yml`") -Replace 'VERSION', '$KubernetesVersion' | Set-Content `"$(git rev-parse --show-toplevel)/kubeadm/kube-proxy/kube-proxy.yml`" `n"
155+
Write-Output "For Linux, you can use the following command: "
156+
Write-Output "sed -i 's/VERSION/$KubernetesVersion/g' `$(find `$(git rev-parse --show-toplevel) -iname 'kube-proxy.yml' | grep kubeadm)`n"
157+
# flannel commands
158+
Write-Output "In case you use flannel, use the following commands:"
159+
Write-Output "For Windows you can use the following command: "
160+
Write-Output "(Get-Content `"$(git rev-parse --show-toplevel)/hostprocess/flannel/kube-proxy/kube-proxy.yml`") -Replace 'image: (.*):(.*)-(.*)-(.*)$', 'image: `$1:$KubernetesVersion-`$3-`$4' | Set-Content `"$(git rev-parse --show-toplevel)/hostprocess/flannel/kube-proxy/kube-proxy.yml`" `n"
161+
Write-Output "For Linux, you can use the following command: "
162+
Write-Output "sed -i -E 's/image: (.*):(.*)-(.*)-(.*)$/image: \1:$KubernetesVersion-\3-\4/g' `$(find `$(git rev-parse --show-toplevel) -iname 'kube-proxy.yml' | grep flannel)`n"
163+
# calico commands
164+
Write-Output "In case you use calico, use the following commands:"
165+
Write-Output "For Windows you can use the following command: "
166+
Write-Output "(Get-Content `"$(git rev-parse --show-toplevel)/hostprocess/calico/kube-proxy/kube-proxy.yml`") -Replace 'image: (.*):(.*)-(.*)-(.*)$', 'image: `$1:$KubernetesVersion-`$3-`$4' | Set-Content `"$(git rev-parse --show-toplevel)/hostprocess/calico/kube-proxy/kube-proxy.yml`" `n"
167+
Write-Output "For Linux, you can use the following command: "
168+
# - image: sigwindowstools/kube-proxy:v1.24.2-flannel-hostprocess
169+
Write-Output "sed -i -E 's/image: (.*):(.*)-(.*)-(.*)$/image: \1:$KubernetesVersion-\3-\4/g' `$(find `$(git rev-parse --show-toplevel) -iname 'kube-proxy.yml' | grep calico)`n"

0 commit comments

Comments
 (0)