-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathk3s_remove.yaml
39 lines (35 loc) · 1.24 KB
/
k3s_remove.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
- hosts: nodes
tasks:
- name: export TLS certs secrets
shell: |
{{ KUBECTL_BIN }} get -o yaml \
--all-namespaces \
secrets --field-selector type==kubernetes.io/tls > {{ K8S_TLS_SECRETS_BACKUP }}-new && \
mv {{ K8S_TLS_SECRETS_BACKUP }}-new {{ K8S_TLS_SECRETS_BACKUP }}
failed_when: False #Ignore errors
# - name: export TLS certs
# shell: |
# {{ KUBECTL_BIN }} get -o yaml \
# --all-namespaces \
# issuer,clusterissuer,certificates,certificaterequests >> cert-manager-backup.yaml
# failed_when: False #Ignore errors
- hosts: nodes
tasks:
- name: export TLS certs secrets
shell: |
{{ KUBECTL_BIN }} get -o yaml \
--all-namespaces \
secrets --field-selector type==kubernetes.io/tls > {{ K8S_TLS_SECRETS_BACKUP }}-new && \
mv {{ K8S_TLS_SECRETS_BACKUP }}-new {{ K8S_TLS_SECRETS_BACKUP }}
failed_when: False #Ignore errors
# - name: export TLS certs
# shell: |
# {{ KUBECTL_BIN }} get -o yaml \
# --all-namespaces \
# issuer,clusterissuer,certificates,certificaterequests >> cert-manager-backup.yaml
# failed_when: False #Ignore errors
- hosts: nodes
vars:
k3s_state: uninstalled
roles:
- role: xanmanning.k3s