### Download Installation Media (Bash) Source: https://github.com/siderolabs/omni-docs/blob/main/how-to-guides/how-to-set-initial-machine-labels.md Download the installation media (e.g., ISO) for a specific schematic ID and version. This command uses cURL to fetch the ISO file from the Image Factory. ```bash curl -O https://factory.talos.dev/image/d2f4229b6157ba7e1dba8c3b4de42263e4baa35111e960b6a18841332d0f2035/v1.7.6/metal-amd64.iso ``` -------------------------------- ### Install Grafana Helm Chart Source: https://github.com/siderolabs/omni-docs/blob/main/how-to-guides/expose-an-http-service-from-a-cluster.md Commands to add the Grafana Helm repository and install the Grafana chart using a specified values file. ```bash helm repo add grafana https://grafana.github.io/helm-charts helm install -f values.yaml grafana grafana/grafana ``` -------------------------------- ### Set Initial Machine Labels with Omnictl CLI Source: https://github.com/siderolabs/omni-docs/blob/main/how-to-guides/how-to-set-initial-machine-labels.md This command demonstrates how to use the `omnictl` CLI tool to download installation media (e.g., ISO) and set initial machine labels using the `--initial-labels` flag. Labels are provided as a comma-separated list of key-value pairs. The output is an installation media file or a PXE boot URL. ```bash omnictl download iso --arch amd64 \ --initial-labels environment=production,region=us-west ``` -------------------------------- ### Install Omni CLI Tools Source: https://context7.com/siderolabs/omni-docs/llms.txt Installs the Sidero CLI tools, including omnictl, via Homebrew. It also outlines the process of downloading and placing the omniconfig file and verifying the CLI configuration. The first run of `omnictl get clusters` triggers browser authentication. ```bash # Install all Sidero tools (talosctl, omnictl, kube-oidc_login) brew install siderolabs/tap/sidero-tools # Download omniconfig from Omni dashboard and place in default location # Linux: ~/.config/omni/config # macOS: ~/Library/Application Support/omni/config # Verify configuration omnictl config contexts # Output: CURRENT NAME URL # * example https://example.omni.siderolabs.io/ # First run triggers browser authentication omnictl get clusters ``` -------------------------------- ### Define Machine Configuration with Install Disk and Patches Source: https://github.com/siderolabs/omni-docs/blob/main/reference/cluster-templates.md Specifies the installation disk and machine-specific configuration patches for a Machine. This is optional but must be referenced by ControlPlane or Workers documents. Supports labels, annotations, and system extensions. ```yaml kind: Machine name: 27c16241-96bf-4f17-9579-ea3a6c4a3ca8 labels: my-label: my-value annotations: my-annotation: my-value locked: false install: disk: /dev/vda patches: - file: patches/example-machine-patch.yaml systemExtensions: - siderolabs/hello-world-service ``` -------------------------------- ### Download Talos Linux Installation Media Source: https://context7.com/siderolabs/omni-docs/llms.txt Provides various commands for the omnictl CLI to download Talos Linux ISOs or platform-specific images, including support for extensions, labels, SecureBoot, and PXE configurations. ```bash omnictl download iso --arch amd64 omnictl download "AWS AMI (amd64)" omnictl download vultr --arch arm64 omnictl download iso --extensions siderolabs/iscsi-tools --extensions siderolabs/util-linux-tools omnictl download iso --initial-labels environment=production,datacenter=us-west omnictl download iso --secureboot --talos-version 1.7.4 omnictl download iso --pxe ``` -------------------------------- ### Generate and Install Fish Autocompletion Source: https://github.com/siderolabs/omni-docs/blob/main/reference/cli.md Commands to generate and persist fish shell completion scripts. ```fish omnictl completion fish | source omnictl completion fish > ~/.config/fish/completions/omnictl.fish ``` -------------------------------- ### Accessing Cluster with Kubectl Source: https://github.com/siderolabs/omni-docs/blob/main/how-to-guides/use-kubectl-with-omni.md This command demonstrates how to access a Kubernetes cluster managed by Omni using kubectl. It requires a downloaded kubeconfig file and the OIDC plugin to be installed. The first execution will prompt for browser-based authentication. ```bash kubectl --kubeconfig ./talos-default-kubeconfig.yaml get nodes ``` -------------------------------- ### Build Omni Hetzner Image with Packer Source: https://github.com/siderolabs/omni-docs/blob/main/how-to-guides/registering-machines/register-a-hetzner-server.md Uses HashiCorp Packer to provision a Hetzner Cloud server with the Omni installation media. This script defines the hcloud plugin, configures the source server, and executes a shell command to write the raw image to the disk. ```hcl packer { required_plugins { hcloud = { version = ">= 1.0.0" source = "github.com/hashicorp/hcloud" } } } locals { image = "" } source "hcloud" "talos" { rescue = "linux64" image = "debian-11" location = "hel1" server_type = "cx11" ssh_username = "root" snapshot_name = "Omni Image" } build { sources = ["source.hcloud.talos"] provisioner "file" { source = "${local.image}" destination = "/tmp/talos.raw.xz" } provisioner "shell" { inline = [ "xz -d -c /tmp/talos.raw.xz | dd of=/dev/sda && sync", ] } } ``` -------------------------------- ### Generate and Install Zsh Autocompletion Source: https://github.com/siderolabs/omni-docs/blob/main/reference/cli.md Commands to enable zsh completion and persist the generated script to the user's fpath. ```zsh echo "autoload -U compinit; compinit" >> ~/.zshrc source <(omnictl completion zsh) omnictl completion zsh > "${fpath[1]}/_omnictl" omnictl completion zsh > $(brew --prefix)/share/zsh/site-functions/_omnictl ``` -------------------------------- ### Generate and Install PowerShell Autocompletion Source: https://github.com/siderolabs/omni-docs/blob/main/reference/cli.md Commands to generate and invoke powershell completion scripts within the current session. ```powershell omnictl completion powershell | Out-String | Invoke-Expression ``` -------------------------------- ### Generate and Install Bash Autocompletion Source: https://github.com/siderolabs/omni-docs/blob/main/reference/cli.md Commands to generate bash completion scripts and persist them for future shell sessions on Linux and macOS. ```bash source <(omnictl completion bash) omnictl completion bash > /etc/bash_completion.d/omnictl omnictl completion bash > $(brew --prefix)/etc/bash_completion.d/omnictl ``` -------------------------------- ### Initialize and Build Packer Image Source: https://github.com/siderolabs/omni-docs/blob/main/how-to-guides/registering-machines/register-a-hetzner-server.md Commands to authenticate with Hetzner Cloud, initialize the Packer plugins, and execute the build process to generate the image ID. ```bash export HCLOUD_TOKEN=${TOKEN} packer init . packer build . ``` -------------------------------- ### Configure and Run Omni Provider Source: https://github.com/siderolabs/omni-docs/blob/main/tutorials/setting-up-the-bare-metal-infrastructure-provider.md Sets the necessary environment variables for the Omni endpoint and service account, then executes the provider container using host networking for network-level services like TFTP and DHCP. ```bash export OMNI_ENDPOINT=https://my-instance.omni.siderolabs.io export OMNI_SERVICE_ACCOUNT_KEY=eyJu...LS0ifQ== docker run -d --name=omni-bare-metal-infra-provider \ --restart=always \ --network host \ -e OMNI_ENDPOINT \ -e OMNI_SERVICE_ACCOUNT_KEY \ ghcr.io/siderolabs/omni-infra-provider-bare-metal:v0.1.0 \ --api-advertise-address=172.16.0.42 ``` -------------------------------- ### Configure Omni for UIIE SAML Authentication (Bash) Source: https://github.com/siderolabs/omni-docs/blob/main/how-to-guides/using-saml-with-omni/configure-unifi-identity-enterprise-for-omni.md This snippet demonstrates how to launch the Omni Docker container with flags to enable SAML authentication using UIIE as the identity provider. It includes mounting the UIIE metadata XML file and specifying its path within the container. Ensure the 'uiieIDPmetadata.xml' file is present in the current directory. ```bash docker run \ ... \ -v $PWD/uiieIDPmetadata.xml:/uiieIDPmetadata.xml \ ... \ ghcr.io/siderolabs/omni:latest \ --auth-saml-enabled=true \ --auth-saml-metadata-/uiieIDPmetadata.xml ``` -------------------------------- ### Deploy Omni On-Premises via Docker Source: https://context7.com/siderolabs/omni-docs/llms.txt Instructions for setting up an on-premises Omni instance using Docker Compose, including environment variable configuration, GPG key generation for etcd encryption, and service deployment. ```bash export OMNI_VERSION=0.41.0 export OMNI_ACCOUNT_UUID=$(uuidgen) export OMNI_DOMAIN_NAME=omni.example.com export OMNI_WG_IP=10.10.1.100 export OMNI_ADMIN_EMAIL=admin@example.com export AUTH0_CLIENT_ID=your-client-id export AUTH0_DOMAIN=your-domain.auth0.com gpg --quick-generate-key "Omni (etcd encryption) omni@example.com" rsa4096 cert never gpg --quick-add-key rsa4096 encr never gpg --export-secret-key --armor omni@example.com > omni.asc curl https://raw.githubusercontent.com/siderolabs/omni/v${OMNI_VERSION}/deploy/env.template | envsubst > omni.env curl https://raw.githubusercontent.com/siderolabs/omni/v${OMNI_VERSION}/deploy/compose.yaml -o compose.yaml docker compose --env-file omni.env up -d ``` -------------------------------- ### Monitor Provider Status and Logs Source: https://github.com/siderolabs/omni-docs/blob/main/tutorials/setting-up-the-bare-metal-infrastructure-provider.md Commands to verify that the provider container is running and to stream its operational logs for troubleshooting or verification of startup components. ```bash docker ps | grep omni-bare-metal-infra-provider docker logs -f omni-bare-metal-infra-provider ``` -------------------------------- ### Create Hetzner Server via CLI Source: https://github.com/siderolabs/omni-docs/blob/main/how-to-guides/registering-machines/register-a-hetzner-server.md Commands to set the Hetzner CLI context and provision a new server instance using the previously generated image ID. ```bash hcloud context create talos hcloud server create --name omni-talos-1 \ --image \ --type cx21 --location ``` -------------------------------- ### SSH Config for Automatic Port Forwarding Source: https://github.com/siderolabs/omni-docs/blob/main/how-to-guides/use-kubectl-with-omni.md Configure your SSH client to automatically forward specific ports when connecting to a host. This simplifies repeated connections by automating the tunnel setup. ```sshconfig Host myhost LocalForward 8000 127.0.0.1:8000 LocalForward 18000 127.0.0.1:18000 ``` -------------------------------- ### Configure Cluster Template for Restoration Source: https://github.com/siderolabs/omni-docs/blob/main/how-to-guides/restore-etcd-of-a-cluster-managed-by-cluster-templates.md Example YAML configuration for a cluster template, including the bootstrapSpec required to point the cluster to a specific snapshot and UUID. ```yaml kind: Cluster name: my-cluster kubernetes: version: v1.28.2 talos: version: v1.5.5 --- kind: ControlPlane machines: - 430d882a-51a8-48b3-ae00-90c5b0b5b0b0 - e865efbc-25a1-4436-bcd9-0a431554e328 - 820c2b44-568c-461e-91aa-c2fc228c0b2e bootstrapSpec: clusterUUID: bb874758-ee54-4d3b-bac3-4c8349737298 snapshot: FFFFFFFF9A99FBFD.snapshot --- kind: Workers machines: - 18308f52-b833-4376-a7c8-1cb9de2feafd - 79f8db4d-3b6b-49a7-8ac4-aa5d2287f706 ``` -------------------------------- ### Create Bare-Metal Infra Provider using omnictl Source: https://github.com/siderolabs/omni-docs/blob/main/tutorials/setting-up-the-bare-metal-infrastructure-provider.md Creates a new infrastructure provider service account named 'bare-metal' for your Omni instance using the `omnictl` command-line tool. This command outputs the OMNI_ENDPOINT and OMNI_SERVICE_ACCOUNT_KEY, which are essential for configuring the provider service. Ensure you store these credentials securely. ```bash omnictl infraprovider create bare-metal ``` -------------------------------- ### Configure Matchbox Profile for Omni PXE Boot Source: https://github.com/siderolabs/omni-docs/blob/main/how-to-guides/registering-machines/register-a-bare-metal-machine-pxe-ipxe.md Defines the Matchbox profile configuration for booting Talos Linux. It specifies the kernel, initrd, and required kernel arguments including Siderolink and logging endpoints. ```json { "id": "default", "name": "default", "boot": { "kernel": "/assets/vmlinuz", "initrd": ["/assets/initramfs.xz"], "args": [ "initrd=initramfs.xz", "init_on_alloc=1", "slab_nomerge", "pti=on", "console=tty0", "console=ttyS0", "printk.devkmsg=on", "talos.platform=metal", "siderolink.api=", "talos.events.sink=", "talos.logging.kernel=" ] } } ``` -------------------------------- ### Create S3 Bucket Source: https://github.com/siderolabs/omni-docs/blob/main/how-to-guides/registering-machines/how-to-register-an-aws-ec2-instance.md Creates a new private S3 bucket in a specified AWS region. This bucket will be used to store the Omni installation media. Requires the AWS CLI. ```bash REGION="us-west-2" aws s3api create-bucket \ --bucket \ --create-bucket-configuration LocationConstraint=$REGION \ --acl private ``` -------------------------------- ### Verify Machine Labels with OmniCTL (Bash) Source: https://github.com/siderolabs/omni-docs/blob/main/how-to-guides/how-to-set-initial-machine-labels.md Verify the labels applied to a machine after it boots from the generated media or PXE URL. These commands use the `omnictl` CLI tool to retrieve machine label or status information. ```bash omnictl get machinelabels -oyaml ``` ```bash omnictl get machinestatus -oyaml ``` -------------------------------- ### Copy AMI Image to S3 Source: https://github.com/siderolabs/omni-docs/blob/main/how-to-guides/registering-machines/how-to-register-an-aws-ec2-instance.md Copies the extracted Omni installation image file ('disk.raw') to a specified S3 bucket. This prepares the image for import into AWS as an EC2 instance. Requires the AWS CLI. ```bash aws s3 cp disk.raw s3:///omni-aws.raw ``` -------------------------------- ### Audit Log Entry JSON Structure Source: https://github.com/siderolabs/omni-docs/blob/main/how-to-guides/using-audit-log.md An example of a single audit log entry in JSON format. It demonstrates the structure of an event, including the event type, resource type, timestamp, and nested event data containing cluster and session information. ```json { "event_type": "create", "resource_type": "Clusters.omni.sidero.dev", "event_ts": 1723466435280, "event_data": { "cluster": { "id": "talos-default", "features": {}, "kubernetes_version": "1.30.1", "talos_version": "1.7.4" }, "session": { "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36", "ip_address": "", "user_id": "fa02ea7c-6eb1-491e-b053-b5db63a4384f", "role": "Admin", "email": "dmitry.matrenichev@siderolabs.com", "fingerprint": "0263efb13f3b5016507ec11ba71a96f5fced3a4d" } } } ``` -------------------------------- ### Expose Kubernetes Services with Omni Source: https://context7.com/siderolabs/omni-docs/llms.txt Demonstrates how to expose internal services using Kubernetes Deployment and Service manifests with specific Omni annotations, followed by CLI commands to apply and verify the configuration. ```yaml apiVersion: apps/v1 kind: Deployment metadata: name: my-app namespace: default spec: selector: matchLabels: app: my-app template: metadata: labels: app: my-app spec: containers: - name: my-app image: nginx:stable-alpine-slim --- apiVersion: v1 kind: Service metadata: name: my-app namespace: default annotations: omni-kube-service-exposer.sidero.dev/port: "50080" omni-kube-service-exposer.sidero.dev/label: My Application omni-kube-service-exposer.sidero.dev/prefix: myapp spec: selector: app: my-app ports: - name: http port: 80 targetPort: 80 ``` ```bash kubectl apply -f nginx-exposed.yaml omnictl get exposedservices ``` -------------------------------- ### Manage Machine Classes for Cluster Templates Source: https://context7.com/siderolabs/omni-docs/llms.txt Defines and applies machine classes, which specify rules for dynamically selecting machines based on labels and attributes for use in cluster templates. It includes an example of a machine class definition and how to use machine classes within a cluster template for dynamic scaling. ```yaml # machine-class.yaml metadata: namespace: default type: MachineClasses.omni.sidero.dev id: high-memory-workers spec: matchlabels: # Match AMD64 machines with >2 CPUs and >8GB RAM - omni.sidero.dev/arch = amd64, omni.sidero.dev/cpus > 2, omni.sidero.dev/mem > 8192 ``` ```bash # Create machine class omnictl apply -f machine-class.yaml # Use in cluster template with machine classes cat < cluster-with-classes.yaml kind: Cluster name: auto-scaling-cluster kubernetes: version: v1.28.0 talos: version: v1.5.4 --- kind: ControlPlane machineClass: name: control-planes size: 3 --- kind: Workers machineClass: name: high-memory-workers size: unlimited EOF omnictl cluster template sync -f cluster-with-classes.yaml --verbose ``` -------------------------------- ### Create Azure Virtual Machine Instance using CLI Source: https://github.com/siderolabs/omni-docs/blob/main/how-to-guides/registering-machines/register-an-azure-instance.md Creates a new Azure virtual machine instance using a pre-registered image. This command is essential for launching the Omni worker node in Azure. It requires specifying the instance name, the image name, the resource group, administrator username, and importantly, the OS disk size in GB. ```bash az vm create \ --name azure-worker \ --image omni \ -g ResourceGroupName \ --admin-username talos \ --generate-ssh-keys \ --verbose \ --os-disk-size-gb 20 ``` -------------------------------- ### Apply Kubernetes Manifest (Bash) Source: https://github.com/siderolabs/omni-docs/blob/main/how-to-guides/expose-an-http-service-from-a-cluster.md This bash command applies the specified Kubernetes manifest file to the cluster. Ensure you have kubectl configured to communicate with your cluster. ```bash kubectl apply -f nginx.yaml ``` -------------------------------- ### Create Schematic with Image Factory (Bash) Source: https://github.com/siderolabs/omni-docs/blob/main/how-to-guides/how-to-set-initial-machine-labels.md Craft an HTTP POST request to the Image Factory to generate a schematic ID. This requires kernel arguments from your Omni instance and the schematic YAML in the request body. The output is a JSON object containing the schematic ID. ```bash curl -X POST https://factory.talos.dev/schematics \ -H "Content-Type: application/yaml" \ -d ' customization: extraKernelArgs: - siderolink.api=grpc://YOUR_INSTANCE.siderolink.omni.siderolabs.io?grpc_tunnel=true&jointoken=YOUR_JOIN_TOKEN - talos.events.sink=[fdae:41e4:649b:9303::1]:8090 - talos.logging.kernel=tcp://[fdae:41e4:649b:9303::1]:8092 meta: - key: 12 value: | machineLabels: environment: production region: us-west ' ``` -------------------------------- ### Initialize DocSearch with Configuration Source: https://github.com/siderolabs/omni-docs/blob/main/layouts/partials/hooks/body-end.html Initializes the Algolia DocSearch library with specific configuration parameters. This includes the application ID, API key, index name, and the DOM element where the search UI will be rendered. Debug mode is enabled for development purposes. ```javascript docsearch({ appId: "9GITGPCW9T", apiKey: "8faed1cb78e06938b75c59fe20d65f67", indexName: "omni-docs", container: '#docsearch', debug: true }); ``` -------------------------------- ### Troubleshoot Machine Logs and Support Bundles Source: https://context7.com/siderolabs/omni-docs/llms.txt Utilizes the omnictl CLI to retrieve machine logs, stream them in real-time, format output, and generate cluster-wide support bundles for debugging. ```bash omnictl machine-logs 27c16241-96bf-4f17-9579-ea3a6c4a3ca8 omnictl machine-logs 27c16241-96bf-4f17-9579-ea3a6c4a3ca8 --follow omnictl machine-logs 27c16241-96bf-4f17-9579-ea3a6c4a3ca8 --tail 100 --log-format dmesg omnictl support --cluster my-cluster --output my-cluster-support.zip --verbose ``` -------------------------------- ### Create EC2 Instances from AMI using AWS CLI Source: https://github.com/siderolabs/omni-docs/blob/main/how-to-guides/registering-machines/how-to-register-an-aws-ec2-instance.md Launches new EC2 instances from a specified AMI. This command requires the AWS region, the AMI ID, instance count, instance type, subnet ID, security group ID, and optionally allows public IP association and spot instance market options. It also supports tagging instances. ```bash aws ec2 run-instances \ --region $REGION \ --image-id ami-07961b424e87e827f \ --count 1 \ --instance-type t3.small \ --subnet-id subnet-0a7f5f87f62c301ea \ --security-group-ids $SECURITY_GROUP \ --associate-public-ip-address \ --tag-specifications "ResourceType=instance,Tags=[{Key=Name,Value=omni-aws-ami}]" \ --instance-market-options '{"MarketType":"spot"}' ```