These tools are work in progress
uyuniadm
used to help user administer uyuni servers on k8s and podmanuyunictl
used to help user managing Uyuni and SUSE Manager Servers mainly through its API
go build -o ./bin ./...
will produce the binaries in the root folder.
Alternatively, if you have podman
installed you can run the build.sh
script to build binaries compatible with SLE 15 SP4 or openSUSE Leap 15.4.
Available Commands:
- help: Help about any command
- install: install a new server from scratch
- migrate: migrate a remote server to containers
- uninstall: uninstall a server
For more information about flags uyuniadm --help
Install a new server from scratch
The install command assumes the following:
- podman or kubectl is installed locally
- if kubectl is installed, a working kubeconfig should be set to connect to the cluster to deploy to
When installing on kubernetes, the helm values file will be overridden with the values from the uyuniadm parameters or configuration.
NOTE: for now installing on a remote cluster or podman is not supported!
Usage:
uyuniadm install [fqdn] [flags]
For more information about flags uyuniadm install --help
Migrate a remote server to containers
This migration command assumes a few things:
- the SSH configuration for the source server is complete, including user and all needed options to connect to the machine,
- an SSH agent is started and the key to use to connect to the server is added to it,
- podman or kubectl is installed locally
- if kubectl is installed, a working kubeconfig should be set to connect to the cluster to deploy to
NOTE: for now installing on a remote cluster or podman is not supported yet!
Usage:
uyuniadm migrate [source server FQDN] [flags]
For more information about flags uyuniadm migrate --help
-
In the destination server, add to
~/.ssh/config
:Host SOURCE_HOSTNAME Hostname SOURCE_HOSTNAME StrictHostKeyChecking no Port 22 User SOURCE_USER
-
If you already have a key, run:
ssh-copy-id YOUR_HOST
If not, run
ssh-keygen
to generate it. -
If the
SOURCE_USER
user is not root, it should be able to runrsync
. It can be done by adding to/etc/sudoers
:add to sudoers file SOURCE_USER ALL=(ALL) NOPASSWD:/usr/bin/rsync
-
To provide a ssh agent with key, in the destination server:
eval `ssh-agent` ssh-add $KEY_PATH
Uninstall a server
Usage:
uyuniadm uninstall [flags]
For more information about flags uyuniadm uninstall --help
Available Commands:
- cp: copy files to and from the containers
- exec: execute commands inside the uyuni containers using 'sh -c'
- help: Help about any command
Using uyunictl
to access a remote cluster requires kubectl
to be configured to connect to it before hand.
In order to connect to a remote podman
, ensure the podman.socket
systemd unit is active on the server by running systemctl enable --now podman.socket
.
Then configure the Podman connection on the client machine:
podman system connection add <name> ssh://root@<host.fqdn>
Then export CONTAINER_CONNECTION=<name>
before running uyunictl
.
Note that passing --identity <file>
may be needed to tell SSH which key to use to connect to the podman host.
Takes a source and destination parameters. One of them can be prefixed with 'server:' to indicate the path is within the server pod.
Usage:
uyunictl cp [path/to/source.file] [path/to/destination.file] [flags]
For more information about flags uyunictl cp --help
Execute commands inside the uyuni containers using 'sh -c'
Usage:
uyunictl exec '[command-to-run --with-args]' [flags]
For more information about flags uyunictl exec --help
All the commands can accept flags or yaml configuration file (using the option -c
). This is an example of configuration file:
db:
password: YOUR_DB_PASSWORD
cert:
password: YOUR_DB_PASSWORD
scc:
user: YOUR_SCC_USER
password: YOUR_SCC_PASSWORD
email: YOUR_MAIL
emailFrom: YOUR_MAIL
image: YOUR_IMAGE_REGISTRY
helm:
uyuni:
chart: oci://OCI_REGISTRY
values: /root/chart-values.yaml
podman:
arg:
- -p
- 8000:8000
- -p
- 8001:8001
- ""
Requirements for the Host OS:
- Use Leap 15.5
- Have podman installed
- Have a valid FQDN for the machine
Create a file "/root/uyuniadm.yaml" with the following content:
db:
password: spacewalk
cert:
password: spacewalk
image: registry.opensuse.org/systemsmanagement/uyuni/master/servercontainer/containers/uyuni/server
Then run uyuniadm install --config /root/uyuniadm.yaml MACHINE-FQDN