Skip to content

Commit

Permalink
feat: allow configuring Sidero deployment strategy
Browse files Browse the repository at this point in the history
Upgrading Sidero on a single-node cluster with host networking enabled fails because the used ports can only be bound once. By setting the deployment strategy to `Recreate` in these cases upgrades can succeed (but with a small amount of downtime).

Signed-off-by: Gerard de Leeuw <gdeleeuw@leeuwit.nl>
Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
  • Loading branch information
lion7 authored and Unix4ever committed May 18, 2022
1 parent 41880ed commit 294fd62
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/sidero-controller-manager/config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ spec:
matchLabels:
control-plane: sidero-controller-manager
replicas: 1
strategy:
type: ${SIDERO_CONTROLLER_MANAGER_DEPLOYMENT_STRATEGY:=RollingUpdate}
template:
metadata:
labels:
Expand Down
1 change: 1 addition & 0 deletions sfyra/pkg/capi/capi.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ func (clusterAPI *Manager) Install(ctx context.Context) error {

// set template environment variables
os.Setenv("SIDERO_CONTROLLER_MANAGER_HOST_NETWORK", "true")
os.Setenv("SIDERO_CONTROLLER_MANAGER_DEPLOYMENT_STRATEGY", "Recreate")
os.Setenv("SIDERO_CONTROLLER_MANAGER_API_ENDPOINT", clusterAPI.cluster.SideroComponentsIP().String())
os.Setenv("SIDERO_CONTROLLER_MANAGER_SERVER_REBOOT_TIMEOUT", "30s") // wiping/reboot is fast in the test environment
os.Setenv("SIDERO_CONTROLLER_MANAGER_TEST_POWER_EXPLICIT_FAILURE", fmt.Sprintf("%f", clusterAPI.options.PowerSimulatedExplicitFailureProb))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ options.

```bash
export SIDERO_CONTROLLER_MANAGER_HOST_NETWORK=true
export SIDERO_CONTROLLER_MANAGER_DEPLOYMENT_STRATEGY=Recreate
export SIDERO_CONTROLLER_MANAGER_API_ENDPOINT=192.168.1.150
export SIDERO_CONTROLLER_MANAGER_SIDEROLINK_ENDPOINT=192.168.1.150

Expand Down
1 change: 1 addition & 0 deletions website/content/docs/v0.5/Guides/bootstrapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ To install Sidero and the other Talos providers, simply issue:
```bash
SIDERO_CONTROLLER_MANAGER_HOST_NETWORK=true \
SIDERO_CONTROLLER_MANAGER_DEPLOYMENT_STRATEGY=Recreate \
SIDERO_CONTROLLER_MANAGER_API_ENDPOINT=$PUBLIC_IP \
clusterctl init -b talos -c talos -i sidero
```
Expand Down
2 changes: 1 addition & 1 deletion website/content/docs/v0.5/Guides/sidero-on-rpi4.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ kubectl get nodes
Install Sidero with host network mode, exposing the endpoints on the node's address:

```bash
SIDERO_CONTROLLER_MANAGER_HOST_NETWORK=true SIDERO_CONTROLLER_MANAGER_API_ENDPOINT=${SIDERO_IP} clusterctl init -i sidero -b talos -c talos
SIDERO_CONTROLLER_MANAGER_HOST_NETWORK=true SIDERO_CONTROLLER_MANAGER_DEPLOYMENT_STRATEGY=Recreate SIDERO_CONTROLLER_MANAGER_API_ENDPOINT=${SIDERO_IP} clusterctl init -i sidero -b talos -c talos
```

Watch the progress of installation with:
Expand Down
1 change: 1 addition & 0 deletions website/content/docs/v0.5/Overview/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Sidero supports several variables to configure the installation, these variables
variables or as variables in the `clusterctl` configuration:

- `SIDERO_CONTROLLER_MANAGER_HOST_NETWORK` (`false`): run `sidero-controller-manager` on host network
- `SIDERO_CONTROLLER_MANAGER_DEPLOYMENT_STRATEGY` (`RollingUpdate`): strategy to use when updating `sidero-controller-manager`, use `Recreate` when using a single node and `SIDERO_CONTROLLER_MANAGER_HOST_NETWORK` is `true`
- `SIDERO_CONTROLLER_MANAGER_API_ENDPOINT` (empty): specifies the IP address controller manager API service can be reached on, defaults to the node IP (TCP)
- `SIDERO_CONTROLLER_MANAGER_API_PORT` (8081): specifies the port controller manager can be reached on
- `SIDERO_CONTROLLER_MANAGER_CONTAINER_API_PORT` (8081): specifies the controller manager internal container port
Expand Down

0 comments on commit 294fd62

Please sign in to comment.