Skip to content

Commit

Permalink
📓 Add suc examples
Browse files Browse the repository at this point in the history
  • Loading branch information
mudler committed Feb 24, 2022
1 parent 67d6f3f commit 4fab1c2
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
49 changes: 49 additions & 0 deletions examples/network_token_rotation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
apiVersion: v1
kind: Secret
metadata:
name: rotate-token
namespace: system-upgrade
type: Opaque
stringData:
network_token: ""
rotate.sh: |
#!/bin/bash
secrets="/rotate-token"
set -x -e
HOST_DIR="${HOST_DIR:-/host}"
c3os get-network-token $HOST_DIR/oem > current_token
if [ "$FORCE" != "true" ]; then
if diff current_token $secrets/network_token >/dev/null; then
echo Network token up to date
exit 0
fi
fi
NETWORK_TOKEN=$(cat $secrets/network_token) c3os rotate /host/oem
nsenter -i -m -t 1 -- reboot
exit 1
---
apiVersion: upgrade.cattle.io/v1
kind: Plan
metadata:
name: network-token-rotation
namespace: system-upgrade
spec:
concurrency: 1
nodeSelector:
matchExpressions:
- {key: kubernetes.io/hostname, operator: Exists}
serviceAccountName: system-upgrade
secrets:
- name: rotate-token
path: /rotate-token
version: latest
drain:
force: false
upgrade:
image: quay.io/c3os/c3os
command: ["sh"]
args: [ "/rotate-token/rotate.sh"]
24 changes: 24 additions & 0 deletions examples/system-upgrade.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
apiVersion: upgrade.cattle.io/v1
kind: Plan
metadata:
name: os-upgrade
namespace: system-upgrade
labels:
k3s-upgrade: server
spec:
concurrency: 1
#version: latest
version: "opensuse-v1.21.4-31"
nodeSelector:
matchExpressions:
- {key: kubernetes.io/hostname, operator: Exists}
serviceAccountName: system-upgrade
cordon: true
drain:
force: true
disableEviction: true
upgrade:
image: quay.io/c3os/c3os
command:
- "/usr/sbin/suc-upgrade"

0 comments on commit 4fab1c2

Please sign in to comment.