kubekey/builtin/roles/certs/renew-kubernetes/tasks/kube.yaml
II 4919e639c5
feature: use go template instance pongo2 template (#2340)
* fix: misspelling

Signed-off-by: joyceliu <joyceliu@yunify.com>

* fix: misspelling

Signed-off-by: joyceliu <joyceliu@yunify.com>

* fix: misspelling

Signed-off-by: joyceliu <joyceliu@yunify.com>

* fix: misspelling

Signed-off-by: joyceliu <joyceliu@yunify.com>

* feat: user go-template instance pongo2-template

Signed-off-by: joyceliu <joyceliu@yunify.com>

* feat: not set incorrect

Signed-off-by: joyceliu <joyceliu@yunify.com>

* feat: more beautiful progress bar

Signed-off-by: joyceliu <joyceliu@yunify.com>

* feat: more beautiful progress bar

Signed-off-by: joyceliu <joyceliu@yunify.com>

* feat: more beautiful progress bar

Signed-off-by: joyceliu <joyceliu@yunify.com>

* feat: more beautiful progress bar

Signed-off-by: joyceliu <joyceliu@yunify.com>

* feat: more beautiful progress bar

Signed-off-by: joyceliu <joyceliu@yunify.com>

* feat: more beautiful progress bar

Signed-off-by: joyceliu <joyceliu@yunify.com>

* feat: more beautiful progress bar

Signed-off-by: joyceliu <joyceliu@yunify.com>

* feat: more beautiful progress bar

Signed-off-by: joyceliu <joyceliu@yunify.com>

* feat: more beautiful progress bar

Signed-off-by: joyceliu <joyceliu@yunify.com>

* feat: more beautiful progress bar

Signed-off-by: joyceliu <joyceliu@yunify.com>

* feat: more beautiful progress bar

Signed-off-by: joyceliu <joyceliu@yunify.com>

* feat: more beautiful progress bar

Signed-off-by: joyceliu <joyceliu@yunify.com>

* feat: more beautiful progress bar

Signed-off-by: joyceliu <joyceliu@yunify.com>

---------

Signed-off-by: joyceliu <joyceliu@yunify.com>
Co-authored-by: joyceliu <joyceliu@yunify.com>
2024-08-05 10:06:49 +08:00

52 lines
1.9 KiB
YAML

---
- name: Check kubeadm version
tags: ["certs"]
run_once: true
command: kubeadm version -o short
register: kubeadm_install_version
- name: Renew cert by kubeadm
tags: ["certs"]
run_once: true
command: |
{{- if .kubeadm_install_version.stdout | semverCompare "<v1.20.0" -}}
/usr/local/bin/kubeadm alpha certs renew apiserver
/usr/local/bin/kubeadm alpha certs renew apiserver-kubelet-client
/usr/local/bin/kubeadm alpha certs renew front-proxy-client
/usr/local/bin/kubeadm alpha certs renew admin.conf
/usr/local/bin/kubeadm alpha certs renew controller-manager.conf
/usr/local/bin/kubeadm alpha certs renew scheduler.conf
{{- if and (.kubernetes.etcd.deployment_type | eq "internal") .renew_etcd -}}
/usr/local/bin/kubeadm alpha certs renew etcd-healthcheck-client
/usr/local/bin/kubeadm alpha certs renew etcd-peer
/usr/local/bin/kubeadm alpha certs renew etcd-server
{{- end -}}
{{- else -}}
/usr/local/bin/kubeadm certs renew apiserver
/usr/local/bin/kubeadm certs renew apiserver-kubelet-client
/usr/local/bin/kubeadm certs renew front-proxy-client
/usr/local/bin/kubeadm certs renew admin.conf
/usr/local/bin/kubeadm certs renew controller-manager.conf
/usr/local/bin/kubeadm certs renew scheduler.conf
{{- if and (.kubernetes.etcd.deployment_type | eq "internal") .renew_etcd -}}
/usr/local/bin/kubeadm certs renew etcd-healthcheck-client
/usr/local/bin/kubeadm certs renew etcd-peer
/usr/local/bin/kubeadm certs renew etcd-server
{{- end -}}
{{- end -}}
- name: Fetch kubeconfig to local
tags: ["certs"]
run_once: true
fetch:
src: /etc/kubernetes/admin.conf
dest: |
{{ .work_dir }}/kubekey/kubeconfig
- name: Sync kubeconfig to remote
tags: ["certs"]
copy:
src: |
{{ .work_dir }}/kubekey/kubeconfig
dest: /root/.kube/config