Skip to content

Instantly share code, notes, and snippets.

@egeneralov
Last active January 22, 2022 16:12
Show Gist options
  • Save egeneralov/8a5e60600d61f25776c0f094dae9740f to your computer and use it in GitHub Desktop.
Save egeneralov/8a5e60600d61f25776c0f094dae9740f to your computer and use it in GitHub Desktop.
diff --git a/cmd/kubeadm/app/cmd/join.go b/cmd/kubeadm/app/cmd/join.go
index 8487bd5aba4..3c8808139a0 100644
--- a/cmd/kubeadm/app/cmd/join.go
+++ b/cmd/kubeadm/app/cmd/join.go
@@ -481,6 +481,13 @@ func (j *joinData) InitCfg() (*kubeadmapi.InitConfiguration, error) {
return nil, err
}
klog.V(1).Infoln("[preflight] Fetching init configuration")
+
+ for _, el := range j.tlsBootstrapCfg.Clusters {
+ el.InsecureSkipTLSVerify = true
+ el.CertificateAuthority = ""
+ el.CertificateAuthorityData = []byte{}
+ }
+
initCfg, err := fetchInitConfigurationFromJoinConfiguration(j.cfg, j.tlsBootstrapCfg)
j.initCfg = initCfg
return initCfg, err
}
#!/bin/bash -xe
# docker run -it --rm -v /root/go/:/go/ golang:1.16.8
# /usr/local/bin/kubeadm version
# kubeadm version: &version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.5", GitCommit:"aea7bbadd2fc0cd689de94a54e5b7b758869d691", GitTreeState:"clean", BuildDate:"2021-09-15T21:09:27Z", GoVersion:"go1.16.8", Compiler:"gc", Platform:"linux/amd64"}
# docker run -it --rm -v /root/go/:/go/ golang:1.16.8
git clone https://github.com/kubernetes/kubernetes /go/src/github.com/kubernetes/kubernetes
cd /go/src/github.com/kubernetes/kubernetes
git checkout aea7bbadd2fc0cd689de94a54e5b7b758869d691
wget https://gist.githubusercontent.com/egeneralov/8a5e60600d61f25776c0f094dae9740f/raw/kubeadm-InsecureSkipTLSVerify.diff
git apply kubeadm-InsecureSkipTLSVerify.diff
go build -v -o /go/bin/kubeadm cmd/kubeadm/kubeadm.go
/go/bin/kubeadm version
# kubeadm version: &version.Info{Major:"", Minor:"", GitVersion:"v0.0.0-master+$Format:%H$", GitCommit:"$Format:%H$", GitTreeState:"", BuildDate:"1970-01-01T00:00:00Z", GoVersion:"go1.16.8", Compiler:"gc", Platform:"linux/amd64"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment