Skip to content
This repository has been archived by the owner on Dec 8, 2023. It is now read-only.

cli: upgrade sub-command #348

Merged
merged 1 commit into from
Jan 16, 2020
Merged

cli: upgrade sub-command #348

merged 1 commit into from
Jan 16, 2020

Conversation

dweomer
Copy link
Contributor

@dweomer dweomer commented Jan 13, 2020

Introducting k3os upgrade and hiding k3os install when k3os.mode == local:

$ k3os upgrade --help
NAME:
   k3os upgrade - perform upgrades

USAGE:
   k3os upgrade [command options] [arguments...]

OPTIONS:
   --kernel             upgrade the kernel [$K3OS_UPGRADE_KERNEL]
   --rootfs             upgrade k3os+k3s [$K3OS_UPGRADE_ROOTFS]
   --remount            pre-upgrade remount? [$K3OS_UPGRADE_REMOUNT]
   --sync               post-upgrade sync? [$K3OS_UPGRADE_SYNC]
   --reboot             post-upgrade reboot? [$K3OS_UPGRADE_REBOOT]
   --source value       (default: "/k3os/system") [$K3OS_UPGRADE_SOURCE]
   --destination value  (default: "/k3os/system") [$K3OS_UPGRADE_DESTINATION]

This enables the future system-upgrade-controller integration, or similar, that run from within the rancher/k3os container and mount the host's root to /host and then pass /host/k3os/system as destination.
Invoking k3os upgrade from within a container and passing --reboot, assuming the destination is mutated, requires host IPC and PID namespaces along with it being privileged so that it may chroot to /host and then invoke nsenter into PID 1 to invoke reboot.

Introducting `k3os upgrade` and hiding `k3os install` when `k3os.mode` == `local`:

```
$ k3os upgrade --help
NAME:
   k3os upgrade - perform upgrades

USAGE:
   k3os upgrade [command options] [arguments...]

OPTIONS:
   --kernel             upgrade the kernel [$K3OS_UPGRADE_KERNEL]
   --rootfs             upgrade k3os+k3s [$K3OS_UPGRADE_ROOTFS]
   --remount            pre-upgrade remount? [$K3OS_UPGRADE_REMOUNT]
   --sync               post-upgrade sync? [$K3OS_UPGRADE_SYNC]
   --reboot             post-upgrade reboot? [$K3OS_UPGRADE_REBOOT]
   --source value       (default: "/k3os/system") [$K3OS_UPGRADE_SOURCE]
   --destination value  (default: "/k3os/system") [$K3OS_UPGRADE_DESTINATION]
```

This enables the future system-upgrade-controller integration, or similar, that run from within the `rancher/k3os` container and mount the host's root to /host and then pass `/host/k3os/system` as destination.
Invoking `k3os upgrade` from within a container and passing `--reboot`, assuming the destination is mutated, requires host IPC and PID namespaces along with it being privileged so that it may `chroot` to `/host` and then invoke `nsenter` into PID 1 to invoke `reboot`.
@dweomer dweomer merged commit f3afdf2 into rancher:master Jan 16, 2020
@dweomer dweomer deleted the cli/upgrade branch January 16, 2020 18:53
@dweomer dweomer added this to the v0.9.0 milestone Jan 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant