fix config overwrite bug

This commit is contained in:
fanux
2019-07-29 15:12:34 +08:00
parent dffe054bb2
commit bd935c4b99
2 changed files with 45 additions and 1 deletions
+44
View File
@@ -122,6 +122,50 @@ kubeadm join 10.103.97.2:6443 --token 9vr73a.a8uxyaju799qwdjv \
--discovery-token-ca-cert-hash sha256:7c2e69131a36ae2a042a339b33381c6d0d43887e2de83720eff5359e26aec866
```
## Using config file
For example, we need add a certSANs `sealyun.com`:
```
sealos config -t kubeadm >> kubeadm-config.yaml.tmpl
```
See the config template file `cat kubeadm-config.yaml.tmpl`, edit it add `sealyun.com`:
```
apiVersion: kubeadm.k8s.io/v1beta1
kind: ClusterConfiguration
kubernetesVersion: {{.Version}}
controlPlaneEndpoint: "apiserver.cluster.local:6443"
networking:
podSubnet: 100.64.0.0/10
apiServer:
certSANs:
- sealyun.com # this is what I added
- 127.0.0.1
- apiserver.cluster.local
{{range .Masters -}}
- {{.}}
{{end -}}
- {{.VIP}}
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
mode: "ipvs"
ipvs:
excludeCIDRs:
- "{{.VIP}}/32"
```
Then using --kubeadm-config flag:
```
sealos init --kubeadm-config kubeadm-config.yaml.tmpl \
--master 192.168.0.2 \
--master 192.168.0.3 \
--master 192.168.0.4 \
--node 192.168.0.5 \
--user root \
--passwd your-server-password \
--version v1.14.1 \
--pkg-url /root/kube1.14.1.tar.gz
```
## upgrade
[升级简体中文](docs/upgrade_zh.md)
+1 -1
View File
@@ -37,7 +37,7 @@ kubectl drain $NODE --ignore-daemonsets
```
更新kubelet配置:
```
kubeadm upgrade node config --kubelet-version v1.14.x
kubeadm upgrade node config --kubelet-version v1.15.0
```
然后升级kubelet 一样是替换二进制再重启 kubelet service
```