feat: k0s add reset hooks for cleaning up cilium (#1183)
Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
1 parent
d46e7f9663
commit
7c43fb1db0
2 files changed
+25
-12
No files matched your search
@@ -24,9 +24,6 @@ tasks:
|
|||||||
deps: [":ansible:deps"]
|
deps: [":ansible:deps"]
|
||||||
cmds:
|
cmds:
|
||||||
- k0sctl reset --config {{.K0S_CONFIG_FILE}}
|
- k0sctl reset --config {{.K0S_CONFIG_FILE}}
|
||||||
- task: :ansible:run
|
|
||||||
vars:
|
|
||||||
playbook: cluster-nuke
|
|
||||||
preconditions:
|
preconditions:
|
||||||
- { msg: "Missing K0s config file", sh: "test -f {{.K0S_CONFIG_FILE}}" }
|
- { msg: "Missing K0s config file", sh: "test -f {{.K0S_CONFIG_FILE}}" }
|
||||||
|
|
||||||
|
|||||||
@@ -22,13 +22,35 @@ spec:
|
|||||||
perm: 0644
|
perm: 0644
|
||||||
user: root
|
user: root
|
||||||
group: root
|
group: root
|
||||||
hooks:
|
#% if loop.first %#
|
||||||
|
hooks: &hooks
|
||||||
apply:
|
apply:
|
||||||
before:
|
before:
|
||||||
|
- sudo mv ~/unprivileged-ports.toml /etc/k0s/containerd.d/unprivileged-ports.toml
|
||||||
#% if spegel.enabled | default(false) %#
|
#% if spegel.enabled | default(false) %#
|
||||||
- sudo mv ~/spegel.toml /etc/k0s/containerd.d/spegel.toml
|
- sudo mv ~/spegel.toml /etc/k0s/containerd.d/spegel.toml
|
||||||
#% endif %#
|
#% endif %#
|
||||||
- sudo mv ~/unprivileged-ports.toml /etc/k0s/containerd.d/unprivileged-ports.toml
|
reset:
|
||||||
|
before:
|
||||||
|
- sudo ip link delete cilium_host > /dev/null 2>&1 || true
|
||||||
|
- sudo ip link delete cilium_net > /dev/null 2>&1 || true
|
||||||
|
- sudo ip link delete cilium_vxlan > /dev/null 2>&1 || true
|
||||||
|
- sudo iptables -t nat -F
|
||||||
|
- sudo iptables -t mangle -F
|
||||||
|
- sudo iptables -t filter -F
|
||||||
|
- sudo iptables -t raw -F
|
||||||
|
- sudo iptables -X
|
||||||
|
- sudo ip6tables -t nat -F
|
||||||
|
- sudo ip6tables -t mangle -F
|
||||||
|
- sudo ip6tables -t filter -F
|
||||||
|
- sudo ip6tables -t raw -F
|
||||||
|
- sudo ip6tables -X
|
||||||
|
- sudo rm -rf /etc/cni/net.d
|
||||||
|
after:
|
||||||
|
- sudo shutdown -r now
|
||||||
|
#% else %#
|
||||||
|
hooks: *hooks
|
||||||
|
#% endif %#
|
||||||
#% endfor %#
|
#% endfor %#
|
||||||
#% if bootstrap_nodes.worker | default([]) | length > 0 %#
|
#% if bootstrap_nodes.worker | default([]) | length > 0 %#
|
||||||
#% for item in bootstrap_nodes.worker %#
|
#% for item in bootstrap_nodes.worker %#
|
||||||
@@ -42,13 +64,7 @@ spec:
|
|||||||
perm: 0644
|
perm: 0644
|
||||||
user: root
|
user: root
|
||||||
group: root
|
group: root
|
||||||
hooks:
|
hooks: *hooks
|
||||||
apply:
|
|
||||||
before:
|
|
||||||
#% if spegel.enabled | default(false) %#
|
|
||||||
- sudo mv ~/spegel.toml /etc/k0s/containerd.d/spegel.toml
|
|
||||||
#% endif %#
|
|
||||||
- sudo mv ~/unprivileged-ports.toml /etc/k0s/containerd.d/unprivileged-ports.toml
|
|
||||||
#% endfor %#
|
#% endfor %#
|
||||||
#% endif %#
|
#% endif %#
|
||||||
k0s:
|
k0s:
|
||||||
|
|||||||
Reference in new issue
Block a user