k8s:rancher:run_the_rancher_ui_as_a_container_image
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| k8s:rancher:run_the_rancher_ui_as_a_container_image [2023/08/17 21:58] – external edit (Unknown date) 127.0.0.1 | k8s:rancher:run_the_rancher_ui_as_a_container_image [2023/11/15 22:01] (current) – admin | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| # Run the Rancher UI as a container image | # Run the Rancher UI as a container image | ||
| - | We use CentOS 8 as base distribution for running Rancher UI. | + | We use CentOS 8/9 as base distribution for running Rancher UI. |
| Traditionally Rancher UI came in form of (docker) container images which conained the kubernetes cluster Rancher UI runs on. | Traditionally Rancher UI came in form of (docker) container images which conained the kubernetes cluster Rancher UI runs on. | ||
| This is now phased out in favor of a solution that launches a small kubernetes distribution directly instead of packaging it in a container. | This is now phased out in favor of a solution that launches a small kubernetes distribution directly instead of packaging it in a container. | ||
| + | |||
| + | ## First install prerequisites | ||
| + | |||
| + | ```bash | ||
| + | sudo modprobe ip_tables && echo ' | ||
| + | sudo firewall-cmd --zone=public --permanent --add-service=http | ||
| + | sudo firewall-cmd --zone=public --permanent --add-service=https | ||
| + | sudo firewall-cmd --zone=public --add-service=http | ||
| + | sudo firewall-cmd --zone=public --add-service=https | ||
| + | ``` | ||
| + | |||
| + | ## Getting a certificate using certbot | ||
| + | |||
| + | We use `certbot` because this mimics the professional setup better which does not use letsencrypt but the acme api | ||
| + | |||
| + | ```bash | ||
| + | sudo certbot certonly --standalone --preferred-challenges http -d rancher.machine-deck.jeffries-tube.at | ||
| + | sudo nano / | ||
| + | # Add | ||
| + | # | ||
| + | #[...] | ||
| + | #pre_hook = systemctl stop rancher | ||
| + | #post_hook = systemctl restart rancher | ||
| + | ``` | ||
| ## Setting up Rancher UI using podman | ## Setting up Rancher UI using podman | ||
| + | |||
| + | _Note_: podman as root can not handle IPv6. A reverse proxy can handle IPv6 and then forward to IPv4. | ||
| ```bash | ```bash | ||
| - | sudo podman create --network podman1 | + | sudo podman create --name rancher-2-a-b \ |
| - | -e HTTP_PROXY=" | + | -v / |
| - | -e HTTPS_PROXY=" | + | -v / |
| - | -e NO_PROXY=" | + | -e HTTP_PROXY=" |
| - | -e no_proxy=" | + | -e HTTPS_PROXY=" |
| - | --privileged \ | + | -e NO_PROXY=" |
| - | --name rancher-x-y-z rancher/ | + | -e no_proxy=" |
| + | | ||
| + | -p 80:80 -p 443: | ||
| + | rancher/ | ||
| ``` | ``` | ||
| Line 25: | Line 54: | ||
| [Unit] | [Unit] | ||
| Description=Rancher Management Server | Description=Rancher Management Server | ||
| - | After=heketi.service | ||
| - | Wants=heketi.service | ||
| - | |||
| [Service] | [Service] | ||
| Line 48: | Line 74: | ||
| _Note:_ `sudo podman stop rancher` will result in an immediate restart. Use `sudo systemctl stop rancher` instead | _Note:_ `sudo podman stop rancher` will result in an immediate restart. Use `sudo systemctl stop rancher` instead | ||
| + | Check the certbot timer | ||
| + | ```bash | ||
| + | # watch | ||
| + | journalctl -f | ||
| + | # in another terminal | ||
| + | sudo certbot renew --standalone --dry-run | ||
| + | # This should stop and restart rancher | ||
| + | sudo systemctl enable --now certbot-renew.timer | ||
| + | ``` | ||
| ## Upgrading to a new Rancher version | ## Upgrading to a new Rancher version | ||
| Line 90: | Line 125: | ||
| ```bash | ```bash | ||
| sudo podman create --name rancher-2-a-b \ | sudo podman create --name rancher-2-a-b \ | ||
| - | | + | -v / |
| - | -e HTTPS_PROXY=" | + | -v / |
| - | -e NO_PROXY=" | + | -e HTTP_PROXY=" |
| - | -e no_proxy=" | + | -e HTTPS_PROXY=" |
| - | --privileged \ | + | -e NO_PROXY=" |
| - | -p 80:80 -p 443:443 --log-driver journald rancher/ | + | -e no_proxy=" |
| + | | ||
| + | -p 80:80 -p 443:443 --log-driver journald | ||
| + | rancher/ | ||
| ``` | ``` | ||
| Now restore the backup of the entire configuration into the new container | Now restore the backup of the entire configuration into the new container | ||
k8s/rancher/run_the_rancher_ui_as_a_container_image.1692302322.txt.gz · Last modified: by 127.0.0.1