标签:.com pat x509 http util clone data get wget
拉取kubernetes的源码:
git clone https://github.com/kubernetes/kubernetes.git
切换版本:
cd kubernetes && git checkout -b remotes/origin/release-1.12 v1.12.3
安装Go环境:
wget https://dl.google.com/go/go1.11.2.linux-amd64.tar.gz tar zxvf go1.11.2.linux-amd64.tar.gz -C /usr/local #编辑/etc/profile文件添加如下: #go setting export GOROOT=/usr/local/go export GOPATH=/usr/local/gopath export PATH=$PATH:$GOROOT/bin source /etc/profile 生效 验证: go version go version go1.11.2 linux/amd64
修改源码:
cd /kubernetes/staging/src/k8s.io/client-go/util/cert/cert.go #编辑 cert.go文件
maxAge := time.Hour * 24 * 365 #修改前
maxAge := time.Hour * 24 * 365 * 50 #修改后 给证书期限为50年
编译Go:
cd /kubernetes/ && make WHAT=cmd/kubeadm
查看编译后的文件
ls -l /data/kubernetes/_output/bin/kubeadm
替换kubeadm
mv /usr/bin/kubeadm /usr/bin/kubeadm_backup
ln -s /data/kubernetes/_output/bin/kubeadm /usr/bin/kubeadm
重新初始化集群并查看证书
cd /etc/kubernetes/pki openssl x509 -in front-proxy-client.crt -noout -text |grep Not
kubernetes-kubeadm自动生成的证书过期的解决方法
标签:.com pat x509 http util clone data get wget
原文地址:https://www.cnblogs.com/kuku0223/p/10509637.html