kubekey/builtin/roles/certs/renew-kubernetes/tasks/main.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

29 lines
1.4 KiB
YAML

---
- include_tasks: kube.yaml
tags: ["certs"]
- include_tasks: etcd.yaml
tags: ["certs"]
when:
- and (.kubernetes.etcd.deployment_type | eq "external") (.groups.etcd | default list | len | lt 0)
- .renew_etcd
- name: Reload kubernetes pods
tags: [ "certs" ]
command: |
{{- if .cri.container_manager | eq "docker" -}}
docker ps -af name=k8s_PODS_kube-apiserver* -q | xargs --no-run-if-empty docker rm -f
docker ps -af name=k8s_PODS_kube-controller-manager* -q | xargs --no-run-if-empty docker rm -f
docker ps -af name=k8s_PODS_kube-scheduler* -q | xargs --no-run-if-empty docker rm -f
{{- if and (.kubernetes.etcd.deployment_type | eq "docker") .renew_etcd -}}
docker ps -af name=k8s_PODS_etcd* -q | xargs --no-run-if-empty docker rm -f
{{- end -}}
{{- else -}}
crictl pods --name kube-apiserver-* -q | xargs -I% --no-run-if-empty bash -c 'crictl stopp % && crictl rmp %'
crictl pods --name kube-controller-manager-* -q | xargs -I% --no-run-if-empty bash -c 'crictl stopp % && crictl rmp %'
crictl pods --name kube-scheduler-* -q | xargs -I% --no-run-if-empty bash -c 'crictl stopp % && crictl rmp %'
{{- if and (.kubernetes.etcd.deployment_type | eq "internal") .renew_etcd -}}
crictl pods --name etcd-* -q | xargs -I% --no-run-if-empty bash -c 'crictl stopp % && crictl rmp %'
{{- end -}}
{{- end -}}