### Run Cozystack Website Documentation Source: https://github.com/cozystack/website/blob/main/README.md Starts the Hugo development server to preview the Cozystack website documentation locally. Assumes Hugo is installed and in the system's PATH. ```bash hugo serve ``` -------------------------------- ### Install boot-to-talos CLI Source: https://github.com/cozystack/website/blob/main/content/en/docs/getting-started/install-talos.md Installs the `boot-to-talos` command-line tool by downloading and executing an installation script from GitHub. This script handles the setup of the tool on the current system. ```bash curl -sSL https://github.com/cozystack/boot-to-talos/raw/refs/heads/main/hack/install.sh | sh -s ``` -------------------------------- ### Install Go (Version 1.14+) Source: https://github.com/cozystack/website/blob/main/README.md Installs Go version 1.24.2 on Linux systems. This involves downloading the archive, extracting it to the /usr/local directory, and updating the PATH environment variable. Requires wget and tar. ```bash wget https://go.dev/dl/go1.24.2.linux-amd64.tar.gz -P /tmp rm -rf /usr/bin/go && sudo tar -C /usr/local -xzf /tmp/go1.24.2.linux-amd64.tar.gz export PATH=$PATH:/usr/local/go/bin go version ``` -------------------------------- ### Cozystack Sandbox Login and Environment Setup (Shell) Source: https://github.com/cozystack/website/blob/main/content/en/docs/development.md Enables login to the Cozystack sandbox environment by downloading kubeconfig and running a shell. Requires 'mirrord' to be installed. ```shell make login # Downloads the kubeconfig into a temporary directory and runs a shell with the sandbox environment; mirrord must be installed. ``` -------------------------------- ### Example Docker ps Output Source: https://github.com/cozystack/website/blob/main/content/en/docs/install/talos/pxe.md Sample output from the 'docker ps' command, indicating that the dnsmasq and matchbox containers are running successfully. ```console 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 ``` -------------------------------- ### Install Hugo (Extended Version) Source: https://github.com/cozystack/website/blob/main/README.md Installs the extended version of Hugo required for the project. This process involves downloading the Hugo binary, extracting it, and making it executable. Assumes wget and tar are available. Requires write permissions to /usr/local/bin. ```bash wget https://github.com/gohugoio/hugo/releases/download/v0.122.0/hugo_extended_0.122.0_linux-amd64.tar.gz tar -xzf hugo_extended_0.122.0_linux-amd64.tar.gz chmod +x /usr/local/bin/hugo ``` -------------------------------- ### Cozystack Installation ConfigMap Example (YAML) Source: https://github.com/cozystack/website/blob/main/content/en/docs/operations/configuration/configmap.md An example Kubernetes ConfigMap for installing Cozystack. It specifies the bundle, root host, API endpoint, exposed services, and network CIDR ranges for pods and services. ```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" ``` -------------------------------- ### Check Go and Hugo Versions Source: https://github.com/cozystack/website/blob/main/README.md Verifies that the installed versions of Go and Hugo meet the project's requirements. No external dependencies are needed. ```bash go version hugo version ``` -------------------------------- ### Kubernetes Commands for Cozystack Installation Source: https://github.com/cozystack/website/blob/main/content/en/docs/getting-started/install-cozystack.md Provides essential kubectl commands to set up the Cozystack environment. This includes creating the necessary namespace, applying the configuration file, and deploying the Cozystack installer from a remote URL. It also shows how to monitor the installer's logs. ```bash kubectl create ns cozy-system kubectl apply -f cozystack.yaml ``` ```bash kubectl apply -f https://github.com/cozystack/cozystack/releases/latest/download/cozystack-installer.yaml ``` ```bash kubectl logs -n cozy-system deploy/cozystack -f ``` -------------------------------- ### Setup Root Tenant Services (Bash) Source: https://github.com/cozystack/website/blob/main/content/en/docs/getting-started/install-cozystack.md Enables etcd, monitoring, and isolated mode for the root tenant services. ```bash kubectl patch -n tenant-root tenants.apps.cozystack.io root --type=merge -p ' {"spec":{ "monitoring": true, "etcd": true, "isolated": true }}' ``` -------------------------------- ### Monitor Cozystack Installation (Bash) Source: https://github.com/cozystack/website/blob/main/content/en/docs/install/providers/hetzner.md Command to stream the logs of the Cozystack installer pod in the `cozy-system` namespace. This is useful for tracking the installation progress and diagnosing any potential issues during the setup process. ```bash kubectl logs -n cozy-system deploy/cozystack -f ``` -------------------------------- ### Example: Building Cozystack Image and Applying Source: https://github.com/cozystack/website/blob/main/content/en/docs/development.md Illustrates how to build the Cozystack container image with an updated Helm chart and apply the changes to the cluster. It includes steps for checking the deployed pods and HelmRelease objects. ```shell cd packages/core/installer # Go to the cozystack package make image-cozystack # Build cozystack image make apply # Apply to the cluster kubectl get pod -n cozy-system # Check if everything works as expected kubectl get hr -A # Check HelmRelease objects ``` -------------------------------- ### Run boot-to-talos for Talos Linux Installation Source: https://github.com/cozystack/website/blob/main/content/en/docs/getting-started/install-talos.md Executes the `boot-to-talos` command to install Talos Linux. The tool prompts for user input regarding the target disk, Talos installer image, and network configuration. It then proceeds to format the disk and install the Talos Linux image, outputting detailed progress and success messages. ```console $ boot-to-talos Target disk [/dev/sda]: Talos installer image [ghcr.io/cozystack/cozystack/talos:v1.10.5]: 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.10.5 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.10.5 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.10.5 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.10.5 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 ``` -------------------------------- ### Run boot-to-talos for Talos installation Source: https://github.com/cozystack/website/blob/main/content/en/docs/install/talos/boot-to-talos.md Executes the `boot-to-talos` command to install Talos Linux. It prompts for target disk, Talos image, networking configuration, and serial console options. The output shows the installation process and summary. ```console $ boot-to-talos Target disk [/dev/sda]: Talos installer image [ghcr.io/cozystack/cozystack/talos:v1.10.5]: 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.10.5 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.10.5 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.10.5 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.10.5 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 ``` -------------------------------- ### Download boot-to-talos binary Source: https://github.com/cozystack/website/blob/main/content/en/docs/install/talos/boot-to-talos.md Downloads the `boot-to-talos` binary for Linux AMD64 from the GitHub releases page. This method is an alternative to using the install script. ```bash wget https://github.com/cozystack/boot-to-talos/releases/latest/download/boot-to-talos-linux-amd64.tar.gz ``` -------------------------------- ### Start Matchbox Server Docker Container Source: https://github.com/cozystack/website/blob/main/content/en/docs/install/talos/pxe.md Launches a Docker container for the Matchbox server, which serves Talos boot artifacts. It binds to port 8080 and logs in debug mode. Requires Docker to be installed. ```bash sudo docker run --name=matchbox -d --net=host ghcr.io/cozystack/cozystack/matchbox:v0.30.0 \ -address=:8080 \ -log-level=debug ``` -------------------------------- ### Talm Cluster Configuration Example (values.yaml) Source: https://github.com/cozystack/website/blob/main/content/en/docs/install/providers/hetzner.md An example YAML configuration file for Talm, specifying cluster details like endpoint, subnets, floating IP, and Talos image. This configuration is essential for setting up the Kubernetes cluster. ```yaml endpoint: "https://10.0.1.100:6443" clusterDomain: cozy.local # floatingIP points to the primary etcd node floatingIP: 10.0.1.100 image: "ghcr.io/cozystack/cozystack/talos:v1.9.5" podSubnets: - 10.244.0.0/16 serviceSubnets: - 10.96.0.0/16 advertisedSubnets: # vSwitch subnet - 10.0.1.0/24 oidcIssuerUrl: "" certSANs: [] ``` -------------------------------- ### Install kexec-tools Source: https://github.com/cozystack/website/blob/main/content/en/docs/install/providers/servers-com/_index.md Installs the kexec-tools package, which provides utilities for loading and executing the Linux kernel from the currently running system. This is necessary for booting into the new Talos kernel. ```bash dnf install kexec-tools -y ``` -------------------------------- ### Cozystack Installation Commands (Bash) Source: https://github.com/cozystack/website/blob/main/content/en/docs/install/providers/hetzner.md Commands to install Cozystack components in a Kubernetes cluster. It involves creating a namespace, applying the configuration map, and deploying the Cozystack installer. The last command initiates the installation and provides a way to monitor its progress. ```bash kubectl create ns cozy-system kubectl apply -f cozystack-config.yaml kubectl apply -f https://github.com/cozystack/cozystack/releases/latest/download/cozystack-installer.yaml ``` -------------------------------- ### Install Cozystack Components (Bash) Source: https://github.com/cozystack/website/blob/main/content/en/docs/install/cozystack/_index.md Applies the necessary Cozystack configurations and installer. It requires kubectl to be installed and configured. ```bash kubectl create ns cozy-system kubectl apply -f cozystack.yaml kubectl apply -f https://github.com/cozystack/cozystack/releases/latest/download/cozystack-installer.yaml ``` -------------------------------- ### Example: Updating Cilium Package Source: https://github.com/cozystack/website/blob/main/content/en/docs/development.md Demonstrates the workflow for updating the Cilium package. This involves navigating to the package directory, updating the Helm chart and image, diffing changes against the cluster, applying the updates, and verifying the deployment. ```shell cd packages/system/cilium # Go to application directory make update # Download new version from upstream make image # Build cilium image git diff . # Show diff with changed manifests make diff # Show diff with applied cluster manifests make apply # Apply changed manifests to the cluster kubectl get pod -n cozy-cilium # Check if everything works as expected git commit -m "Update cilium" # Commit changes to the branch ``` -------------------------------- ### RabbitMQ Resource Configuration Example Source: https://github.com/cozystack/website/blob/main/content/en/docs/applications/rabbitmq.md This example demonstrates how to explicitly configure CPU and memory for RabbitMQ replicas using the 'resources' parameter. This overrides any settings defined by 'resourcesPreset'. ```yaml resources: cpu: 4000m memory: 4Gi ``` -------------------------------- ### Monitor Cozystack Installer Logs (Bash) Source: https://github.com/cozystack/website/blob/main/content/en/docs/install/cozystack/_index.md Streams the logs from the Cozystack installer deployment in the 'cozy-system' namespace. This is useful for tracking the installation progress and identifying any potential issues. ```bash kubectl logs -n cozy-system deploy/cozystack -f ``` -------------------------------- ### Database Configuration Example Source: https://github.com/cozystack/website/blob/main/content/en/docs/applications/postgres.md Example of configuring databases, including defining user roles (admin, readonly) and enabling extensions like hstore. ```yaml databases: myapp: roles: admin: - user1 - debezium readonly: - user2 airflow: roles: admin: - airflow extensions: - hstore ``` -------------------------------- ### Check Node Readiness using Netcat Source: https://github.com/cozystack/website/blob/main/content/en/docs/install/providers/hetzner.md Automates the check for node readiness by verifying if port 50000 is open on multiple nodes using 'nc' (netcat). The command waits until all specified nodes expose the port, indicating they have completed Talos setup and rebooted. ```bash timeout 60 sh -c 'until \ nc -nzv 12.34.56.101 50000 && \ nc -nzv 12.34.56.102 50000 && \ nc -nzv 12.34.56.103 50000; \ do sleep 1; done' ``` -------------------------------- ### Install kubelogin with Krew Source: https://github.com/cozystack/website/blob/main/content/en/docs/operations/oidc/enable_oidc.md This command installs the `oidc-login` plugin for kubectl using Krew. This plugin is part of `kubelogin` and facilitates OIDC authentication with kubeconfig. ```bash # Krew (macOS, Linux, Windows and ARM) kubectl krew install oidc-login ``` -------------------------------- ### Install Talm Source: https://github.com/cozystack/website/blob/main/content/en/docs/getting-started/requirements.md Installs Cozystack's Talm configuration manager using a curl script. This script downloads and executes an installation script from GitHub. ```bash curl -sSL https://github.com/cozystack/talm/raw/refs/heads/main/hack/install.sh | sh -s ``` -------------------------------- ### Check Block Devices Source: https://github.com/cozystack/website/blob/main/content/en/docs/install/providers/servers-com/_index.md Lists block devices available on the system, showing their names, sizes, and mount points. This is a preliminary step to identify disks for wiping and installation. ```bash # lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS sda 259:4 0 476.9G 0 disk sdb 259:0 0 476.9G 0 disk ``` -------------------------------- ### LINSTOR CLI: Example of Creating a Node Connection Path Source: https://github.com/cozystack/website/blob/main/content/en/docs/storage/dedicated-network.md An example demonstrating the creation of a connection path between 'node01' and 'node02' using the 'optic-san' network interface on both nodes. It shows the command and the expected success output, including details about applied changes and resource adjustments. ```bash LINSTOR ==> node-connection path create node01 node02 node01-02 optic-san optic-san SUCCESS: Successfully set property key(s): Paths/node01-02/node01,Paths/node01-02/node02 SUCCESS: Description: Node connection between nodes 'node01' and 'node02' modified. Details: Node connection between nodes 'node01' and 'node02' UUID is: c1f4ee6a-776e-46ba-9e74-99afce38d90f SUCCESS: (node02) Node changes applied. SUCCESS: (node02) Resource '`pvc-6f535d3a-82c1-46ab-80fe-5a59ee8bff44`' [DRBD] adjusted. .... ``` -------------------------------- ### Zookeeper Topic Configuration Example Source: https://github.com/cozystack/website/blob/main/content/en/docs/applications/kafka.md Example of configuring Kafka topics, specifying names, partition counts, replica counts, and custom configurations like retention policies and minimum in-sync replicas. ```yaml topics: - name: Results partitions: 1 replicas: 3 config: min.insync.replicas: 2 - name: Orders config: cleanup.policy: compact segment.ms: 3600000 max.compaction.lag.ms: 5400000 min.insync.replicas: 2 partitions: 1 replicas: 3 ``` -------------------------------- ### Explicit Resource Configuration Example Source: https://github.com/cozystack/website/blob/main/content/en/docs/applications/clickhouse.md Provides an example of explicitly setting CPU and memory configurations for ClickHouse Keeper replicas. This overrides any settings defined by `resourcesPreset`. ```yaml resources: cpu: "4000m" memory: "4Gi" ``` -------------------------------- ### Install Talos Bootstrap Source: https://github.com/cozystack/website/blob/main/content/en/docs/install/kubernetes/talos-bootstrap.md Initiates the talos-bootstrap installation process on the current node within the cluster configuration directory. ```bash talos-bootstrap install ``` -------------------------------- ### Apply Talm Configurations to Nodes Source: https://github.com/cozystack/website/blob/main/content/en/docs/install/providers/servers-com/_index.md Applies the generated Talm configurations to all specified nodes. This process will install Talos on the disks and reboot the nodes. ```bash talm apply -f nodeN.yml ``` -------------------------------- ### Install kubelogin with Chocolatey Source: https://github.com/cozystack/website/blob/main/content/en/docs/operations/oidc/enable_oidc.md This command installs the `kubelogin` tool on Windows systems using Chocolatey. This enables the use of OIDC-enabled kubeconfig files. ```bash # Chocolatey (Windows) choco install kubelogin ``` -------------------------------- ### Download Talos Linux ISO Source: https://github.com/cozystack/website/blob/main/content/en/docs/install/talos/iso.md Downloads the Talos Linux ISO image for amd64 architecture using wget. Ensure you have wget installed and sufficient permissions to save the file. ```bash wget https://github.com/cozystack/cozystack/releases/latest/download/metal-amd64.iso ``` -------------------------------- ### Download and Install talos-bootstrap Script Source: https://github.com/cozystack/website/blob/main/content/en/docs/install/kubernetes/talos-bootstrap.md This snippet shows how to download the latest talos-bootstrap script from GitHub, make it executable, and verify its installation by checking its help message. It requires `curl` and `chmod`. ```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 ``` -------------------------------- ### Cozystack Sandbox SOCKS5 Proxy Setup (Shell) Source: https://github.com/cozystack/website/blob/main/content/en/docs/development.md Configures a SOCKS5 proxy server for the Cozystack sandbox environment, allowing browser access to cluster services. Requires 'mirrord' and 'gost' to be installed. ```shell make proxy # Enable a SOCKS5 proxy server; mirrord and gost must be installed. ``` -------------------------------- ### Cozystack Installer Configuration (YAML) Source: https://github.com/cozystack/website/blob/main/content/en/docs/install/providers/hetzner.md Defines the Cozystack installation configuration using a ConfigMap. It specifies bundles to enable/disable, root host, API endpoint, and network subnets for pods and services. This file is applied to the Kubernetes cluster to guide the Cozystack installation process. ```yaml apiVersion: v1 kind: ConfigMap metadata: name: cozystack namespace: cozy-system data: bundle-name: "paas-full" bundle-disable: "metallb" bundle-enable: "hetzner-robotlb" root-host: "example.org" api-server-endpoint: "https://api.example.com:443" expose-services: "dashboard,api" ## podSubnets from the node config ipv4-pod-cidr: "10.244.0.0/16" ipv4-pod-gateway: "10.244.0.1" ## serviceSubnets from the node config ipv4-svc-cidr: "10.96.0.0/16" ``` -------------------------------- ### Load and Execute Talos Kernel Source: https://github.com/cozystack/website/blob/main/content/en/docs/install/providers/servers-com/_index.md Loads the downloaded Talos kernel and initramfs into memory using kexec and then executes the new kernel, initiating the boot process into Talos Linux. The system will reboot after this command. ```bash kexec -l /tmp/vmlinuz --initrd=/tmp/initramfs.xz --command-line="$CMDLINE" kexec -e ``` -------------------------------- ### Bootstrap the First Node Source: https://github.com/cozystack/website/blob/main/content/en/docs/install/providers/servers-com/_index.md Executes the bootstrap command for the initial node in the cluster, initiating the cluster formation process. ```bash talm bootstrap -f nodes/node1.yml ``` -------------------------------- ### Configure Node Hostname Source: https://github.com/cozystack/website/blob/main/content/en/docs/install/providers/servers-com/_index.md Example of configuring the hostname for a node within the Talm configuration file. ```yaml machine: network: hostname: node1 ``` -------------------------------- ### Get Grafana Admin Password Source: https://github.com/cozystack/website/blob/main/content/en/docs/getting-started/install-cozystack.md This command retrieves the Grafana admin password from the Kubernetes secret named 'grafana-admin-password' in the 'tenant-root' namespace. It utilizes `kubectl get secret` and a Go template to decode the base64 encoded password. ```bash kubectl get secret -n tenant-root grafana-admin-password -o go-template='{{ printf "%s\n" (index .data "password" | base64decode) }}' ``` -------------------------------- ### Get Cozystack Dashboard Authentication Token Source: https://github.com/cozystack/website/blob/main/content/en/docs/getting-started/install-cozystack.md This command retrieves the authentication token for 'tenant-root' from the Kubernetes secret named 'tenant-root' in the 'tenant-root' namespace. It uses `kubectl get secret` with a Go template to decode the base64 encoded token. ```bash kubectl get secret -n tenant-root tenant-root -o go-template='{{ printf "%s\n" (index .data "token" | base64decode) }}' ``` -------------------------------- ### Configure Node Nameservers Source: https://github.com/cozystack/website/blob/main/content/en/docs/install/providers/servers-com/_index.md Example of updating the nameservers in the Talm node configuration to public DNS servers. ```yaml machine: network: nameservers: - 8.8.8.8 - 1.1.1.1 ``` -------------------------------- ### Get Kubeconfig Source: https://github.com/cozystack/website/blob/main/content/en/docs/install/providers/oracle-cloud.md Retrieves the kubeconfig file for cluster access from a specified control-plane node. ```bash talm kubeconfig kubeconfig -f nodes/node0.yaml ``` -------------------------------- ### Save and Use Kubeconfig Source: https://github.com/cozystack/website/blob/main/content/en/docs/getting-started/deploy-app.md Demonstrates saving the cluster's admin configuration to a file and setting the KUBECONFIG environment variable to access the cluster. Includes verifying node status. ```bash $ cat ~/.kube/kubeconfig-team1.example.org apiVersion: v1 clusters: - cluster: certificate-authority-data: LS0tL ... $ export KUBECONFIG=~/.kube/kubeconfig-team1.example.org $ kubectl get nodes NAME STATUS ROLES AGE VERSION kubernetes-dev-md0-vn8dh-jjbm9 Ready ingress-nginx 29m v1.30.11 kubernetes-dev-md0-vn8dh-xhsvl Ready ingress-nginx 25m v1.30.11 ``` -------------------------------- ### Apply MetalLB Manifests (Bash) Source: https://github.com/cozystack/website/blob/main/content/en/docs/getting-started/install-cozystack.md Applies the necessary MetalLB configuration files to advertise IP address pools and enable L2 connectivity for services. ```bash kubectl create -f metallb-l2-advertisement.yml kubectl create -f metallb-ip-address-pool.yml ``` -------------------------------- ### Deploy Application with Helm Source: https://github.com/cozystack/website/blob/main/content/en/docs/getting-started/deploy-app.md Shows the command to deploy or upgrade an application using Helm, specifying the release name, chart path, and a custom values file. ```bash helm upgrade --install -f values.yaml ``` -------------------------------- ### Configure Node Private Interface and VIP Source: https://github.com/cozystack/website/blob/main/content/en/docs/install/providers/servers-com/_index.md Example of adding private interface configuration, including IP address, routes, and VIP, to the Talm node configuration. ```yaml machine: network: interfaces: - interface: eno2 addresses: - 1.2.3.4/29 routes: - network: 0.0.0.0/0 gateway: 1.2.3.1 - interface: eno1 addresses: - 192.168.100.11/24 vip: ip: 192.168.100.10 ``` -------------------------------- ### Construct Talos Kernel Command Line Source: https://github.com/cozystack/website/blob/main/content/en/docs/install/providers/servers-com/_index.md Constructs the kernel command line arguments required for Talos Linux. This includes boot parameters, platform information, and the dynamically gathered network settings. ```bash CMDLINE="init_on_alloc=1 slab_nomerge pti=on console=tty0 console=ttyS0 printk.devkmsg=on talos.platform=metal ip=${IP}::${GATEWAY}:${NETMASK}::${INTERFACE_NAME}:::::" echo $CMDLINE ``` -------------------------------- ### Set up LINSTOR Alias Source: https://github.com/cozystack/website/blob/main/content/en/docs/getting-started/install-cozystack.md Creates a convenient alias for the linstor command-line tool, allowing direct interaction with the LINSTOR controller within the cozy-linstor namespace. This simplifies subsequent LINSTOR operations. ```bash alias linstor='kubectl exec -n cozy-linstor deploy/linstor-controller -- linstor' ``` -------------------------------- ### Get Kubernetes Storage Classes Source: https://github.com/cozystack/website/blob/main/content/en/docs/getting-started/install-cozystack.md Retrieves a list of all Storage Classes configured in the Kubernetes cluster. This is used to verify that the 'local' and 'replicated' Storage Classes have been applied successfully. ```bash kubectl get storageclasses ``` -------------------------------- ### Deploy PostgreSQL using kubectl Source: https://github.com/cozystack/website/blob/main/content/en/docs/getting-started/deploy-app.md Creates a PostgreSQL instance using a HelmRelease manifest. This manifest specifies the chart version, repository, namespace, and resource configurations like replicas, size, and user credentials. Ensure you have kubectl configured to interact with your cluster. ```yaml apiVersion: helm.toolkit.fluxcd.io/v2 kind: HelmRelease metadata: name: postgres-instaphoto-dev namespace: tenant-team1 spec: chart: spec: chart: postgres reconcileStrategy: Revision sourceRef: kind: HelmRepository name: cozystack-apps namespace: cozy-public version: 0.10.0 interval: 0s values: databases: myapp: roles: admin: - user1 external: true replicas: 2 resourcesPreset: nano size: 5Gi users: user1: password: strongpassword ``` -------------------------------- ### Start Dnsmasq DHCP/PXE Server Docker Container Source: https://github.com/cozystack/website/blob/main/content/en/docs/install/talos/pxe.md Starts a Docker container for dnsmasq, acting as a DHCP and PXE server. It's configured to manage a DHCP range, set a router, enable TFTP, and specify boot files for BIOS and UEFI systems via iPXE. Requires Docker and NET_ADMIN capability. ```bash sudo docker run --name=dnsmasq -d --cap-add=NET_ADMIN --net=host quay.io/poseidon/dnsmasq:v0.5.0-32-g4327d60-amd64 \ -d -q -p0 \ --dhcp-range=192.168.100.3,192.168.100.199 \ --dhcp-option=option:router,192.168.100.1 \ --enable-tftp \ --tftp-root=/var/lib/tftpboot \ --dhcp-match=set:bios,option:client-arch,0 \ --dhcp-boot=tag:bios,undionly.kpxe \ --dhcp-match=set:efi32,option:client-arch,6 \ --dhcp-boot=tag:efi32,ipxe.efi \ --dhcp-match=set:efibc,option:client-arch,7 \ --dhcp-boot=tag:efibc,ipxe.efi \ --dhcp-match=set:efi64,option:client-arch,9 \ --dhcp-boot=tag:efi64,ipxe.efi \ --dhcp-userclass=set:ipxe,iPXE \ --dhcp-boot=tag:ipxe,http://192.168.100.254:8080/boot.ipxe \ --log-queries \ --log-dhcp ``` -------------------------------- ### Initialize Talm for Cozystack Source: https://github.com/cozystack/website/blob/main/content/en/docs/install/providers/servers-com/_index.md Initializes Talm for the Cozystack project. This is a prerequisite for generating configuration files. ```bash talm init -p cozystack ``` -------------------------------- ### List HelmReleases in Cozystack Source: https://github.com/cozystack/website/blob/main/content/en/docs/operations/troubleshooting/_index.md Lists all installed HelmReleases across all namespaces in a Cozystack cluster. This command is useful for verifying the status and age of various platform components managed by Flux CD. ```console # kubectl get hr -A NAMESPACE NAME AGE READY STATUS cozy-cert-manager cert-manager 4m1s True Release reconciliation succeeded cozy-cert-manager cert-manager-issuers 4m1s True Release reconciliation succeeded cozy-cilium cilium 4m1s True Release reconciliation succeeded cozy-cluster-api capi-operator 4m1s True Release reconciliation succeeded cozy-cluster-api capi-providers 4m1s True Release reconciliation succeeded cozy-dashboard dashboard 4m1s True Release reconciliation succeeded cozy-fluxcd cozy-fluxcd 4m1s True Release reconciliation succeeded cozy-grafana-operator grafana-operator 4m1s True Release reconciliation succeeded cozy-kamaji kamaji 4m1s True Release reconciliation succeeded cozy-kubeovn kubeovn 4m1s True Release reconciliation succeeded cozy-kubevirt-cdi kubevirt-cdi 4m1s True Release reconciliation succeeded cozy-kubevirt-cdi kubevirt-cdi-operator 4m1s True Release reconciliation succeeded cozy-kubevirt kubevirt 4m1s True Release reconciliation succeeded cozy-kubevirt kubevirt-operator 4m1s True Release reconciliation succeeded cozy-linstor linstor 4m1s True Release reconciliation succeeded cozy-linstor piraeus-operator 4m1s True Release reconciliation succeeded cozy-mariadb-operator mariadb-operator 4m1s True Release reconciliation succeeded cozy-metallb metallb 4m1s True Release reconciliation succeeded cozy-monitoring monitoring 4m1s True Release reconciliation succeeded cozy-postgres-operator postgres-operator 4m1s True Release reconciliation succeeded cozy-rabbitmq-operator rabbitmq-operator 4m1s True Release reconciliation succeeded cozy-redis-operator redis-operator 4m1s True Release reconciliation succeeded cozy-telepresence telepresence 4m1s True Release reconciliation succeeded cozy-victoria-metrics-operator victoria-metrics-operator 4m1s True Release reconciliation succeeded tenant-root tenant-root 4m1s True Release reconciliation succeeded ``` -------------------------------- ### Get Ingress Controller Service IP Source: https://github.com/cozystack/website/blob/main/content/en/docs/getting-started/install-cozystack.md Fetches the service details for the 'root-ingress-controller' in the 'tenant-root' namespace. This is used to find the public IP address assigned to the ingress controller, which is essential for external access to cluster services. ```bash kubectl get svc -n tenant-root root-ingress-controller ``` -------------------------------- ### Create MikroTik VMInstance on Cozystack Source: https://github.com/cozystack/website/blob/main/content/en/docs/virtualization/mikrotik.md Creates a VMInstance named 'mikrotik-demo' using a lightweight 'ubuntu' instance profile and 'u1.medium' instance type. It attaches two SATA disks: one for the system and one for the installation ISO. ```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 ``` -------------------------------- ### paas-hosted Bundle Configuration (YAML) Source: https://github.com/cozystack/website/blob/main/content/en/docs/operations/configuration/bundles.md Example configuration for the 'paas-hosted' bundle, designed for installing Cozystack on existing managed Kubernetes clusters. This bundle includes layers 3 and 4, focusing on Cozystack API, UI, and tenant clusters. ```yaml apiVersion: v1 kind: ConfigMap metadata: name: cozystack namespace: cozy-system data: bundle-name: "paas-hosted" root-host: "example.org" api-server-endpoint: "https://192.168.100.10:6443" expose-services: "api,dashboard" ``` -------------------------------- ### List Storage Pools with Linstor Source: https://github.com/cozystack/website/blob/main/content/en/docs/getting-started/install-cozystack.md Lists all configured storage pools in the Linstor environment. This command is used to verify the successful creation of storage pools. ```bash linstor sp l ``` -------------------------------- ### paas-full Bundle Configuration (YAML) Source: https://github.com/cozystack/website/blob/main/content/en/docs/operations/configuration/bundles.md Example configuration for the 'paas-full' bundle, which provides a full-featured PaaS and IaaS solution for Talos Linux. This includes all Cozystack layers and components for a comprehensive PaaS experience. ```yaml apiVersion: v1 kind: ConfigMap metadata: name: cozystack namespace: cozy-system data: bundle-name: "paas-full" 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" root-host: "example.org" api-server-endpoint: "https://192.168.100.10:6443" expose-services: "api,dashboard,cdi-uploadproxy,vm-exportproxy" ``` -------------------------------- ### Talos Volume Configuration (YAML) Source: https://github.com/cozystack/website/blob/main/content/en/docs/operations/faq/single-disk-installation.md Defines ephemeral volume and user storage configurations for Talos. It specifies the minimum size for ephemeral storage and a selector for NVMe disks for user storage, with a minimum size of 400GiB. This configuration should be applied during the initial node setup. ```yaml --- apiVersion: v1alpha1 kind: VolumeConfig name: EPHEMERAL provisioning: minSize: 70GiB --- apiVersion: v1alpha1 kind: UserVolumeConfig name: data-storage provisioning: diskSelector: match: disk.transport == 'nvme' minSize: 400GiB ``` -------------------------------- ### Create Cloud-Init Partition Source: https://github.com/cozystack/website/blob/main/content/en/docs/install/providers/hetzner.md Resizes the GPT partition table on the primary disk and creates a new 20MB FAT32 partition at the end for cloud-init data. It then formats this partition and mounts it. ```bash # resize gpt partition sgdisk -e "/dev/$DISK1" # Create 20MB partition at the end of the disk end=$(sgdisk -E "/dev/$DISK1") sgdisk -n7:$(( $end - 40960 )):$end -t7:ef00 "/dev/$DISK1" # Create FAT filesystem for cloud-init and mount it PARTITION=$(sfdisk -d "/dev/$DISK1" | awk 'END{print $1}' | awk -F/ '{print $NF}') mkfs.vfat -n CIDATA "/dev/$PARTITION" mount "/dev/$PARTITION" /mnt ``` -------------------------------- ### Building OS Image with Docker (Shell) Source: https://github.com/cozystack/website/blob/main/content/en/blog/2024-04-05-diy-create-your-own-cloud-with-kubernetes-part-1/index.md This command demonstrates how to use Docker to build an OS image from a configuration file. It pipes the content of a configuration file (e.g., config.yaml) into a Docker container that runs the siderolabs/imager tool. This process creates a Docker container image containing the necessary firmware and kernel modules for Talos Linux. ```bash cat config.yaml | docker run --rm -i -v /dev:/dev --privileged "ghcr.io/siderolabs/imager:v1.6.4" - ``` -------------------------------- ### Configure VMInstance for Existing Windows Image Conversion Source: https://github.com/cozystack/website/blob/main/content/en/docs/virtualization/windows.md Configures a VMInstance to attach an existing Windows system disk (with 'sata' bus) and a dummy disk (defaulting to Virtio SCSI bus) for Virtio driver installation. It may also include the Virtio ISO for simplified driver setup. ```yaml spec: instanceProfile: windows.2k25.virtio disks: - name: win2k19-system bus: sata - name: dummy-disk-for-virtio - name: virtio-drivers bus: sata ``` -------------------------------- ### Add VLAN Configuration to Node Files (Diff Example) Source: https://github.com/cozystack/website/blob/main/content/en/docs/install/providers/hetzner.md Demonstrates how to modify a Talos node configuration file by adding VLAN settings, including IP addresses, routes, VLAN ID, and VIP. This uses a diff format for clarity, highlighting the changes needed for each node's network interface. ```diff machine: network: interfaces: - deviceSelector: # ... - vip: - ip: 10.0.1.100 + vlans: + - addresses: + # different for each node + - 10.0.1.101/24 + routes: + - network: 10.0.0.0/16 + gateway: 10.0.1.1 + vlanId: 4000 + vip: + ip: 10.0.1.100 ``` -------------------------------- ### Load and Execute Talos Linux Kernel with kexec Source: https://github.com/cozystack/website/blob/main/content/en/docs/install/talos/kexec.md Loads the Talos Linux kernel and initramfs into memory and then executes it using `kexec`. This command initiates the boot process of Talos Linux from the current operating system. ```bash kexec --load /tmp/vmlinuz --initrd=/tmp/initramfs.xz --command-line="$CMDLINE" kexec --exec ```