### Example Installed Packages Output Source: https://cozystack.io/docs/v1.4/install/cozystack/kubernetes-distribution This is an example of the output you might see when listing installed Cozystack packages. ```text NAME VARIANT READY STATUS cozystack.cozystack-platform default True ... cozystack.networking noop True ... cozystack.cert-manager default True ... ``` -------------------------------- ### Install boot-to-talos using Installer Script Source: https://cozystack.io/docs/v1.4/install/talos/boot-to-talos Use this command to install the boot-to-talos CLI application via a script. This is a quick way to get the tool set up. ```bash curl -sSL https://github.com/cozystack/boot-to-talos/raw/refs/heads/main/hack/install.sh | sh -s ``` -------------------------------- ### Start Talos Installer Source: https://cozystack.io/docs/v1.4/install/providers/hetzner Initiates the Talos Linux installation process on the server. Follow the prompts to configure network settings and select the Talos image. ```bash boot-to-talos ``` -------------------------------- ### Start Matchbox Server Source: https://cozystack.io/docs/v1.4/install/talos/pxe Initiates the Matchbox server with a prebuilt Talos image for Cozystack. Ensure Docker is installed and running. ```bash sudo docker run --name=matchbox -d --net=host ghcr.io/cozystack/cozystack/matchbox:v0.30.0 \ -address=:8080 \ -log-level=debug ``` -------------------------------- ### Example Output of kubectl get ns Source: https://cozystack.io/docs/v1.4/install/providers/hetzner Example output showing the default namespaces in a healthy Kubernetes cluster. ```bash NAME STATUS AGE default Active 7m56s kube-node-lease Active 7m56s kube-public Active 7m56s kube-system Active 7m56s ``` -------------------------------- ### Interactive Talos Installation with boot-to-talos Source: https://cozystack.io/docs/v1.4/install/talos/boot-to-talos This snippet shows an example of running the `boot-to-talos` command in install mode and the interactive prompts you will encounter. It includes configuration for the Talos installer image, networking, and serial console. ```bash Mode: 1. boot – extract the kernel and initrd from the Talos installer and boot them directly using the kexec mechanism. 2. install – prepare the environment, run the Talos installer, and then overwrite the system disk with the installed image. Mode [1]: 2 Target disk [/dev/sda]: Talos installer image [ghcr.io/cozystack/cozystack/talos:v1.11.6]: ghcr.io/cozystack/cozystack/talos:v1.13.0 Add networking configuration? [yes]: Interface [eth0]: IP address [10.0.2.15]: Netmask [255.255.255.0]: Gateway (or 'none') [10.0.2.2]: Configure serial console? (or 'no') [ttyS0]: Summary: Image: ghcr.io/cozystack/cozystack/talos:v1.13.0 Disk: /dev/sda Extra kernel args: ip=10.0.2.15::10.0.2.2:255.255.255.0::eth0::::: console=ttyS0 WARNING: ALL DATA ON /dev/sda WILL BE ERASED! Continue? [yes]: 2025/08/03 00:11:03 created temporary directory /tmp/installer-3221603450 2025/08/03 00:11:03 pulling image ghcr.io/cozystack/cozystack/talos:v1.13.0 2025/08/03 00:11:03 extracting image layers 2025/08/03 00:11:07 creating raw disk /tmp/installer-3221603450/image.raw (2 GiB) 2025/08/03 00:11:07 attached /tmp/installer-3221603450/image.raw to /dev/loop0 2025/08/03 00:11:07 starting Talos installer 2025/08/03 00:11:07 running Talos installer v1.13.0 2025/08/03 00:11:07 WARNING: config validation: 2025/08/03 00:11:07 use "worker" instead of "" for machine type 2025/08/03 00:11:07 created EFI (C12A7328-F81F-11D2-BA4B-00A0C93EC93B) size 104857600 bytes 2025/08/03 00:11:07 created BIOS (21686148-6449-6E6F-744E-656564454649) size 1048576 bytes 2025/08/03 00:11:07 created BOOT (0FC63DAF-8483-4772-8E79-3D69D8477DE4) size 1048576000 bytes 2025/08/03 00:11:07 created META (0FC63DAF-8483-4772-8E79-3D69D8477DE4) size 1048576 bytes 2025/08/03 00:11:07 formatting the partition "/dev/loop0p1" as "vfat" with label "EFI" 2025/08/03 00:11:07 formatting the partition "/dev/loop0p2" as "zeroes" with label "BIOS" 2025/08/03 00:11:07 formatting the partition "/dev/loop0p3" as "xfs" with label "BOOT" 2025/08/03 00:11:07 formatting the partition "/dev/loop0p4" as "zeroes" with label "META" 2025/08/03 00:11:07 copying from io reader to /boot/A/vmlinuz 2025/08/03 00:11:07 copying from io reader to /boot/A/initramfs.xz 2025/08/03 00:11:08 writing /boot/grub/grub.cfg to disk 2025/08/03 00:11:08 executing: grub-install --boot-directory=/boot --removable --efi-directory=/boot/EFI /dev/loop0 2025/08/03 00:11:08 installation of v1.13.0 complete 2025/08/03 00:11:08 Talos installer finished successfully 2025/08/03 00:11:08 remounting all filesystems read-only 2025/08/03 00:11:08 copy /tmp/installer-3221603450/image.raw → /dev/sda 2025/08/03 00:11:19 installation image copied to /dev/sda 2025/08/03 00:11:19 rebooting system ``` -------------------------------- ### Install boot-to-talos CLI Source: https://cozystack.io/docs/v1.4/getting-started/install-talos Installs the `boot-to-talos` CLI application using a provided script. This is the first step before running the Talos installer. ```bash curl -sSL https://github.com/cozystack/boot-to-talos/raw/refs/heads/main/hack/install.sh | sh -s ``` -------------------------------- ### Install Packages with cozypkg add Source: https://cozystack.io/docs/v1.4/guides/concepts Installs one or more packages, handling dependency resolution and variant selection. Can install from a file. ```bash cozypkg add cozystack.keycloak cozystack.monitoring ``` ```bash cozypkg add --file packages.yaml ``` -------------------------------- ### Makefile Example Source: https://cozystack.io/docs/v1.4/applications/external Example Makefile for an application chart, setting environment variables and including common scripts. ```makefile export NAME= export NAMESPACE=external- include ../../../scripts/package.mk ``` -------------------------------- ### Check boot-to-talos Installation Source: https://cozystack.io/docs/v1.4/install/providers/hetzner Confirms that the boot-to-talos binary is installed and accessible in the system's PATH. ```bash boot-to-talos -h ``` -------------------------------- ### Install boot-to-talos Utility Source: https://cozystack.io/docs/v1.4/install/providers/servers-com Download and install the `boot-to-talos` utility using a curl command. This script prepares the server to boot into Talos Linux. ```bash curl -sSL https://github.com/cozystack/boot-to-talos/raw/refs/heads/main/hack/install.sh | sudo sh -s ``` -------------------------------- ### Run Talos Installer (Non-Interactive) Source: https://cozystack.io/docs/v1.4/install/providers/servers-com Use the `-yes` flag to run the `boot-to-talos` installer in non-interactive mode for automated installations. This bypasses prompts and uses default settings. ```bash sudo boot-to-talos -yes ``` -------------------------------- ### Apply Cozystack Installer Source: https://cozystack.io/docs/getting-started/install-cozystack Apply the Cozystack installer configuration from the latest stable release on GitHub to begin the installation process. ```bash kubectl apply -f https://github.com/cozystack/cozystack/releases/latest/download/cozystack-installer.yaml ``` -------------------------------- ### Install a Package Source: https://cozystack.io/docs/v1.4/install/cozystack/kubernetes-distribution Use 'cozypkg add ' to install any available package. The tool will resolve dependencies and prompt for variant selection. ```bash cozypkg add ``` -------------------------------- ### Install kubelogin via Krew Source: https://cozystack.io/docs/v1.4/operations/oidc/enable_oidc Install the `kubelogin` CLI tool using Krew, the Kubernetes plugin manager, for cross-platform compatibility. ```bash # Krew (macOS, Linux, Windows and ARM) kubectl krew install oidc-login ``` -------------------------------- ### Install kubelogin via Homebrew Source: https://cozystack.io/docs/v1.4/operations/oidc/enable_oidc Install the `kubelogin` CLI tool using Homebrew for macOS and Linux systems. ```bash # Homebrew (macOS and Linux) brew install int128/kubelogin/kubelogin ``` -------------------------------- ### Install cozypkg CLI Source: https://cozystack.io/docs/v1.4/install/cozystack/kubernetes-distribution Install the cozypkg CLI tool using Homebrew. Pre-built binaries are available on GitHub releases for other platforms. ```bash brew tap cozystack/tap brew install cozypkg ``` -------------------------------- ### Talm Apply Command Output Example Source: https://cozystack.io/docs/v1.4/install/kubernetes/talm Example output from the 'talm apply' command indicating successful configuration application to a node. ```bash $ talm apply -f nodes/node1.yaml -i - talm: file=nodes/node1.yaml, nodes=[192.168.123.11], endpoints=[192.168.123.11] ``` -------------------------------- ### Database Configuration Example Source: https://cozystack.io/docs/v1.4/applications/postgres Sets up databases, their roles, and extensions. Supports multiple roles per database and custom extensions like hstore. ```yaml databases: myapp: roles: admin: - user1 - debezium readonly: - user2 airflow: roles: admin: - airflow extensions: - hstore ``` -------------------------------- ### Run Talos Installer (Interactive) Source: https://cozystack.io/docs/v1.4/install/providers/servers-com Execute the `boot-to-talos` installer interactively. You will be prompted to select the boot mode, confirm the Talos image, and provide network settings for the public interface. ```bash sudo boot-to-talos ``` -------------------------------- ### Get PackageSource Source: https://cozystack.io/docs/v1.4/install/cozystack/kubernetes-distribution After installing the operator, check the available PackageSource resources. ```bash kubectl get packagesource ``` -------------------------------- ### Verify lldpd Installation on Nodes Source: https://cozystack.io/docs/v1.4/install/kubernetes/troubleshooting Scan the network for nodes with port 50000 open and then check if lldpd is installed on those nodes using talosctl get extensions. ```bash node_net='192.168.100.0/24' nmap -Pn -n -T4 -p50000 --open -oG - $node_net | awk '/50000\/open/ { system("talosctl get extensions -n "$2" -e "$2" | grep lldpd") }' ``` -------------------------------- ### Node Initialization Output Source: https://cozystack.io/docs/v1.4/install/providers/hetzner Example output after successfully applying node configuration, showing the node's IP address. ```bash $ talm apply -f nodes/node1.yaml -i - talm: file=nodes/node1.yaml, nodes=[12.34.56.101], endpoints=[12.34.56.101] ``` -------------------------------- ### Cluster Infrastructure Telemetry Payload Source: https://cozystack.io/docs/v1.4/operations/configuration/telemetry Example of telemetry data collected by the cozystack-operator, focusing on cluster infrastructure and installed packages. ```prometheus cozy_cluster_info{cozystack_version="v1.0.0",kubernetes_version="v1.31.4"} 1 cozy_nodes_count{os="linux (Talos (v1.8.4))",kernel="6.6.64-talos"} 3 cozy_cluster_capacity{resource="cpu"} 168 cozy_cluster_capacity{resource="memory"} 811020009472 cozy_cluster_capacity{resource="nvidia.com/TU104GL_TESLA_T4"} 3 cozy_loadbalancers_count 1 cozy_pvs_count{driver="linstor.csi.linbit.com",size="5Gi"} 7 cozy_pvs_count{driver="linstor.csi.linbit.com",size="10Gi"} 6 cozy_package_info{name="cozystack.core",variant="default"} 1 cozy_package_info{name="cozystack.storage",variant="linstor"} 1 cozy_package_info{name="cozystack.monitoring",variant="default"} 1 ``` -------------------------------- ### Install Cozystack Go API Module Source: https://cozystack.io/docs/v1.4/cozystack-api/go-types Add the Cozystack API Go module dependency to your project using go get. ```go go get github.com/cozystack/cozystack/api/apps/v1alpha1@v1.4.0 ``` -------------------------------- ### Switch to OIDC User and Verify Source: https://cozystack.io/docs/v1.4/operations/oidc/self-signed-certificates Set the current kubectl context to use the OIDC user and then verify the setup by getting nodes. ```bash kubectl config set-context --current --user=oidc kubectl get nodes ``` -------------------------------- ### Check HelmRelease Status Source: https://cozystack.io/docs/v1.4/operations/troubleshooting/flux-cd Use kubectl to get the status of HelmRelease resources across all namespaces. This helps identify releases that are in an 'install retries exhausted' state. ```bash # kubectl get hr -A -n cozy-dashboard dashboard NAMESPACE NAME AGE READY STATUS cozy-dashboard dashboard 15m False install retries exhausted ``` -------------------------------- ### Initialize Kubernetes Client Scheme Source: https://cozystack.io/docs/v1.4/cozystack-api/go-types Set up the runtime scheme for the Go Kubernetes client. Register your custom types with the scheme before proceeding. ```go import ( "k8s.io/client-go/kubernetes" "k8s.io/apimachinery/pkg/runtime" ) scheme := runtime.NewScheme() // Register your types with the scheme ``` -------------------------------- ### Install the Cozystack Scheduler Source: https://cozystack.io/docs/v1.4/operations/scheduling-classes Installs the Cozystack scheduler system package. Ensure Cozystack v1.2+ is already installed. ```bash cozypkg add cozystack.cozystack-scheduler ``` -------------------------------- ### Prepare Cozystack Configuration File Source: https://cozystack.io/docs/getting-started/install-cozystack Create a ConfigMap named 'cozystack' in the 'cozy-system' namespace with essential settings for Cozystack installation. Ensure you replace placeholder values like 'example.org' with your actual domain name. ```yaml apiVersion: v1 kind: ConfigMap metadata: name: cozystack namespace: cozy-system data: bundle-name: "paas-full" root-host: "example.org" api-server-endpoint: "https://api.example.org:443" expose-services: "dashboard,api" ipv4-pod-cidr: "10.244.0.0/16" ipv4-pod-gateway: "10.244.0.1" ipv4-svc-cidr: "10.96.0.0/16" ipv4-join-cidr: "100.64.0.0/16" ``` -------------------------------- ### Install Ansible Collection Source: https://cozystack.io/docs/v1.4/install/ansible Installs the cozystack.installer Ansible collection from GitHub. Ensure you have Git installed on your controller machine. ```bash ansible-galaxy collection install git+https://github.com/cozystack/ansible-cozystack.git ``` -------------------------------- ### Run boot-to-talos to install Talos Source: https://cozystack.io/docs/v1.4/getting-started/install-talos Executes the `boot-to-talos` installer, prompting for necessary configuration details such as the target disk, Talos image, and network settings. Ensure to specify the correct Cozystack Talos image version. ```bash $ boot-to-talos Target disk [/dev/sda]: Talos installer image [ghcr.io/cozystack/cozystack/talos:v1.11.6]: ghcr.io/cozystack/cozystack/talos:v1.13.0 Add networking configuration? [yes]: Interface [eth0]: IP address [10.0.2.15]: Netmask [255.255.255.0]: Gateway (or 'none') [10.0.2.2]: Configure serial console? (or 'no') [ttyS0]: Summary: Image: ghcr.io/cozystack/cozystack/talos:v1.13.0 Disk: /dev/sda Extra kernel args: ip=10.0.2.15::10.0.2.2:255.255.255.0::eth0::::: console=ttyS0 WARNING: ALL DATA ON /dev/sda WILL BE ERASED! Continue? [yes]: 2025/08/03 00:11:03 created temporary directory /tmp/installer-3221603450 2025/08/03 00:11:03 pulling image ghcr.io/cozystack/cozystack/talos:v1.13.0 2025/08/03 00:11:03 extracting image layers 2025/08/03 00:11:07 creating raw disk /tmp/installer-3221603450/image.raw (2 GiB) 2025/08/03 00:11:07 attached /tmp/installer-3221603450/image.raw to /dev/loop0 2025/08/03 00:11:07 starting Talos installer 2025/08/03 00:11:07 running Talos installer v1.13.0 2025/08/03 00:11:07 WARNING: config validation: 2025/08/03 00:11:07 use "worker" instead of "" for machine type 2025/08/03 00:11:07 created EFI (C12A7328-F81F-11D2-BA4B-00A0C93EC93B) size 104857600 bytes 2025/08/03 00:11:07 created BIOS (21686148-6449-6E6F-744E-656564454649) size 1048576 bytes 2025/08/03 00:11:07 created BOOT (0FC63DAF-8483-4772-8E79-3D69D8477DE4) size 1048576000 bytes 2025/08/03 00:11:07 created META (0FC63DAF-8483-4772-8E79-3D69D8477DE4) size 1048576 bytes 2025/08/03 00:11:07 formatting the partition "/dev/loop0p1" as "vfat" with label "EFI" 2025/08/03 00:11:07 formatting the partition "/dev/loop0p2" as "zeroes" with label "BIOS" 2025/08/03 00:11:07 formatting the partition "/dev/loop0p3" as "xfs" with label "BOOT" 2025/08/03 00:11:07 formatting the partition "/dev/loop0p4" as "zeroes" with label "META" 2025/08/03 00:11:07 copying from io reader to /boot/A/vmlinuz 2025/08/03 00:11:07 copying from io reader to /boot/A/initramfs.xz 2025/08/03 00:11:08 writing /boot/grub/grub.cfg to disk 2025/08/03 00:11:08 executing: grub-install --boot-directory=/boot --removable --efi-directory=/boot/EFI /dev/loop0 2025/08/03 00:11:08 installation of v1.13.0 complete 2025/08/03 00:11:08 Talos installer finished successfully 2025/08/03 00:11:08 remounting all filesystems read-only 2025/08/03 00:11:08 copy /tmp/installer-3221603450/image.raw → /dev/sda 2025/08/03 00:11:19 installation image copied to /dev/sda 2025/08/03 00:11:19 rebooting system ``` -------------------------------- ### List Available Packages Source: https://cozystack.io/docs/v1.4/install/cozystack/kubernetes-distribution After installing the platform package, list all other available PackageSources and their variants. ```bash cozypkg list ``` -------------------------------- ### Resource Quotas Configuration Example Source: https://cozystack.io/docs/v1.4/applications/tenant Shows how to define resource quotas for a tenant, including compute resources like CPU and memory, storage, and object counts such as services and pods. ```yaml resourceQuotas: cpu: 4 memory: 4Gi storage: 10Gi services.loadbalancers: "3" pods: "50" ``` -------------------------------- ### Install Talm Configuration Manager Source: https://cozystack.io/docs/v1.4/getting-started/requirements Use this command to install Talm, Cozystack's configuration manager for Talos Linux. Ensure you have curl installed. ```bash curl -sSL https://github.com/cozystack/talm/raw/refs/heads/main/hack/install.sh | sh -s ``` -------------------------------- ### Create Namespace and Apply Configuration Source: https://cozystack.io/docs/getting-started/install-cozystack Apply the Cozystack configuration by first creating the 'cozy-system' namespace and then applying the 'cozystack.yaml' ConfigMap. ```bash kubectl create ns cozy-system --dry-run=client --output yaml | kubectl apply -f - kubectl apply -f cozystack.yaml ``` -------------------------------- ### Prepare Cozystack Platform Configuration Source: https://cozystack.io/docs/v1.4/getting-started/install-cozystack Create a YAML file named 'cozystack-platform.yaml' with the specified configuration. Ensure you replace placeholder values like 'example.org' with your actual domain or IP address. This configuration defines the Cozystack platform variant and networking settings. ```yaml apiVersion: cozystack.io/v1alpha1 kind: Package metadata: name: cozystack.cozystack-platform spec: variant: isp-full components: platform: values: publishing: host: "example.org" apiServerEndpoint: "https://api.example.org:443" exposedServices: - dashboard - api networking: podCIDR: "10.244.0.0/16" podGateway: "10.244.0.1" serviceCIDR: "10.96.0.0/16" joinCIDR: "100.64.0.0/16" ``` -------------------------------- ### Manually Import MOK Key (Non-Interactive Install) Source: https://cozystack.io/docs/v1.4/install/kubernetes/ubuntu-secure-boot If the `drbd-dkms` installation runs non-interactively, this command must be manually executed after the installation to import the MOK signing key. ```bash sudo mokutil --import /var/lib/shim-signed/mok/MOK.der ``` -------------------------------- ### Download and Install talos-bootstrap Script Source: https://cozystack.io/docs/v1.4/install/kubernetes/talos-bootstrap Download the latest talos-bootstrap script, make it executable, and verify the installation by checking its help output. Ensure you have curl, dialog, and nmap installed. ```bash curl -fsSL -o /usr/local/bin/talos-bootstrap \ https://github.com/cozystack/talos-bootstrap/raw/master/talos-bootstrap chmod +x /usr/local/bin/talos-bootstrap talos-bootstrap --help ``` -------------------------------- ### Create VMInstance for MikroTik Source: https://cozystack.io/docs/v1.4/virtualization/mikrotik Creates a VMInstance named 'mikrotik-demo' using a lightweight 'ubuntu' instance profile and 'u1.medium' instance type. It attaches the previously defined system and ISO disks. ```yaml apiVersion: apps.cozystack.io/v1alpha1 kind: VMInstance metadata: name: mikrotik-demo spec: running: true instanceType: "u1.medium" instanceProfile: ubuntu disks: - name: mikrotik-system bus: sata - name: mikrotik-iso bus: sata ``` -------------------------------- ### Install kubectl-etcd Plugin Source: https://cozystack.io/docs/v1.4/kubernetes/relocate-etcd Installs the kubectl-etcd plugin required for managing etcd replicas. ```go go install github.com/aenix-io/etcd-operator/cmd/kubectl-etcd@latest ``` -------------------------------- ### Install Required Packages Source: https://cozystack.io/docs/v1.4/install/kubernetes/generic Installs necessary packages for Cozystack on Ubuntu or Debian systems. ```bash apt-get update apt-get install -y nfs-common open-iscsi multipath-tools ``` -------------------------------- ### Chart.yaml Example Source: https://cozystack.io/docs/v1.4/applications/external Example of a Chart.yaml file for an application, specifying metadata and versioning strategy. ```yaml apiVersion: v2 name: description: type: application version: 0.0.0 appVersion: "1.0.0" ``` -------------------------------- ### Example Docker ps Output Source: https://cozystack.io/docs/v1.4/install/talos/pxe Sample output from the 'docker ps' command, showing the status of running containers. ```text CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 06115f09e689 quay.io/poseidon/dnsmasq:v0.5.0-32-g4327d60-amd64 "/usr/sbin/dnsmasq -…" 47 seconds ago Up 46 seconds dnsmasq 6bf638f0808e ghcr.io/cozystack/cozystack/matchbox:v0.30.0 "/matchbox -address=…" 3 minutes ago Up 3 minutes matchbox ``` -------------------------------- ### Create Cluster Configuration Directory Source: https://cozystack.io/docs/v1.4/install/kubernetes/talosctl Start by creating a directory to hold your cluster's configuration files and navigate into it. ```bash mkdir -p cluster1 cd cluster1 ``` -------------------------------- ### Install kubelogin with Chocolatey Source: https://cozystack.io/docs/v1.4/operations/oidc/enable_oidc Use Chocolatey to install the kubelogin tool on Windows. This is a prerequisite for configuring OIDC. ```bash choco install kubelogin ``` -------------------------------- ### Clean Disk State Example Source: https://cozystack.io/docs/v1.4/storage/disk-preparation Example output of `lsblk -f` on a node with clean disks, showing no filesystem types or labels, indicating they are ready for LINSTOR. ```text NAME FSTYPE LABEL UUID MOUNTPOINT nvme0n1 nvme1n1 ``` -------------------------------- ### Install Ansible Collections for Cozystack Source: https://cozystack.io/docs/v1.4/install/kubernetes/generic Installs the necessary Ansible collections required for managing Cozystack deployments. ```bash ansible-galaxy collection install ansible.posix community.general kubernetes.core ansible.utils ``` -------------------------------- ### Create Sample Workload Namespace and ConfigMap Source: https://cozystack.io/docs/v1.4/kubernetes/backups-with-velero-addon Use these kubectl commands to create a new namespace named 'demo' and a configmap within it for backup testing. ```bash kubectl create namespace demo kubectl -n demo create configmap demo-cm \ --from-literal=marker=backup-restore-validation ```