### Install Dependencies and Serve Docs Locally Source: https://github.com/helmwave/docs/blob/main/README.md Use these commands to install project dependencies and start a local development server for the documentation. ```bash pip install -r requirements.txt mkdocs serve mike serve ``` -------------------------------- ### Example helmwave.yml Configuration Source: https://github.com/helmwave/docs/blob/main/docs/examples/tags/README.md An example `helmwave.yml` file demonstrating a setup with four releases: redis-a, redis-b, memcached-a, and memcached-b. ```yaml redis-a redis-b memcached-a memcached-b ``` -------------------------------- ### Install Helmwave with go get Source: https://github.com/helmwave/docs/blob/main/docs/install.md Installs a specific version of Helmwave using the 'go get' command. Ensure Go is installed first. ```shell export VERSION=⟨⟨ ver ⟩⟩ GO111MODULE=on go get github.com/helmwave/helmwave@$VERSION ``` -------------------------------- ### HelmWave project structure example Source: https://github.com/helmwave/docs/blob/main/docs/examples/pass-git-tag/README.md Illustrates the expected project structure for a HelmWave configuration, including example files. ```shell ⟨⟨ run_script("tree docs/examples/pass-git-tag") ⟩⟩ ``` -------------------------------- ### Full helmwave.yml Configuration Example Source: https://github.com/helmwave/docs/blob/main/docs/yaml.md An example of a comprehensive `helmwave.yml` file, typically including all possible configurations and settings. ```yaml {% include "./examples/full/helmwave.yml" %} ``` -------------------------------- ### Install Helmwave with marcosnils/bin Source: https://github.com/helmwave/docs/blob/main/docs/install.md Installs Helmwave using the 'marcosnils/bin' utility. This is a convenient method for managing binary installations. ```shell bin install github.com/helmwave/helmwave ``` -------------------------------- ### Short helmwave.yml Configuration Source: https://github.com/helmwave/docs/blob/main/docs/yaml.md A minimal `helmwave.yml` example demonstrating the basic structure and required fields. ```yaml project: "HelloWorld" version: "⟨⟨ ver ⟩⟩" repositories: [] registries: [] releases: [] lifecycle: pre_up: [] post_up: [] pre_down: [] post_down: [] pre_build: [] post_build: [] pre_rollback: [] post_rollback: [] ``` -------------------------------- ### Values Configuration Example Source: https://github.com/helmwave/docs/blob/main/docs/examples/kubedog/README.md Example values.yml configuration file. This file is used to provide custom values for HelmWave deployments, often in conjunction with commonAnnotations. ```yaml {% include "./values.yml" %} ``` -------------------------------- ### Helmwave Build Command Example Source: https://github.com/helmwave/docs/blob/main/docs/examples/lifecycle/README.md Example of running the helmwave build command with diff-mode set to none. This command is used to build Helm releases. ```shell {% include "./log" %} ``` -------------------------------- ### Define Helm Releases in helmwave.yml Source: https://github.com/helmwave/docs/blob/main/docs/examples/quick-start/README.md This is an example of the `helmwave.yml` configuration file. Define your desired Helm releases and their configurations here. ```yaml project: name: my-project environment: my-namespace releases: - name: a chart: nats-7.8.3 version: 2.9.17 - name: b chart: nats-7.8.3 version: 2.9.17 ``` -------------------------------- ### Install Helmwave on RedHat-based Linux Source: https://github.com/helmwave/docs/blob/main/docs/install.md Install Helmwave on RedHat-based systems using a downloaded .rpm package. Ensure the VERSION environment variable is set. ```shell export VERSION=⟨⟨ ver ⟩⟩ export ARCH=$(uname -m) # amd64, arm64 wget -c https://github.com/helmwave/helmwave/releases/download/v$VERSION/helmwave_${VERSION}_linux_${ARCH}.rpm -o helmwave.rpm yum localinstall ./helmwave.rpm ``` -------------------------------- ### Install Helmwave on Alpine Linux Source: https://github.com/helmwave/docs/blob/main/docs/install.md Install Helmwave on Alpine Linux using a downloaded .apk package. Ensure the VERSION environment variable is set. ```shell export VERSION=⟨⟨ ver ⟩⟩ export ARCH=$(uname -m) # amd64, arm64 wget -c https://github.com/helmwave/helmwave/releases/download/v$VERSION/helmwave_${VERSION}_linux_${ARCH}.apk -o helmwave.apk apk add --allow-untrusted ./helmwave.apk ``` -------------------------------- ### Helmwave Configuration File Source: https://github.com/helmwave/docs/blob/main/docs/examples/aws-sm/README.md Example `helmwave.yml` configuration file. This file defines the overall Helmwave project structure and settings. ```yaml project: name: aws-sm-example repositories: - name: stable url: oci://registry-1.docker.io/bitnamicharts releases: - name: my-release chart: stable/nginx version: 15.1.0 values: - values-secret.yaml ``` -------------------------------- ### Compile Helmwave from Source Source: https://github.com/helmwave/docs/blob/main/docs/install.md Builds Helmwave from its source code. This method requires Git and Go to be installed. ```shell git clone git@github.com:helmwave/helmwave.git cd helmwave go build ./cmd/helmwave mv -f helmwave /usr/local/bin/ ``` -------------------------------- ### Helmwave List Command Example Source: https://github.com/helmwave/docs/blob/main/docs/cli.md Illustrates how to list deployed Helm releases using the 'helmwave ls' command. The output includes release name, namespace, revision, status, chart, and version. ```bash $ helmwave ls [🙃 aka INFO]: Should be 3 releases NAME | NAMESPACE | REVISION | UPDATED | STATUS | CHART | VERSION -----------+-----------+----------+--------------------------------+----------+-------+---------- frontend | test | 1 | 2021-11-10 04:41:23.330989 | deployed | this | 0.1.0 | | | +0300 MSK | | | database | test | 1 | 2021-11-10 04:41:23.353473 | deployed | this | 0.1.0 | | | +0300 MSK | | | backend | test | 1 | 2021-11-10 04:41:23.270076 | deployed | this | 0.1.0 | | | +0300 MSK | | | ``` -------------------------------- ### Helmwave Down Command Example Source: https://github.com/helmwave/docs/blob/main/docs/cli.md Demonstrates the uninstallation of Helm releases using the 'helmwave down' command. It shows the expected output upon successful uninstallation. ```bash $ helmwave down [🙃 aka INFO]: ✅ frontend@test uninstalled! [🙃 aka INFO]: ✅ database@test uninstalled! [🙃 aka INFO]: ✅ backend@test uninstalled! ``` -------------------------------- ### Install Helmwave on Debian-based Linux Source: https://github.com/helmwave/docs/blob/main/docs/install.md Install Helmwave on Debian-based systems using a downloaded .deb package. Ensure the VERSION environment variable is set. ```shell export VERSION=⟨⟨ ver ⟩⟩ export ARCH=$(uname -m) # amd64, arm64 wget -c https://github.com/helmwave/helmwave/releases/download/v$VERSION/helmwave_${VERSION}_linux_${ARCH}.deb -o helmwave.deb apt install ./helmwave.deb ``` -------------------------------- ### Install Helmwave on Linux with wget Source: https://github.com/helmwave/docs/blob/main/docs/install.md Download and extract the Helmwave binary for Linux using wget. Ensure the VERSION environment variable is set. ```shell export VERSION=⟨⟨ ver ⟩⟩ export ARCH=$(uname -m) # amd64, arm64 wget -c https://github.com/helmwave/helmwave/releases/download/v$VERSION/helmwave_${VERSION}_linux_${ARCH}.tar.gz -O - | tar -xz mv helmwave /usr/local/bin/ ``` -------------------------------- ### Display Project Structure Source: https://github.com/helmwave/docs/blob/main/docs/examples/aws-sm/README.md Use this command to view the directory structure of the AWS Secrets Manager example. ```shell tree docs/examples/aws-sm ``` -------------------------------- ### Gitlab CI Configuration for Helmwave Source: https://github.com/helmwave/docs/blob/main/docs/examples/apps-per-ns/README.md Example GitLab CI configuration file for automating Helmwave deployments. ```yaml {% include "./.gitlab-ci.yml" %} ``` -------------------------------- ### Helmwave Build Logs Source: https://github.com/helmwave/docs/blob/main/docs/examples/remote-source/README.md Example logs from a Helmwave build process utilizing a remote source. This shows the steps involved, including cache usage, release building, repository management, and manifest generation. ```shell [🙃 aka INFO]: using cache for remote source remote source: github.com/helmwave/unit-test-go-getter cache path: /Users/zhilyaev/Library/Caches/helmwave/remote-source/2d4e600d4fa708cb8642b0fcd7ff4597a7b435e5552adedb4bd61a75888f61b4 [🙃 aka INFO]: 🔨 Building releases... [🙃 aka INFO]: 🔨 Building values... [🙃 aka INFO]: 🔨 no values provided release: nginx@test [🙃 aka INFO]: 🔨 Building repositories... [🙃 aka INFO]: 🗄 repo has been added to the plan repository: bitnami [🙃 aka INFO]: ❎ repository already exists with the same configuration, skipping repository: bitnami [🙃 aka INFO]: 🔨 Building registries... [🙃 aka INFO]: 🔨 Building charts... [🙃 aka INFO]: 🔨 Building manifests... [🙃 aka INFO]: ❎ skipping updating dependencies for remote chart release: nginx@test [🙃 aka INFO]: ❎ found chart in helm cache, using it release: nginx@test path: /Users/zhilyaev/Library/Caches/helm/repository/nginx-13.1.7.tgz [🙃 aka INFO]: ✅ manifest done release: nginx@test [🙃 aka INFO]: 🔨 Building graphs... [🙃 aka INFO]: show graph: ┌─────────────┐ │ nginx@test │ └─────────────┘ [🙃 aka INFO]: 🏗 Plan releases: - nginx@test repositories: - bitnami registries: - [🙃 aka INFO]: 🆚 Diff manifests in the kubernetes cluster [🙈 aka WARNING]: I can't get release from k8s: failed to get release nginx@test: release: not found [🙃 aka INFO]: 🏗 Planfile is ready! ``` -------------------------------- ### Default values.yaml example Source: https://github.com/helmwave/docs/blob/main/docs/examples/pass-git-tag/README.md Shows the default image repository and tag configuration in a Helm chart's values.yaml file. ```yaml image: repository: registry.gitlab.local/example/app tag: v1.0.0 ... ``` -------------------------------- ### Install Helmwave with Homebrew on Mac OS Source: https://github.com/helmwave/docs/blob/main/docs/install.md Use this command to install Helmwave on macOS using the Homebrew package manager. ```shell brew install helmwave/tap/helmwave ``` -------------------------------- ### Install Helmwave on Mac OS with wget Source: https://github.com/helmwave/docs/blob/main/docs/install.md Download and extract the Helmwave binary for Mac OS using wget. Ensure the VERSION environment variable is set. ```shell export VERSION=⟨⟨ ver ⟩⟩ export ARCH=$(uname -m) # amd64, arm64 wget -c https://github.com/helmwave/helmwave/releases/download/v$VERSION/helmwave_${VERSION}_darwin_${ARCH}.tar.gz -O - | tar -xz mv helmwave /usr/local/bin/ ``` -------------------------------- ### Example Architecture Diagram Source: https://github.com/helmwave/docs/blob/main/docs/examples/umbrella-evil/README.md Mermaid diagram illustrating a sample architecture with frontend, API, message queue, object storage, and database components. ```mermaid graph LR frontend --> api --> rabbitmq & minio_s3 consumer --> rabbitmq & minio_s3 & postgresql ``` -------------------------------- ### Helm Command: Create Namespace Source: https://github.com/helmwave/docs/blob/main/docs/yaml.md Use the `--create-namespace` flag with `helm upgrade --install` to automatically create the release's namespace if it does not exist. ```shell helm upgrade --install --create-namespace my-release my-chart --namespace my-namespace ``` -------------------------------- ### Helmwave Configuration File Source: https://github.com/helmwave/docs/blob/main/docs/examples/helm-chart-as-git-repo/README.md Define your Helmwave project configuration in `helmwave.yml`. This example shows how to specify a Helm chart source from a Git repository. ```yaml project: name: my-project charts: - name: my-chart version: "0.1.0" repo: "git+https://github.com/user/repo.git?ref=main&path=charts/my-chart" ``` -------------------------------- ### Rendered Values Example Source: https://github.com/helmwave/docs/blob/main/docs/examples/store-greeting-hello/README.md After running `helmwave build`, the rendered values are available in the `.helmwave/values` directory. This shows the merged output for `a.yml` and `b.yml`. ```yaml image: repository: nginx greeting: hello ``` ```yaml image: tag: v1.0.0 message: hello world ``` -------------------------------- ### GitHub Action for Helmwave Deployment Source: https://github.com/helmwave/docs/blob/main/docs/ci.md This GitHub Action workflow automates Helmwave installation, templating, building, and deployment. Ensure the `helmwave.yml.tpl` file exists for templating. ```yaml name: Deploy on: push: jobs: external: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: helmwave/setup-action@v0.2.0 name: Install helmwave with: version: '⟨⟨ ver ⟩⟩' - name: templating helmwave.yml.tpl run: '[[ -f "helmwave.yml.tpl" ]] && helmwave yml' - name: plan run: helmwave build - name: deploy run: helmwave up ``` -------------------------------- ### Public OCI Registry Configuration Source: https://github.com/helmwave/docs/blob/main/docs/yaml.md Example of configuring public OCI registries within `helmwave.yml`. Does not require authentication. ```yaml {% include "./examples/oci-public/helmwave.yml" %} ``` -------------------------------- ### Private OCI Registry Configuration Source: https://github.com/helmwave/docs/blob/main/docs/yaml.md Example of configuring private OCI registries within `helmwave.yml`. Requires username and password for authentication. ```yaml {% include "./examples/oci-private/helmwave.yml" %} ``` -------------------------------- ### Verify Deployment with Helm and Kubectl Source: https://github.com/helmwave/docs/blob/main/docs/examples/quick-start/README.md After deployment, use `helm list` to check the status of your Helm releases and `kubectl get po` to verify that your pods are running in the target namespace. ```shell $ helm list -n my-namespace NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION a my-namespace 1 2023-06-13 16:25:42.446056 +0400 +04 deployed nats-7.8.3 2.9.17 b my-namespace 1 2023-06-13 16:25:42.444662 +0400 +04 deployed nats-7.8.3 2.9.17 $ k get po -n my-namespace NAME READY STATUS RESTARTS AGE a-nats-0 1/1 Running 0 37s b-nats-0 1/1 Running 0 36s ``` -------------------------------- ### Helmwave Configuration with Monitors Source: https://github.com/helmwave/docs/blob/main/docs/examples/monitors/README.md This YAML configuration defines a Helmwave setup that includes monitor configurations. It specifies parameters like interval, iteration timeout, success threshold, and failure threshold for monitors. ```yaml project: name: helmwave helmwave: # ... other helmwave configurations monitors: # Monitor 1 configuration monitor1: interval: 10s iteration_timeout: 5s success_threshold: 3 failure_threshold: 3 # Dependencies for monitor1 depends_on: - release1 - release2 # Monitor 2 configuration monitor2: interval: 15s iteration_timeout: 7s success_threshold: 2 failure_threshold: 4 # Dependencies for monitor2 depends_on: - release2 - release3 # ... other project configurations ``` -------------------------------- ### kustomize.sh Source: https://github.com/helmwave/docs/blob/main/docs/examples/helm-patch-with-kustomize/README.md A script demonstrating the usage of Kustomize with Helm for post-rendering. ```bash #!/bin/bash helm template hello ../hello | kustomize build ``` -------------------------------- ### Set Release Installation Timeout Source: https://github.com/helmwave/docs/blob/main/docs/yaml.md Configure the `timeout` option to specify the maximum time Helmwave will wait for a release to install. This option is required if `kubedog` is enabled. ```yaml releases: - name: my-release timeout: "5m" ``` -------------------------------- ### Run Helmwave with Environment Variables Source: https://github.com/helmwave/docs/blob/main/docs/examples/kubedog/README.md Alternatively, enable Kubedog and auto-build by setting environment variables before running the helmwave up command. ```shell export HELMWAVE_KUBEDOG_ENABLED=true export HELMWAVE_AUTO_BUILD=true helmwave up ``` -------------------------------- ### Helmwaves Environment Settings and Templating Source: https://github.com/helmwave/docs/blob/main/docs/examples/helmfile-migration/README.md Creates an envs.yml file for environment settings and demonstrates basic templating in helmwave.yml.tpl. ```yaml envs.yml: {% include "./envs.yml" %} ``` ```yaml helmwave.yml.tpl: {{- $env := getenv "ENV" -}} {{- defineDatasource "envs" "envs.yml" -}} {{- $envs := (ds "envs").envs -}} # It'll chose env setting by $ENV {{ $e := index $envs $env }} ... ``` -------------------------------- ### Get Application URL with LoadBalancer Source: https://github.com/helmwave/docs/blob/main/docs/examples/helm-patch-with-kustomize/hello/templates/NOTES.txt This snippet provides instructions and commands to get the application URL for services of type LoadBalancer. It includes a command to watch the LoadBalancer status. ```bash NOTE: It may take a few minutes for the LoadBalancer IP to be available. You can watch its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "hello.fullname" . }}' export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "hello.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}) echo http://$SERVICE_IP:{{ .Values.service.port }} ``` -------------------------------- ### Get Value at Path with Default Source: https://github.com/helmwave/docs/blob/main/docs/tpl.md The get function retrieves a value from a nested structure using a dot-separated path. If a defaultValue is provided, it's returned when the path is not found; otherwise, nil is returned. Template rendering fails on other errors. ```go-template {{ $Getvalue := $value | get "path.key" "defaultValue" }} ``` -------------------------------- ### Build and Deploy Specific Application Source: https://github.com/helmwave/docs/blob/main/docs/examples/apps-per-ns/README.md Commands to build and deploy only a specific application (e.g., 'plantuml') and then apply the deployment. ```shell helmwave build -t plantuml helmwave up ``` -------------------------------- ### Display Helmwave CLI Help Source: https://github.com/helmwave/docs/blob/main/docs/cli.md Run this command to display the main help information for the Helmwave CLI, showing all available top-level commands. ```shell helmwave -h ``` -------------------------------- ### Get Helmwave Version Source: https://github.com/helmwave/docs/blob/main/docs/cli.md Retrieves the current version of Helmwave using either the long or short flag. ```bash $ helmwave --version helmwave version ⟨⟨ ver ⟩⟩ ``` ```bash $ helmwave -v helmwave version ⟨⟨ ver ⟩⟩ ``` ```bash $ helmwave version ⟨⟨ ver ⟩⟩ ``` ```bash $ helmwave ver ⟨⟨ ver ⟩⟩ ``` -------------------------------- ### Helmwave Build Command Tags Help Source: https://github.com/helmwave/docs/blob/main/docs/examples/tags/README.md Displays the help information for the tags-related flags in the `helmwave build` command. ```shell helmwave build -h | grep tags | cut -c 4- ``` -------------------------------- ### Build with Tags 'redis' or 'a' Source: https://github.com/helmwave/docs/blob/main/docs/examples/tags/README.md Builds releases that have the tag 'redis' OR the tag 'a', demonstrating the default OR logic for multiple tag selections. ```bash helmwave build -t redis -t a [🙃 aka INFO]: 🏗 Plan releases: - redis-a@test - redis-b@test - memcached-a@test ``` -------------------------------- ### Run Helmwave with Kubedog Source: https://github.com/helmwave/docs/blob/main/docs/examples/kubedog/README.md Execute the helmwave up command with the --kubedog flag to perform a deployment and enable Kubedog tracking. This can be combined with --progress for enhanced logging. ```shell helmwave up --build --kubedog ``` -------------------------------- ### Render helmwave.yml.tpl to helmwave.yml Source: https://github.com/helmwave/docs/blob/main/docs/examples/private-github-repo/README.md Command to render the helmwave.yml.tpl file into helmwave.yml. Ensure GITHUB_TOKEN is set for private repositories. ```bash $ export NS=stage $ export GITHUB_TOKEN=my-secret-token $ helmwave yml [🙃 aka INFO]: 📄 YML is ready! build plan with next command: helmwave build -f helmwave.yml ``` -------------------------------- ### Enable 3-Way Merge for Diff Source: https://github.com/helmwave/docs/blob/main/docs/flags/3-way-merge.md Use this flag to enable 3-way merge for diff operations. Currently, no concrete example is available. ```shell TODO: add example ``` -------------------------------- ### Build with All Tags 'redis' AND 'a' Source: https://github.com/helmwave/docs/blob/main/docs/examples/tags/README.md Builds releases that have BOTH the tag 'redis' AND the tag 'a', using the `--match-all-tags` flag for AND logic. ```bash helmwave build --match-all-tags -t redis -t a [🙃 aka INFO]: 🏗 Plan releases: - redis-a@test ``` -------------------------------- ### Get Application URL with Ingress Source: https://github.com/helmwave/docs/blob/main/docs/examples/helm-patch-with-kustomize/hello/templates/NOTES.txt This snippet generates the application URL when Ingress is enabled. It iterates through hosts and paths defined in the values. ```go-template {{- if .Values.ingress.enabled }} {{- range $host := .Values.ingress.hosts }} {{- range .paths }} http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} {{- end }} {{- end }} {{- end }} ``` -------------------------------- ### Display Project Structure Source: https://github.com/helmwave/docs/blob/main/docs/examples/private-gitlab-repo/README.md Use this command to view the project directory structure, useful for understanding file organization. ```shell ⟨⟨ run_script("tree docs/examples/private-github-repo") ⟩⟩ ``` -------------------------------- ### Show Helmwave Diff Plan Options Source: https://github.com/helmwave/docs/blob/main/docs/cli.md Lists the HELMWAVE_ environment variables applicable to the `helmwave diff plan` subcommand. This command compares the Helmwave plan against local files. ```shell helmwave diff plan -h | grep HELMWAVE_ | cut -c 4- ``` -------------------------------- ### Get Application URL with NodePort Source: https://github.com/helmwave/docs/blob/main/docs/examples/helm-patch-with-kustomize/hello/templates/NOTES.txt This snippet retrieves the application URL for services of type NodePort. It exports the NodePort and Node IP for constructing the URL. ```bash export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "hello.fullname" . }}) export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") echo http://$NODE_IP:$NODE_PORT ``` -------------------------------- ### Build with Tags 'a' and 'b' Source: https://github.com/helmwave/docs/blob/main/docs/examples/tags/README.md Builds releases that have either the tag 'a' or 'b'. This demonstrates the OR logic for multiple tags. ```bash helmwave build -t ab [🙃 aka INFO]: 🏗 Plan releases: - redis-b@test - memcached-b@test ``` -------------------------------- ### Build Helmwave Deployment Plan Source: https://github.com/helmwave/docs/blob/main/docs/examples/apps-per-ns/README.md Command to build the deployment plan for Helmwave. ```shell helmwave build ``` -------------------------------- ### Generate Graph with Negative Width -5 Source: https://github.com/helmwave/docs/blob/main/docs/examples/graph/README.md Use the `--graph-width -5` flag to generate a graph with a negative width. This example uses a width of -5. ```shell helmwave graph --graph-width -5 [🙃 aka INFO]: show graph: ┌─────────────────────────┐ ┌───────────────────────────────────┐ │ short-name@my-namespace ├───┤ long-name-with-very-long-name@... │ └─────────────────────────┘ └───────────────────────────────────┘ ``` -------------------------------- ### Specify Values Files (Short Syntax) Source: https://github.com/helmwave/docs/blob/main/docs/yaml.md Use the short syntax to list values files directly. ```yaml values: - values.yaml - values2.yaml ``` -------------------------------- ### Generate Graph with Negative Width -15 Source: https://github.com/helmwave/docs/blob/main/docs/examples/graph/README.md Use the `--graph-width -15` flag to generate a graph with a negative width, affecting layout. This example shows a width of -15. ```shell helmwave graph --graph-width -15 [🙃 aka INFO]: show graph: ┌─────────────────────────┐ ┌─────────────────────────┐ │ short-name@my-namespace ├───┤ long-name-with-very-... │ └─────────────────────────┘ └─────────────────────────┘ ``` -------------------------------- ### Helmwave Values File with Secret Reference Source: https://github.com/helmwave/docs/blob/main/docs/examples/aws-sm/README.md Example `values-secret.yaml` file that references a secret from AWS Secrets Manager using the gomplate templater. The secret 'hello/foobar' will be injected as 'secret'. ```yaml secret: {{ .Values.aws.secretsmanager.hello.foobar }} ``` -------------------------------- ### Helm build and verification Source: https://github.com/helmwave/docs/blob/main/docs/examples/helm-patch-with-kustomize/README.md Commands to build the Helmwave project and verify the applied patch by checking for `priorityClassName` in the output manifest. ```bash helmwave build cat .helmwave/manifest/world@my-namespace.yml| grep priorityClassName ``` -------------------------------- ### Initialize and Configure Analytics Source: https://github.com/helmwave/docs/blob/main/docs/overrides/partials/integrations/analytics/custom.html This snippet initializes Google Analytics, Microsoft Clarity, and Yandex.Metrica. It sets up dataLayer for Google Analytics and includes scripts for Clarity and Yandex.Metrica with specific configurations. ```javascript function __md_analytics() { function n() { dataLayer.push(arguments); } (window.dataLayer = window.dataLayer || []), n("js", new Date()), n("config", "{{ config.extra.analytics.google }}"), document.addEventListener("DOMContentLoaded", function () { document.forms.search && document.forms.search.query.addEventListener("blur", function () { this.value && n("event", "search", { search_term: this.value }); }), document$.subscribe(function () { var a = document.forms.feedback; if (void 0 !== a) for (var e of a.querySelectorAll("[type=submit]")) e.addEventListener("click", function (e) { e.preventDefault(); var t = document.location.pathname, e = this.getAttribute("data-md-value"); n("event", "feedback", { page: t, data: e }), (a.firstElementChild.disabled = !0); e = a.querySelector(".md-feedback__note [data-md-value='" + e + "']"); e && (e.hidden = !1); }), (a.hidden = !1); }), location$.subscribe(function (e) { n("config", "{{ config.extra.analytics.google }}", { page_path: e.pathname }); }); }); var e = document.createElement("script"); (e.async = !0), (e.src = "https://www.googletagmanager.com/gtag/js?id={{ config.extra.analytics.google }}"), document.getElementById("__analytics").insertAdjacentElement("afterEnd", e); (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r); t.async=1; t.src="https://www.clarity.ms/tag/"+i+"?ref=bwt"; y=l.getElementsByTagName(r)[0]; y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "{{ config.extra.analytics.microsoft }}"); (function(m,e,t,r,i,k,a){ m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) { if (document.scripts[j].src === r) { return; } } k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a) })(window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym({{ config.extra.analytics.yandex }}, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true, webvisor:true }); var ns = document.createElement("noscript"); var div = document.createElement("div"); var img = document.createElement("img"); (img.src = "https://mc.yandex.ru/watch/{{ config.extra.analytics.yandex }}"), (img.style = "position:absolute; left:-9999px;"), (img.alt = ""); div.replaceChildren(img), ns.replaceChildren(div), document.getElementById("__analytics").insertAdjacentElement("afterEnd", ns); } ``` -------------------------------- ### Get Helm Release Status with Helmwave Source: https://github.com/helmwave/docs/blob/main/docs/cli.md Use the `status` command to retrieve the deployment status of Helm releases managed by Helmwave. This command queries Helm for the current state of each release defined in your plan. ```shell helmwave status -h | grep HELMWAVE_ | cut -c 4- ``` ```bash $ helmwave status [🙃 aka INFO]: Status of frontend@test status: deployed revision: 1 name: frontend namespace: test chart: frontend-0.1.0 last deployed: 2021-11-10 04:41:23.330989 +0300 MSK [🙃 aka INFO]: Status of database@test status: deployed revision: 1 name: database namespace: test chart: database-0.1.0 last deployed: 2021-11-10 04:41:23.353473 +0300 MSK [🙃 aka INFO]: Status of backend@test name: backend namespace: test chart: backend-0.1.0 last deployed: 2021-11-10 04:41:23.270076 +0300 MSK status: deployed revision: 1 ``` -------------------------------- ### Helmwave Build with Diff Mode None Source: https://github.com/helmwave/docs/blob/main/docs/examples/monitors/README.md This shell command demonstrates building Helmwave releases with the diff mode set to 'none'. The included log output shows the execution details, which would typically include information about the monitor runs if they were configured and executed. ```shell $ helmwave build --diff-mode none # Example log output (actual output may vary): # INFO[0000] Helmwave build started... # INFO[0001] Processing release 'release1'... # INFO[0005] Release 'release1' deployed successfully. # INFO[0006] Processing release 'release2'... # INFO[0010] Release 'release2' deployed successfully. # INFO[0011] Starting monitor 'monitor1'... # INFO[0011] Monitor 'monitor1' iteration 1... # INFO[0016] Monitor 'monitor1' iteration 2... # INFO[0021] Monitor 'monitor1' iteration 3... # INFO[0021] Monitor 'monitor1' succeeded. # INFO[0022] Processing release 'release3'... # INFO[0026] Release 'release3' deployed successfully. # INFO[0027] Starting monitor 'monitor2'... # INFO[0027] Monitor 'monitor2' iteration 1... # INFO[0042] Monitor 'monitor2' iteration 2... # INFO[0042] Monitor 'monitor2' succeeded. # INFO[0043] Helmwave build completed successfully. ``` -------------------------------- ### Get Values from Another File Source: https://github.com/helmwave/docs/blob/main/docs/tpl.md The getValues function reads and parses another values file (e.g., common.yaml) as YAML for the current release. Introduced in v0.36.0. Template rendering fails if the file cannot be read or parsed. ```go-template {{ $common := getValues "common.yaml" }} ``` -------------------------------- ### Require Environment Variable Source: https://github.com/helmwave/docs/blob/main/docs/tpl.md The requiredEnv function ensures an environment variable is set and not empty. If the variable is unset or empty, template rendering will fail. Special handling is needed for paths starting with '/' on Windows with Git. ```go-template {{ $envValue := requiredEnv "envName" }} ``` -------------------------------- ### Access Application with ClusterIP and Port Forwarding Source: https://github.com/helmwave/docs/blob/main/docs/examples/helm-patch-with-kustomize/hello/templates/NOTES.txt This snippet shows how to access an application with ClusterIP by setting up port forwarding. It retrieves the Pod name and container port, then echoes the local access URL. ```bash export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "hello.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") echo "Visit http://127.0.0.1:8080 to use your application" kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT ``` -------------------------------- ### Enable Kubedog Source: https://github.com/helmwave/docs/blob/main/docs/examples/kubedog/README.md Set the HELMWAVE_KUBEDOG_ENABLED environment variable to true to activate Kubedog tracking. ```shell export HELMWAVE_KUBEDOG_ENABLED=true ``` -------------------------------- ### Deploy to Private Environment Source: https://github.com/helmwave/docs/blob/main/docs/examples/private-env/README.md Use the 'helmwave up' command to deploy the plan to the configured private environment. This applies the defined Kubernetes resources. ```shell helmwave up ``` -------------------------------- ### Enable Progress Output Source: https://github.com/helmwave/docs/blob/main/docs/flags/progress.md Enable detailed debug output by using the `--progress` flag (or `--progress=true`). This provides granular insights into the deployment process, including resource patching and readiness checks. ```shell helmwave up --progress [🙃 aka INFO]: 🗄 sync repositories... [🙃 aka INFO]: 🗄 sync registries... [🙃 aka INFO]: 🛥 sync releases... [🙃 aka INFO]: 🛥 deploying... release: a@my-namespace [🙃 aka INFO]: 🛥 deploying... release: b@my-namespace [🙃 aka INFO]: getting history for release b [🙃 aka INFO]: getting history for release a [🙃 aka INFO]: preparing upgrade for b [🙃 aka INFO]: preparing upgrade for a [🙃 aka INFO]: performing update for a [🙃 aka INFO]: performing update for b [🙃 aka INFO]: creating upgraded release for a [🙃 aka INFO]: creating upgraded release for b [🙃 aka INFO]: checking 4 resources for changes [🙃 aka INFO]: checking 4 resources for changes [🙃 aka INFO]: Patch Secret "a-nats" in namespace my-namespace [🙃 aka INFO]: Patch Secret "b-nats" in namespace my-namespace [🙃 aka INFO]: Looks like there are no changes for Service "a-nats-headless" [🙃 aka INFO]: Looks like there are no changes for Service "b-nats-headless" [🙃 aka INFO]: Patch Service "a-nats" in namespace my-namespace [🙃 aka INFO]: Patch Service "b-nats" in namespace my-namespace [🙃 aka INFO]: Patch StatefulSet "a-nats" in namespace my-namespace [🙃 aka INFO]: Patch StatefulSet "b-nats" in namespace my-namespace [🙃 aka INFO]: waiting for release a resources (created: 0 updated: 4 deleted: 0) [🙃 aka INFO]: beginning wait for 4 resources with timeout of 1m0s [🙃 aka INFO]: waiting for release b resources (created: 0 updated: 4 deleted: 0) [🙃 aka INFO]: beginning wait for 4 resources with timeout of 1m0s [🙃 aka INFO]: StatefulSet is not ready: my-namespace/a-nats. 0 out of 1 expected pods have been scheduled [🙃 aka INFO]: StatefulSet is not ready: my-namespace/b-nats. 0 out of 1 expected pods are ready [🙃 aka INFO]: StatefulSet is not ready: my-namespace/a-nats. 0 out of 1 expected pods are ready [🙃 aka INFO]: StatefulSet is not ready: my-namespace/b-nats. 0 out of 1 expected pods have been scheduled [🙃 aka INFO]: StatefulSet is not ready: my-namespace/a-nats. 0 out of 1 expected pods are ready [🙃 aka INFO]: StatefulSet is not ready: my-namespace/b-nats. 0 out of 1 expected pods have been scheduled [🙃 aka INFO]: StatefulSet is not ready: my-namespace/a-nats. 0 out of 1 expected pods are ready [🙃 aka INFO]: StatefulSet is not ready: my-namespace/b-nats. 0 out of 1 expected pods have been scheduled [🙃 aka INFO]: StatefulSet is not ready: my-namespace/a-nats. 0 out of 1 expected pods are ready [🙃 aka INFO]: StatefulSet is not ready: my-namespace/b-nats. 0 out of 1 expected pods have been scheduled [🙃 aka INFO]: StatefulSet is not ready: my-namespace/a-nats. 0 out of 1 expected pods are ready [🙃 aka INFO]: StatefulSet is not ready: my-namespace/b-nats. 0 out of 1 expected pods have been scheduled [🙃 aka INFO]: StatefulSet is not ready: my-namespace/a-nats. 0 out of 1 expected pods are ready [🙃 aka INFO]: StatefulSet is not ready: my-namespace/b-nats. 0 out of 1 expected pods have been scheduled [🙃 aka INFO]: StatefulSet is ready: my-namespace/a-nats. 1 out of 1 expected pods are ready [🙃 aka INFO]: StatefulSet is not ready: my-namespace/b-nats. 0 out of 1 expected pods are ready [🙃 aka INFO]: updating status for upgraded release for a [🙃 aka INFO]: StatefulSet is not ready: my-namespace/b-nats. 0 out of 1 expected pods are ready [🙃 aka INFO]: ✅ release: a@my-namespace [🙃 aka INFO]: StatefulSet is not ready: my-namespace/b-nats. 0 out of 1 expected pods are ready [🙃 aka INFO]: StatefulSet is not ready: my-namespace/b-nats. 0 out of 1 expected pods are ready [🙃 aka INFO]: StatefulSet is ready: my-namespace/b-nats. 1 out of 1 expected pods are ready [🙃 aka INFO]: updating status for upgraded release for b [🙃 aka INFO]: ✅ release: b@my-namespace [🙃 aka INFO]: Success 2 / 2 ``` -------------------------------- ### Show Helmwave Diff Live Options Source: https://github.com/helmwave/docs/blob/main/docs/cli.md Displays the available HELMWAVE_ flags for the `helmwave diff live` subcommand. This command compares manifests against the live Kubernetes cluster. ```shell helmwave diff live -h | grep HELMWAVE_ | cut -c 4- ``` -------------------------------- ### Download helmwave.schema.json using wget Source: https://github.com/helmwave/docs/blob/main/docs/ide.md Download the JSON schema for `helmwave.yml` using `wget`. You can specify a version or use the latest release. ```shell wget -L https://github.com/helmwave/helmwave/releases/download/v⟨⟨ ver ⟩⟩/schema.json -o helmwave.schema.json ``` ```shell # latest version wget -L https://github.com/helmwave/helmwave/releases/latest/download/schema.json ``` -------------------------------- ### Build with Tag 'redis' Source: https://github.com/helmwave/docs/blob/main/docs/examples/tags/README.md Builds releases that have the tag 'redis'. This uses an OR logic by default. ```bash helmwave build -t redis [🙃 aka INFO]: 🏗 Plan releases: - redis-a@test - redis-b@test ``` -------------------------------- ### Chart Configuration: Short Syntax Source: https://github.com/helmwave/docs/blob/main/docs/yaml.md Use the short syntax for basic chart specification. This is suitable when only the chart name is needed. ```yaml releases: - name: my-release namespace: my-namespace chart: my-chart ``` -------------------------------- ### Specify Values Files (Full Syntax) Source: https://github.com/helmwave/docs/blob/main/docs/yaml.md Use the full syntax to specify values files with additional options like delimiters and renderer. ```yaml values: - src: values.yaml delimiter_left: "{{" delimiter_right: "}}" strict: false renderer: "" ``` -------------------------------- ### Helmwave Configuration: Create Namespace Source: https://github.com/helmwave/docs/blob/main/docs/yaml.md Set `create_namespace: true` in your Helmwave release configuration to enable automatic namespace creation. ```yaml releases: - name: my-release namespace: my-namespace chart: my-chart create_namespace: true ``` -------------------------------- ### Build with Remote Source Source: https://github.com/helmwave/docs/blob/main/docs/examples/remote-source/README.md Use the `helmwave build` command with the `--remote-source` flag to specify a remote Git repository containing your Helmwave configuration. ```shell helmwave build --remote-source github.com/helmwave/unit-test-go-getter ``` -------------------------------- ### Deploy Releases with Helmwave Source: https://github.com/helmwave/docs/blob/main/docs/examples/quick-start/README.md Run this command to deploy the generated plan. Helmwave will apply your Helm releases to the specified Kubernetes namespace. ```shell helmwave up ``` -------------------------------- ### Build with Tag 'a' Source: https://github.com/helmwave/docs/blob/main/docs/examples/tags/README.md Builds releases that have the tag 'a'. This includes releases from different applications if they share the tag. ```bash helmwave build -t a [🙃 aka INFO]: 🏗 Plan releases: - redis-a@test - memcached-a@test ``` -------------------------------- ### Render Helmwave Configuration Source: https://github.com/helmwave/docs/blob/main/docs/examples/apps-per-ns/README.md Command to render the Helmwave template into a final configuration file. ```shell helmwave yml ``` -------------------------------- ### Execute YML Command Before Build Source: https://github.com/helmwave/docs/blob/main/docs/flags/yml.md Use the `yml` command to prepare the Helmwave configuration file before the build process. This command outputs the next build command to be executed. ```shell helmwave yml [🙃 aka INFO]: 📄 YML is ready! build plan with next command: helmwave build -f helmwave.yml ``` -------------------------------- ### Helmwave Build and Deploy Commands Source: https://github.com/helmwave/docs/blob/main/docs/examples/pass-git-commit/README.md Commands to build Helmwave configurations and deploy them to a Kubernetes cluster. ```shell helmwave build helmwave up ``` ```shell helmwave up --build ``` -------------------------------- ### Execute Command Source: https://github.com/helmwave/docs/blob/main/docs/tpl.md The exec function runs a command and returns its standard output. Template rendering will fail if the command execution fails. ```go-template {{ $cmdOutpot := exec "./mycmd" (list "arg1" "arg2" "--flag1") }} ``` -------------------------------- ### Helmfile Final Configuration Source: https://github.com/helmwave/docs/blob/main/docs/examples/helmfile-migration/README.md The complete helmfile.yaml configuration. ```yaml {% include "./helmfile.yaml" %} ``` -------------------------------- ### Define Lifecycle Hook (Short Syntax) Source: https://github.com/helmwave/docs/blob/main/docs/yaml.md Use the short syntax to define a simple lifecycle hook, such as running an echo command before a build. ```yaml version: ⟨⟨ ver ⟩⟩ lifecycle: pre_build: - echo "run global pre_build script" ``` -------------------------------- ### Helmwave Configuration with Strictness Source: https://github.com/helmwave/docs/blob/main/docs/examples/values-strict-flag/README.md This configuration file demonstrates how Helmwave handles non-existent files when the strict flag is implicitly enabled. The tool will fail if the specified file is not found. ```yaml project: /helmwave/docs ``` -------------------------------- ### Helmwave Plan Directory Structure Source: https://github.com/helmwave/docs/blob/main/docs/plan.md This tree command shows the default directory structure for a Helmwave plan, illustrating the organization of charts, manifests, and values files. ```bash tree .helmwave .helmwave |____charts/ |____manifest | |____api@ns@context.yml | |____web@ns@context.yml |____values | |____api@ns@context | | |____cb18185ed7a1e8d2f06fc029708867eb.yml | |____web@ns@context | | |____63610d2dfb7f7427e17b6f3f58937161.yml |____charts | |____api@ns@context | | |____api-1.0.0.tgz | |____web@ns@context | | |____web-1.0.0.tgz |____planfile |____graph.md ``` -------------------------------- ### Helmwave Configuration Source: https://github.com/helmwave/docs/blob/main/docs/examples/built-in-release/README.md Defines the main Helmwave configuration file. ```yaml project: name: myproject releases: - name: a namespace: test chart: bitnami/nginx values: - src: "_.yml" ``` -------------------------------- ### Define Lifecycle Hook (Full Syntax) Source: https://github.com/helmwave/docs/blob/main/docs/yaml.md Configure a lifecycle hook with detailed parameters including command, arguments, whether to show output, and if failure is allowed. ```yaml version: ⟨⟨ ver ⟩⟩ lifecycle: pre_build: - cmd: echo args: - "run global pre_build script" show: true allow_failure: false ``` -------------------------------- ### Upload Plan to Private Environment Source: https://github.com/helmwave/docs/blob/main/docs/examples/private-env/README.md This placeholder indicates where a command to upload the built plan to a private environment would be placed. The actual command may vary. ```shell whatever you want ``` -------------------------------- ### Select Templater Engine Source: https://github.com/helmwave/docs/blob/main/docs/tpl.md Use this flag to select the template engine: 'sprig' or 'gomplate'. The default is 'sprig'. Environment variables HELMWAVE_TEMPLATER or HELMWAVE_TEMPLATE_ENGINE can also be used. ```shell --templater value Select template engine: sprig or gomplate (default: "sprig") [$HELMWAVE_TEMPLATER, $HELMWAVE_TEMPLATE_ENGINE] ``` -------------------------------- ### helmwave.yml Source: https://github.com/helmwave/docs/blob/main/docs/examples/helm-patch-with-kustomize/README.md Helmwave configuration file specifying the use of Kustomize for patching. ```yaml projects: - name: world helmwave: # Use kustomize for patching kustomize: path: ./kustomization.yaml values: - ./values.yml ``` -------------------------------- ### Nginx Deployment Template Snippet Source: https://github.com/helmwave/docs/blob/main/docs/examples/pass-git-commit/README.md A snippet from a Kubernetes deployment template showing where pod annotations are applied. ```yaml ... metadata: {{- with .Values.podAnnotations }} annotations: {{- toYaml . | nindent 8 }} {{- end }} ... ``` -------------------------------- ### Configure Helmwave Plugin for Manifest Generation Source: https://github.com/helmwave/docs/blob/main/docs/argocd.md Set up the helmwave-plugin within ArgoCD's CMP configuration to generate manifests. The output is directed to a log file and then concatenated. ```yaml configs: cmp: plugins: helmwave-plugin: generate: command: [ "/bin/ash", "-c" ] args: - | helmwave build &> /tmp/log.txt && find .helmwave/manifest -type f | xargs cat ``` -------------------------------- ### Diff Helmwave Plan Source: https://github.com/helmwave/docs/blob/main/docs/cli.md Compares the Helmwave plan with local manifest files to identify differences before deployment. ```shell helmwave diff plan ``` -------------------------------- ### Helmwave Configuration Files Source: https://github.com/helmwave/docs/blob/main/docs/examples/store-greeting-hello/README.md These YAML files define the Helmwave configuration and values. The `helmwave.yml` orchestrates the build, while `a.yml` and `b.yml` define specific values, with `a.yml` using a stored 'greeting'. ```yaml name: my-release values: - a.yml - b.yml store: greeting: hello ``` ```yaml image: repository: nginx greeting: {{ .Values.store.greeting }} ``` ```yaml image: tag: v1.0.0 message: hello world ```