Skip to content

Commit

Permalink
Add RET Upgrader script and README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sofusalbertsen committed Mar 25, 2024
1 parent 7e06791 commit 30ce1c6
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 1 deletion.
75 changes: 75 additions & 0 deletions upgrade_edge/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Resilient Edge Toolstack "RET" Upgrader

## Usage

There are four environment variables to set in order for this to work:

- `UPGRADE_TALOS` - Set to "true" if you want to upgrade Talos
- `TALOS_VERSION` - The version of Talos you want to upgrade to
- `UPGRADE_KUBERNETES` - Set to "true" if you want to upgrade Kubernetes
- `KUBERNETES_VERSION` - The version of Kubernetes you want to upgrade to

> :bulb: The versions of Talos and Kubernetes must be compatible with each other. Check the [Talos release notes](https://github.com/siderolabs/talos/releases)
> :bulb: The version that will be upgraded to cannot be guarenteed to be the version that will be installed. The latest version that is available from the tool will be installed.

Example:

``` yaml
- name: UPGRADE_TALOS #Select if you want to upgrade Talos
value: "true"
- name: TALOS_VERSION #Select the version of Talos you want to upgrade to
value: "v1.4.8"
- name: UPGRADE_KUBERNETES #Select if you want to upgrade Kubernetes
value: "true"
- name: KUBERNETES_VERSION #Select the version of Kubernetes you want to upgrade to
value: "v1.27.4"
```
## Usage
``` YAML
apiVersion: batch/v1
kind: Job
metadata:
name: upgrade-edge
namespace: management
spec:
backoffLimit: 0
template:
spec:
containers:
- name: upgrade-edge-container
image: ghcr.io/eficode-academy/edgek8s-upgrade:latest
env:
# - name: UPGRADE_TALOS
# value: "true"
- name: TALOS_VERSION
value: "v1.4.8"
- name: UPGRADE_KUBERNETES
value: "true"
- name: KUBERNETES_VERSION
value: "v1.27.4"
volumeMounts:
- mountPath: /var/run/secrets/talos.dev
name: talos-secrets
- mountPath: /opt/kubeconfig
name: kubeconfig-volume
- mountPath: /opt/talosconfig
name: talosconfig-volume
volumes:
- name: talos-secrets
secret:
secretName: management-deployment-talos-secrets
- name: kubeconfig-volume
secret:
defaultMode: 420
secretName: kubeconfig-secret
- name: talosconfig-volume
secret:
defaultMode: 420
secretName: talosconfig-secret
restartPolicy: Never
```
2 changes: 1 addition & 1 deletion upgrade_edge/upgrade_edge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fi
check_talos_version_existence() {
local version_url="https://github.com/siderolabs/talos/releases/tag/${TALOS_VERSION}"
if ! curl --output /dev/null --silent --head --fail "$version_url"; then
echo "Invalid Talos version: ${TALOS_VERSION}."
echo "Invalid Talos version specified in env variable: ${TALOS_VERSION}."
exit 1
fi
}
Expand Down

0 comments on commit 30ce1c6

Please sign in to comment.