### Bootstrap Nix and direnv Source: https://github.com/holos-run/holos/blob/main/nix/README.md Installs Nix and direnv, then guides through shell setup. Remove the -n flag to execute commands. ```bash make -n -f nix/nix.mk bootstrap ``` -------------------------------- ### Start Local Development Server Source: https://github.com/holos-run/holos/blob/main/doc/website/README.md Starts a local development server for live previewing changes. Changes are reflected live without server restarts. ```shell npm run start ``` -------------------------------- ### Configuring Readiness Probe Source: https://github.com/holos-run/holos/blob/main/cmd/holos/tests/v1alpha5/guides/helm.txt Example of configuring a readiness probe for a service. Similar to the liveness probe, this defines an HTTP GET request to determine if the application is ready to serve traffic, including path, port, initial delay, and timeout. ```yaml readiness: enabled: true probe: httpGet: path: /-/ready port: 9091 initialDelaySeconds: 10 timeoutSeconds: 10 ``` -------------------------------- ### Install Holos with Go Source: https://github.com/holos-run/holos/blob/main/doc/md/tutorial/setup.mdx Use this command to install Holos on systems with Go installed. ```bash go install github.com/holos-run/holos/cmd/holos@latest ``` -------------------------------- ### Holos Version Output Source: https://github.com/holos-run/holos/blob/main/doc/md/tutorial/hello-holos.mdx Example output from the `holos version` command, showing the installed Holos version. ```txt holos version v0.1.0 ``` -------------------------------- ### mkdir-and-init.sh Script Source: https://github.com/holos-run/holos/blob/main/doc/website/versioned_docs/version-v1alpha5/tutorial/_hello-holos/examples/02-hello-holos.txt Creates the tutorial directory, changes into it, and initializes the Holos platform. This script automates the initial setup steps. ```bash mkdir holos-tutorial && cd holos-tutorial holos init platform v1alpha5 ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/holos-run/holos/blob/main/doc/website/README.md Installs all necessary project dependencies using npm. ```shell npm install ``` -------------------------------- ### Install Helm Chart Source: https://github.com/holos-run/holos/blob/main/cmd/holos/tests/v1alpha5/guides/helm.txt Use this command to install a Helm chart. Replace [RELEASE_NAME] with your desired release name. ```console helm install [RELEASE_NAME] prometheus-community/prometheus-blackbox-exporter ``` -------------------------------- ### Configuring HTTP Startup Probe Source: https://github.com/holos-run/holos/blob/main/cmd/holos/tests/v1alpha5/guides/helm.txt Sets up an HTTP GET startup probe with configurable path, port, scheme, and headers. ```go-template httpGet: path: {{ .Values.server.prefixURL }}/-/healthy port: 9090 scheme: {{ .Values.server.probeScheme }} {{- if .Values.server.probeHeaders }} httpHeaders: {{- range .Values.server.probeHeaders}} - name: {{ .name }} value: {{ .value }} {{- end }} {{- end }} ``` -------------------------------- ### Example: Holos Compile Usage Source: https://github.com/holos-run/holos/blob/main/internal/cli/compile.txt This example demonstrates how to pipe output from 'holos show platform' through 'jq' to select components and then feed them into 'holos compile'. Note that platform components are embedded within a 'component' field for type metadata. ```bash holos show platform --format=json \ | jq '.spec.components[] | {kind: "Component", apiVersion: "v1alpha6", component: .}' \ | holos compile --log-level=debug ``` -------------------------------- ### Install Holos using Homebrew Source: https://github.com/holos-run/holos/blob/main/README.md Installs the Holos CLI using the Homebrew package manager. Ensure Homebrew is installed before running this command. ```shell brew install holos-run/tap/holos ``` -------------------------------- ### Install kube-state-metrics Helm Chart Source: https://github.com/holos-run/holos/blob/main/cmd/holos/tests/v1alpha5/guides/helm.txt Installs the kube-state-metrics Helm chart for a given release name. Replace [RELEASE_NAME] with your desired name and add any necessary flags. ```console helm install [RELEASE_NAME] prometheus-community/kube-state-metrics [flags] ``` -------------------------------- ### Create Example Component Directory Source: https://github.com/holos-run/holos/blob/main/doc/md/common/example-component.mdx Creates a directory named 'podinfo' within the 'components' folder. This is a prerequisite for the component's configuration. ```bash mkdir -p components/podinfo ``` -------------------------------- ### Configuring HTTP Readiness Probe Source: https://github.com/holos-run/holos/blob/main/cmd/holos/tests/v1alpha5/guides/helm.txt Sets up an HTTP GET readiness probe with configurable path, port, scheme, and headers. ```go-template httpGet: path: {{ .Values.server.prefixURL }}/-/ready port: 9090 scheme: {{ .Values.server.probeScheme }} {{- with .Values.server.probeHeaders }} httpHeaders: {{- toYaml . | nindent 14 }} {{- end }} ``` -------------------------------- ### BuildContext Example in CUE Source: https://github.com/holos-run/holos/blob/main/doc/md/api/core.md Illustrates how to use BuildContext within a CUE build plan to define artifacts and transformations. ```cue package holos import ( "encoding/json" "github.com/holos-run/holos/api/core/v1alpha6:core" ) _BuildContextJSON: string | *"{}" @tag(holos_build_context, type=string) BuildContext: core.#BuildContext & json.Unmarshal(_BuildContextJSON) holos: core.#BuildPlan & { buildContext: BuildContext "spec": { "artifacts": [ { artifact: "components/slice" "transformers": [ { "kind": "Command" "inputs": ["resources.gen.yaml"] "output": artifact "command": { "args": [ "kubectl-slice", "-f", "\(buildContext.tempDir)/resources.gen.yaml", "-o", "\(buildContext.tempDir)/\(artifact)", ] } } ] } ] } } ``` -------------------------------- ### Expected Output Source: https://github.com/holos-run/holos/blob/main/doc/md/tutorial/_hello-holos/examples/01-holos-version.txt The `output.txt` file contains the expected version string of the Holos installation. ```text 0.106.0 ``` -------------------------------- ### Generate Platform Structure Source: https://github.com/holos-run/holos/blob/main/cmd/holos/tests/v1alpha5/guides/helm.txt Initializes the project directory structure for a Holos platform. Use this command in an empty directory to start. ```bash cd $WORK exec holos generate platform v1alpha5 --force ``` -------------------------------- ### Initialize Holos Platform Source: https://github.com/holos-run/holos/blob/main/doc/md/topics/structures/environments.mdx Generates a minimal platform structure for Holos. Use this command to start a new Holos project. ```shell mkdir holos-environments-tutorial && cd holos-environments-tutorial holos init platform v1alpha5 ``` -------------------------------- ### Show Kube-State-Metrics Chart Values Source: https://github.com/holos-run/holos/blob/main/cmd/holos/tests/v1alpha5/guides/helm.txt Use this command to inspect all configurable options for the kube-state-metrics Helm chart before installation. ```console helm show values prometheus-community/kube-state-metrics ``` -------------------------------- ### Show Helm Chart Values Source: https://github.com/holos-run/holos/blob/main/cmd/holos/tests/v1alpha5/guides/helm.txt Use this command to inspect all configurable options for a Helm chart before installation. ```console helm show values prometheus-community/alertmanager ``` -------------------------------- ### Configuring HTTP Liveness Probe Source: https://github.com/holos-run/holos/blob/main/cmd/holos/tests/v1alpha5/guides/helm.txt Sets up an HTTP GET liveness probe with configurable path, port, scheme, and headers. ```go-template httpGet: path: {{ .Values.server.prefixURL }}/-/healthy port: 9090 scheme: {{ .Values.server.probeScheme }} {{- with .Values.server.probeHeaders }} httpHeaders: {{- toYaml . | nindent 14 }} {{- end }} ``` -------------------------------- ### Create and Initialize Tutorial Directory Script Source: https://github.com/holos-run/holos/blob/main/doc/website/versioned_docs/version-v1alpha5/tutorial/_helm-values/examples/02-helm-values.txt A script to create a tutorial directory and initialize a Holos project within it. ```bash #! /bin/bash mkdir holos-helm-values-tutorial cd holos-helm-values-tutorial holos init platform v1alpha5 ``` -------------------------------- ### Holos Usage Commands Source: https://github.com/holos-run/holos/blob/main/CLAUDE.md Commands for rendering, inspecting, and initializing Holos platforms and components. Ensure 'make install' is run first. ```bash # Usage (run 'make install' first to test code changes) holos render platform # Render entire platform holos render component # Render single component holos show buildplans # Show build plans holos init platform # Initialize new platform ``` -------------------------------- ### Add Alert Relabel Configs Source: https://github.com/holos-run/holos/blob/main/cmd/holos/tests/v1alpha5/guides/helm.txt Example of adding alert relabel configurations to prevent duplicate alerts in Alertmanager, useful for high-availability Prometheus setups. ```yaml alertRelabelConfigs: {} # alert_relabel_configs: # - source_labels: [dc] # regex: (.+)\d+ # target_label: dc ``` -------------------------------- ### Initialize Holos Platform Source: https://github.com/holos-run/holos/blob/main/doc/md/tutorial/_kustomize/examples/02-kustomize.txt Creates and changes to the tutorial directory, then initializes the Holos platform using a script. ```bash exec bash -c 'bash -euo pipefail $WORK/mkdir-and-init.sh' cd holos-kustomize-tutorial ``` -------------------------------- ### Get Holos CLI Version using 'version' command Source: https://github.com/holos-run/holos/blob/main/cmd/holos/tests/cli/first-impression.txt Alternatively, the `version` subcommand can be used to retrieve the Holos CLI version. This provides another way to confirm the installed version. ```bash exec holos version ``` ```regex stdout \d+\.\d+\.\d+ ``` -------------------------------- ### Initialize Holos Platform Source: https://github.com/holos-run/holos/blob/main/doc/md/tutorial/_helm-values/examples/02-helm-values.txt Removes an existing tutorial directory and then creates and changes into a new one, initializing the Holos platform. ```bash # Remove the tutorial directory if it already exists exec rm -rf holos-helm-values-tutorial # Create and change to the tutorial directory, and then initialize the Holos platform exec bash -c 'bash -euo pipefail mkdir-and-init.sh' cd holos-helm-values-tutorial ``` -------------------------------- ### Configuring Liveness Probe Source: https://github.com/holos-run/holos/blob/main/cmd/holos/tests/v1alpha5/guides/helm.txt Example of configuring a liveness probe for a service. This snippet defines an HTTP GET request to check the health of the application at a specific path and port, with initial delay and timeout settings. ```yaml liveness: enabled: true probe: httpGet: path: /-/healthy port: 9091 initialDelaySeconds: 10 timeoutSeconds: 10 ``` -------------------------------- ### Create Directory and Initialize Holos Platform Source: https://github.com/holos-run/holos/blob/main/doc/md/tutorial/_kustomize/examples/02-kustomize.txt Creates a directory named 'holos-kustomize-tutorial', changes into it, and initializes a Holos platform. ```bash mkdir holos-kustomize-tutorial cd holos-kustomize-tutorial holos init platform v1alpha5 ``` -------------------------------- ### Create httpbin Component Source: https://github.com/holos-run/holos/blob/main/doc/md/tutorial/kustomize.mdx Sets up the httpbin component directory and its configuration files (httpbin.cue and httpbin.yaml). The .cue file defines Kustomize configurations. ```bash mkdir -p components/httpbin touch components/httpbin/httpbin.cue components/httpbin/httpbin.yaml ``` ```bash # components/httpbin/httpbin.cue ``` ```cue package httpbin import ( "github.com/holos-dev/holos/pkg/base" "github.com/holos-dev/holos/pkg/base/kustomize" ) #KustomizeConfig: kustomize.KustomizeConfig { Files: "httpbin.yaml": base.FileSpec {} } ``` ```bash # components/httpbin/httpbin.yaml ``` ```yaml apiVersion: "v1" kind: "ConfigMap" metadata: name: "httpbin-config" data: # Configuration data for httpbin httpbin.conf: | PORT=80 LOG_LEVEL=info ``` -------------------------------- ### Setup Local Root CA and Cert-Manager Secret Source: https://github.com/holos-run/holos/blob/main/doc/md/topics/local-cluster.mdx This script installs a local root CA using `mkcert`, creates a Kubernetes secret containing the CA certificate and key, and applies it to the `cert-manager` namespace. It also creates the `cert-manager` namespace if it doesn't exist. Ensure this script is run each time the workload cluster is created. ```bash #! /bin/bash # set -euo pipefail mkcert --install tmpdir="$(mktemp -d)" finish() { [[ -d "$tmpdir" ]] && rm -rf "$tmpdir" } trap finish EXIT cd "$tmpdir" # Create the local CA Secret with ca.crt, tls.crt, tls.key mkdir local-ca cd local-ca CAROOT="$(mkcert -CAROOT)" cp -p "${CAROOT}/rootCA.pem" ca.crt cp -p "${CAROOT}/rootCA.pem" tls.crt cp -p "${CAROOT}/rootCA-key.pem" tls.key kubectl create secret generic --from-file=. --dry-run=client -o yaml local-ca > ../local-ca.yaml echo 'type: kubernetes.io/tls' >> ../local-ca.yaml cd .. cat < namespace.yaml apiVersion: v1 kind: Namespace metadata: labels: kubernetes.io/metadata.name: cert-manager name: cert-manager spec: finalizers: - kubernetes EOF kubectl apply --server-side=true -f namespace.yaml kubectl apply -n cert-manager --server-side=true -f local-ca.yaml # Save the Secret to easily reset the cluster later. install -m 0644 namespace.yaml "${CAROOT}/namespace.yaml" install -m 0600 local-ca.yaml "${CAROOT}/local-ca.yaml" ``` -------------------------------- ### Initialize Git Repository Source: https://github.com/holos-run/holos/blob/main/doc/website/versioned_docs/version-v1alpha5/tutorial/_kustomize/examples/02-kustomize.txt Initializes a Git repository within the tutorial directory. ```bash # Initialize git exec bash -c 'bash -euo pipefail $WORK/git-init.sh' ``` -------------------------------- ### Initialize Holos Platform Source: https://github.com/holos-run/holos/blob/main/doc/md/tutorial/_hello-holos/examples/02-hello-holos.txt Initializes the Holos platform within a new tutorial directory. Requires the `mkdir-and-init.sh` script. ```bash env HOME=$WORK/.tmp chmod 0755 $WORK/update.sh exec git config --global user.name 'Holos Docs' exec git config --global user.email 'hello@holos.run' exec git config --global init.defaultBranch main exec rm -rf holos-tutorial exec bash -c 'bash -euo pipefail $WORK/mkdir-and-init.sh' cd holos-tutorial ``` ```bash #! /bin/bash set -euo pipefail mkdir holos-tutorial && cd holos-tutorial holos init platform v1alpha5 ``` -------------------------------- ### Platform Spec YAML Example Source: https://github.com/holos-run/holos/blob/main/cmd/holos/tests/v1alpha5/guides/helm.txt An example of a Kubernetes Platform specification in YAML format. ```yaml kind: Platform apiVersion: v1alpha5 metadata: name: default spec: components: [] ``` -------------------------------- ### Initialize Git and Holos Environment Source: https://github.com/holos-run/holos/blob/main/doc/website/versioned_docs/version-v1alpha5/tutorial/_hello-holos/examples/02-hello-holos.txt Sets up the HOME directory, configures Git user information, and initializes the Holos platform in a new tutorial directory. This is a prerequisite for running Holos commands. ```bash env HOME=$WORK/.tmp chmod 0755 $WORK/update.sh exec git config --global user.name 'Holos Docs' exec git config --global user.email 'hello@holos.run' exec git config --global init.defaultBranch main exec rm -rf holos-tutorial exec bash -c 'bash -euo pipefail $WORK/mkdir-and-init.sh' cd holos-tutorial ``` -------------------------------- ### Git Init and Create Component Directories Source: https://github.com/holos-run/holos/blob/main/doc/md/tutorial/_helm-values/examples/02-helm-values.txt Initializes a Git repository and creates necessary component directories using provided scripts. ```bash # Git init and create the component directories exec bash -c 'bash -euo pipefail $WORK/git-init.sh' exec bash -c 'bash -euo pipefail $WORK/mkdir-components.sh' ``` -------------------------------- ### Install Prometheus Helm Chart Source: https://github.com/holos-run/holos/blob/main/cmd/holos/tests/v1alpha5/guides/helm.txt Installs the Prometheus Helm chart on a Kubernetes cluster. Requires Helm 3.7+. ```console helm install [RELEASE_NAME] prometheus-community/prometheus ``` -------------------------------- ### Check Holos Version Source: https://github.com/holos-run/holos/blob/main/doc/md/tutorial/kustomize.mdx Ensure you have a compatible version of Holos installed. This command displays the currently installed version. ```bash holos version ``` ```txt v0.0.1 ``` -------------------------------- ### Initialize Holos Project Source: https://github.com/holos-run/holos/blob/main/doc/md/tutorial/_helm-values/examples/02-helm-values.txt Creates a new Holos project directory and initializes it with a specified platform version. ```bash mkdir holos-helm-values-tutorial cd holos-helm-values-tutorial holos init platform v1alpha5 ``` -------------------------------- ### Install a Helm Chart Source: https://github.com/holos-run/holos/blob/main/cmd/holos/tests/v1alpha5/guides/helm.txt Installs a specified Helm chart into the Kubernetes cluster. Replace [RELEASE_NAME] with a unique name for the deployment. ```console helm install [RELEASE_NAME] prometheus-community/prometheus-pushgateway ``` -------------------------------- ### Install a Helm Chart Source: https://github.com/holos-run/holos/blob/main/cmd/holos/tests/v1alpha5/guides/helm.txt Install a specified Helm chart into your Kubernetes cluster. Replace `[RELEASE_NAME]` with a unique name for this deployment. ```console helm install [RELEASE_NAME] prometheus-community/prometheus-node-exporter ``` -------------------------------- ### Create Podinfo Component Source: https://github.com/holos-run/holos/blob/main/doc/md/tutorial/hello-holos.mdx Set up the 'podinfo' component by creating necessary directories and defining its configuration in CUE. This involves creating a component header and body. ```bash #!/bin/bash # Create the components directory if it doesn't exist mkdir -p components cd components # Create the podinfo component directory mkdir podinfo cd podinfo # Create the component header file (if applicable, though this example uses a direct CUE file) echo "# Podinfo Component Configuration" > podinfo.cue ``` ```cue # Helm component helm: # Component name name: "podinfo" # Component version version: "6.0.9" # Component repository repo: "https://stefanprodan.github.io/podinfo" ``` ```bash #!/bin/bash # This script is a placeholder for end-of-file content, if any. # In this context, it signifies the end of the component creation script. # Navigate back to the root directory cd ../.. ``` -------------------------------- ### Check Holos Installation Version Source: https://github.com/holos-run/holos/blob/main/doc/md/tutorial/helm-values.mdx Verify that you have a recent version of the Holos CLI installed. This document was tested with the version shown. ```bash #!/bin/bash # This script checks the installed version of holos. # It's useful for ensuring compatibility with documentation examples. # Execute the holos version command and print the output. if command -v holos &> /dev/null then holos --version else echo "holos command not found. Please ensure holos is installed and in your PATH." fi ``` ```txt holos version 0.1.0 ``` -------------------------------- ### Create Holos Platform Directory Source: https://github.com/holos-run/holos/blob/main/doc/md/topics/gitops/flux-kustomization.mdx Use 'holos' to initialize a new platform configuration directory. ```bash mkdir holos-flux-kustomization && cd holos-flux-kustomization ``` ```bash holos init platform v1alpha5 ``` -------------------------------- ### CUE Component Definition Example Source: https://github.com/holos-run/holos/blob/main/CLAUDE.md Example of defining a Helm component using CUE, specifying its name and chart details. ```cue package holos holos: Component.BuildPlan Component: #Helm & { Name: "example" Chart: { version: "1.0.0" repository: { name: "example" url: "https://charts.example.com" } } } ``` -------------------------------- ### Initialize Platform with Holos Source: https://github.com/holos-run/holos/blob/main/doc/md/topics/gitops/argocd-application.mdx Initialize the platform using the holos init command. ```shell holos init platform v1alpha5 ``` -------------------------------- ### Initialize Holos Project for OCI Helm Charts Source: https://github.com/holos-run/holos/blob/main/doc/md/topics/oci-helm-charts.mdx Creates a new directory for OCI Helm chart components and initializes the Holos platform with a specified version. ```bash mkdir -p oci-helm && cd oci-helm holos init platform v1alpha5 ``` -------------------------------- ### Extra Manifests Configuration Example Source: https://github.com/holos-run/holos/blob/main/cmd/holos/tests/v1alpha5/guides/helm.txt Example of how to include extra manifests, such as ConfigMaps, within a Helm chart's `extraManifests` array. ```yaml # Extra manifests to deploy as an array extraManifests: [] # - apiVersion: v1 # kind: ConfigMap # metadata: # labels: # name: prometheus-extra # data: ``` -------------------------------- ### Holos Platform Component Definition Source: https://github.com/holos-run/holos/blob/main/cmd/holos/tests/v1alpha5/schemas/validators.txt Defines an example component named 'example' within the Holos platform configuration using CUE. ```cue package holos Platform: Components: example: { name: "example" path: "components/example" } ``` -------------------------------- ### Install Alertmanager Helm Chart Source: https://github.com/holos-run/holos/blob/main/cmd/holos/tests/v1alpha5/guides/helm.txt Installs the Alertmanager Helm chart for a given release name. Refer to the configuration section for customization options. ```console helm install [RELEASE_NAME] prometheus-community/alertmanager ``` -------------------------------- ### Render Platform with httpbin and Verify Output Source: https://github.com/holos-run/holos/blob/main/cmd/holos/tests/v1alpha5/guides/helm.txt Render the platform configuration again after enabling httpbin and verify the output. This includes checking for specific rendered output and comparing generated YAML with expected output. ```bash exec holos render platform ./platform stderr -count=1 '^rendered httpbin' exec holos compare yaml deploy/components/httpbin/httpbin.gen.yaml want/1.httpbin.gen.yaml ``` -------------------------------- ### ExternalSecret Manifest Example Source: https://github.com/holos-run/holos/blob/main/doc/website/versioned_docs/version-v1alpha5/tutorial/cue.mdx This is an example of an ExternalSecret manifest that can be mixed into a component like podinfo. It specifies how to fetch secrets from an external provider and refresh them. ```diff diff --git a/deploy/components/podinfo/podinfo.gen.yaml b/deploy/components/podinfo/podinfo.gen.yaml index 6e4aec0..f79e9d0 100644 --- a/deploy/components/podinfo/podinfo.gen.yaml +++ b/deploy/components/podinfo/podinfo.gen.yaml @@ -112,3 +112,19 @@ spec: volumes: - emptyDir: {} name: data +--- +apiVersion: external-secrets.io/v1beta1 +kind: ExternalSecret +metadata: + name: podinfo + namespace: default spec: dataFrom: - extract: key: podinfo refreshInterval: 30s secretStoreRef: kind: SecretStore name: default target: name: podinfo ``` -------------------------------- ### Initialize Holos Platform Source: https://github.com/holos-run/holos/blob/main/doc/website/versioned_docs/version-v1alpha5/tutorial/kustomize.mdx Generate a minimal platform directory structure using `holos init platform`. This is a prerequisite for managing components. ```bash mkdir my-platform cd my-platform holos init platform ``` -------------------------------- ### Check Holos CLI Version Source: https://github.com/holos-run/holos/blob/main/cmd/holos/tests/cli/first-impression.txt Use the `--version` flag to display the installed version of the Holos CLI. This is useful for verifying installation and compatibility. ```bash exec holos --version ``` ```regex stdout \d+\.\d+\.\d+ ``` -------------------------------- ### Example Environments Data Structure Source: https://github.com/holos-run/holos/blob/main/doc/md/topics/structures/environments.mdx An example of the Environments data structure in YAML format, showing different production and non-production environments with their respective details. ```yaml prod-pdx: name: prod-pdx tier: prod jurisdiction: us state: oregon prod-cmh: name: prod-cmh tier: prod jurisdiction: us state: ohio prod-ams: name: prod-ams tier: prod jurisdiction: eu state: netherlands dev: name: dev tier: nonprod jurisdiction: us state: oregon test: name: test tier: nonprod jurisdiction: us state: oregon stage: name: stage tier: nonprod jurisdiction: us state: oregon ``` -------------------------------- ### Initialize Holos Platform Source: https://github.com/holos-run/holos/blob/main/doc/md/tutorial/cue.mdx Generates a minimal Holos platform directory structure. Navigate into a blank directory before running. ```shell mkdir holos-cue-tutorial && cd holos-cue-tutorial holos init platform v1alpha5 ``` -------------------------------- ### Register Components Render Output Source: https://github.com/holos-run/holos/blob/main/doc/md/tutorial/helm-values.mdx This is a sample output from rendering the platform after registering components. It shows the expected state. ```txt Platform rendering complete. Components registered: my-component, another-component ``` -------------------------------- ### Install Chart with Multiple Override Files Source: https://github.com/holos-run/holos/blob/main/cmd/holos/tests/v1alpha5/guides/helm.txt Install or upgrade a Helm chart using multiple values override files to manage configurations, such as service-specific alerts. ```console helm install [RELEASE_NAME] prometheus-community/prometheus -f values.yaml -f service1-alert.yaml -f service2-alert.yaml ``` -------------------------------- ### Show BuildPlans Command Source: https://github.com/holos-run/holos/blob/main/doc/md/tutorial/validators.mdx Use the 'holos show buildplans' command to inspect existing BuildPlan configurations. ```bash holos show buildplans ``` -------------------------------- ### Upgrade a Helm Chart Source: https://github.com/holos-run/holos/blob/main/cmd/holos/tests/v1alpha5/guides/helm.txt Upgrade an existing Helm chart release to a new version or configuration. The `--install` flag ensures the chart is installed if it does not already exist. ```console helm upgrade [RELEASE_NAME] prometheus-community/prometheus-node-exporter --install ``` -------------------------------- ### Upgrade a Helm Chart Source: https://github.com/holos-run/holos/blob/main/cmd/holos/tests/v1alpha5/guides/helm.txt Use this command to upgrade an existing Helm release to a new version or configuration. The --install flag ensures the release is installed if it does not exist. ```console helm upgrade [RELEASE_NAME] prometheus-community/prometheus --install ``` -------------------------------- ### Create Minimal Platform Directory Source: https://github.com/holos-run/holos/blob/main/doc/md/topics/gitops/argocd-application.mdx Use holos to generate a minimal platform directory structure. Start by creating a blank directory to hold the platform configuration. ```shell mkdir holos-argocd-application && cd holos-argocd-application ``` -------------------------------- ### ArgoCD Application Manifest Example Source: https://github.com/holos-run/holos/blob/main/doc/md/topics/gitops/argocd-application.mdx This is an example of an ArgoCD Application manifest generated by Holos. It defines the source repository, path, and target revision for deploying the 'podinfo' component. ```yaml apiVersion: argoproj.io/v1alpha1 kind: Application metadata: name: podinfo namespace: argocd spec: destination: server: https://kubernetes.default.svc project: default source: path: deploy/components/podinfo repoURL: https://example.com/example.git targetRevision: main ``` -------------------------------- ### Initialize Git Repository Source: https://github.com/holos-run/holos/blob/main/doc/md/tutorial/_kustomize/examples/02-kustomize.txt Initializes a Git repository using a script. ```bash exec bash -c 'bash -euo pipefail $WORK/git-init.sh' ``` -------------------------------- ### Flux Kustomization Resource Example Source: https://github.com/holos-run/holos/blob/main/doc/md/topics/gitops/flux-kustomization.mdx This is an example of a Flux Kustomization resource generated for a component. It specifies the interval for reconciliation, the path to the component's manifests, and the source repository. ```yaml apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: name: podinfo namespace: default spec: interval: 5m path: deploy/components/podinfo prune: true sourceRef: kind: GitRepository name: webapp timeout: 1m ``` -------------------------------- ### Clean Up Tutorial Directory Source: https://github.com/holos-run/holos/blob/main/doc/md/tutorial/_hello-holos/examples/02-hello-holos.txt Cleans up the tutorial directory and the temporary HOME directory after the tutorial execution. ```bash # Clean up the tutorial directory and tmp $HOME directory cd $WORK exec rm -rf holos-tutorial exec rm -rf $HOME ``` -------------------------------- ### Upgrade Alertmanager Helm Chart Source: https://github.com/holos-run/holos/blob/main/cmd/holos/tests/v1alpha5/guides/helm.txt Upgrades an existing Alertmanager Helm chart release to a new version or chart. The --install flag can be used to install if the release does not exist. ```console helm upgrade [RELEASE_NAME] [CHART] --install ``` -------------------------------- ### Initialize Holos Platform Directory Source: https://github.com/holos-run/holos/blob/main/doc/md/topics/structures/clusters.mdx Use the `holos init platform` command to generate a minimal platform directory structure. This sets up the basic configuration files for your Holos project. ```shell mkdir holos-multiple-clusters && cd holos-multiple-clusters ``` ```shell holos init platform v1alpha5 ``` -------------------------------- ### Prometheus Blackbox Exporter Configuration Example Source: https://github.com/holos-run/holos/blob/main/cmd/holos/tests/v1alpha5/guides/helm.txt Example configuration for Prometheus blackbox exporter within a Helm chart. This defines scrape targets, their URLs, hostnames, labels, and scraping intervals. ```yaml # - name: example # Human readable URL that will appear in Google Managed Prometheus / AlertManager # url: http://example.com/healthz # The URL that blackbox will scrape # hostname: example.com # HTTP probes can accept an additional `hostname` parameter that will set `Host` header and TLS SNI # labels: {} # Map of labels for PodMonitoring. Overrides value set in `defaults` # interval: 60s # Scraping interval. Overrides value set in `defaults` # scrapeTimeout: 60s # Scrape timeout. Overrides value set in `defaults` # module: http_2xx # Module used for scraping. Overrides value set in `defaults` # additionalMetricsRelabels: {} # Map of metric labels and values to add ``` -------------------------------- ### Initialize Holos Platform Source: https://github.com/holos-run/holos/blob/main/cmd/holos/tests/v1alpha5/schemas/kubernetes.txt Initializes the Holos platform with a specific schema version. Use --force to overwrite existing configurations. ```bash exec holos init platform v1alpha5 --force ``` -------------------------------- ### Prometheus Service Accounts and Roles YAML Example Source: https://github.com/holos-run/holos/blob/main/cmd/holos/tests/v1alpha5/guides/helm.txt Example Kubernetes YAML defining ServiceAccounts and a ClusterRole for Prometheus components, including alertmanager, kube-state-metrics, node-exporter, pushgateway, and the Prometheus server itself. ```yaml apiVersion: v1 automountServiceAccountToken: true kind: ServiceAccount metadata: labels: app.kubernetes.io/instance: prometheus app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: alertmanager app.kubernetes.io/version: v0.27.0 helm.sh/chart: alertmanager-1.12.0 name: prometheus-alertmanager namespace: default --- apiVersion: v1 automountServiceAccountToken: true kind: ServiceAccount metadata: labels: app.kubernetes.io/component: metrics app.kubernetes.io/instance: prometheus app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: kube-state-metrics app.kubernetes.io/part-of: kube-state-metrics app.kubernetes.io/version: 2.13.0 helm.sh/chart: kube-state-metrics-5.25.1 name: prometheus-kube-state-metrics namespace: default --- apiVersion: v1 automountServiceAccountToken: false kind: ServiceAccount metadata: labels: app.kubernetes.io/component: metrics app.kubernetes.io/instance: prometheus app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: prometheus-node-exporter app.kubernetes.io/part-of: prometheus-node-exporter app.kubernetes.io/version: 1.8.2 helm.sh/chart: prometheus-node-exporter-4.39.0 name: prometheus-prometheus-node-exporter namespace: default --- apiVersion: v1 automountServiceAccountToken: true kind: ServiceAccount metadata: labels: app.kubernetes.io/instance: prometheus app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: prometheus-pushgateway app.kubernetes.io/version: v1.9.0 helm.sh/chart: prometheus-pushgateway-2.14.0 name: prometheus-prometheus-pushgateway namespace: default --- apiVersion: v1 kind: ServiceAccount metadata: labels: app.kubernetes.io/component: server app.kubernetes.io/instance: prometheus app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: prometheus app.kubernetes.io/part-of: prometheus app.kubernetes.io/version: v2.54.1 helm.sh/chart: prometheus-25.27.0 name: prometheus-server namespace: default --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: labels: app.kubernetes.io/component: metrics app.kubernetes.io/instance: prometheus app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: kube-state-metrics app.kubernetes.io/part-of: kube-state-metrics app.kubernetes.io/version: 2.13.0 helm.sh/chart: kube-state-metrics-5.25.1 name: prometheus-kube-state-metrics rules: - apiGroups: - certificates.k8s.io resources: - certificatesigningrequests verbs: - list - watch - apiGroups: - "" resources: - configmaps verbs: - list - watch - apiGroups: - batch resources: - cronjobs verbs: - list - watch - apiGroups: - extensions - apps resources: - daemonsets verbs: - list - watch - apiGroups: - extensions - apps resources: - deployments verbs: - list - watch - apiGroups: - "" resources: - endpoints verbs: - list - watch - apiGroups: - autoscaling resources: - horizontalpodautoscalers verbs: - list - watch - apiGroups: - extensions - networking.k8s.io resources: - ingresses verbs: - list - watch - apiGroups: - batch resources: - jobs verbs: - list - watch - apiGroups: - coordination.k8s.io resources: - leases verbs: - list - watch - apiGroups: - "" resources: - limitranges verbs: - list - watch - apiGroups: - admissionregistration.k8s.io resources: ``` -------------------------------- ### Enable httpbin Configuration Source: https://github.com/holos-run/holos/blob/main/cmd/holos/tests/v1alpha5/guides/helm.txt Enable the httpbin configuration by renaming the file. ```bash mv platform/httpbin.cue.disabled platform/httpbin.cue ``` -------------------------------- ### Configure DNS for Holos Localhost Source: https://github.com/holos-run/holos/blob/main/doc/md/topics/local-cluster.mdx This script configures dnsmasq and system DNS settings to resolve *.holos.localhost to 127.0.0.1. It installs dnsmasq via Homebrew if not already present and sets up the necessary configuration files and services. Ensure you have Homebrew installed and necessary permissions for system-level changes. ```bash #! /bin/bash # set -euo pipefail tmpdir="$(mktemp -d)" finish() { [[ -d "$tmpdir" ]] && rm -rf "$tmpdir" } trap finish EXIT cd "$tmpdir" brew install dnsmasq cat <"$(brew --prefix)/etc/dnsmasq.d/holos.localhost.conf" # Refer to https://holos.run/docs/tutorial/local/k3d/ address=/holos.localhost/127.0.0.1 EOF if [[ -r /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist ]]; then echo "dnsmasq already configured" else sudo cp "$(brew list dnsmasq | grep 'dnsmasq.plist$')" \ /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist dscacheutil -flushcache echo "dnsmasq configured" fi sudo mkdir -p /etc/resolver sudo tee /etc/resolver/holos.localhost <