### Example: Helm Install with Empty Value Alerts (Console) Source: https://github.com/vexxhost/atmosphere/blob/main/charts/rabbitmq-cluster-operator/charts/common/README.md Illustrates the command-line output when required values are forced to be empty during a Helm installation. It shows the specific error messages and instructions on how to set the values correctly, including exporting them from existing secrets. ```console helm install test mychart --set path.to.value00="",path.to.value01="" 'path.to.value00' must not be empty, please add '--set path.to.value00=$PASSWORD_00' to the command. To get the current value: export PASSWORD_00=$(kubectl get secret --namespace default secretName -o jsonpath="{.data.password-00}" | base64 -d) 'path.to.value01' must not be empty, please add '--set path.to.value01=$PASSWORD_01' to the command. To get the current value: export PASSWORD_01=$(kubectl get secret --namespace default secretName -o jsonpath="{.data.password-01}" | base64 -d) ``` -------------------------------- ### Clone Atmosphere Repository Source: https://github.com/vexxhost/atmosphere/blob/main/doc/source/quick-start.md Clones the Atmosphere project repository from GitHub to your local system. This is the first step before proceeding with the deployment. ```console $ git clone https://github.com/vexxhost/atmosphere ``` -------------------------------- ### Clone Atmosphere Repository (Console) Source: https://github.com/vexxhost/atmosphere/blob/main/doc/source/quick-start.md Clones the Atmosphere repository from GitHub and navigates into the atmosphere directory. This is a prerequisite for deployment. ```console $ git clone https://github.com/vexxhost/atmosphere.git $ cd atmosphere ``` -------------------------------- ### Deploy All-in-One Atmosphere with Open vSwitch (Console) Source: https://github.com/vexxhost/atmosphere/blob/main/doc/source/quick-start.md Deploys the all-in-one Atmosphere environment using the ML2/Open vSwitch plugin. This command should be run as root after cloning the repository. ```console $ tox -e molecule-aio-openvswitch ``` -------------------------------- ### List Networks using OpenStack CLI with SSO Source: https://github.com/vexxhost/atmosphere/blob/main/doc/source/quick-start.md Demonstrates how to list OpenStack networks using the CLI with SSO configured. It shows two methods: using the `--os-cloud` option or by setting the `OS_CLOUD` environment variable. ```console $ openstack --os-cloud atmosphere network list ``` ```console $ export OS_CLOUD=atmosphere $ openstack network list ``` -------------------------------- ### Install Dependencies for Atmosphere (Console) Source: https://github.com/vexxhost/atmosphere/blob/main/doc/source/quick-start.md Installs necessary dependencies like git and tox on Ubuntu 22.04. Ensure you are running these commands as root. ```console $ sudo -i $ apt-get update $ apt-get install git tox ``` -------------------------------- ### Run Atmosphere Playbook with Specific Tag (Keystone Example) Source: https://github.com/vexxhost/atmosphere/blob/main/doc/source/admin/upgrading.md Executes an Atmosphere playbook with a specific tag, providing granular control over the upgrade process. This example upgrades the Keystone service. Requires an Ansible inventory file (hosts.ini). ```bash $ ansible-playbook -i hosts.ini vexxhost.atmosphere.openstack --tags keystone ``` -------------------------------- ### Deploy All-in-One Atmosphere with OVN (Console) Source: https://github.com/vexxhost/atmosphere/blob/main/doc/source/quick-start.md Deploys the all-in-one Atmosphere environment using the ML2/OVN plugin. This command should be run as root after cloning the repository. ```console $ tox -e molecule-aio-ovn ``` -------------------------------- ### Install keystoneauth-websso Plugin Source: https://github.com/vexxhost/atmosphere/blob/main/doc/source/quick-start.md Installs the necessary `keystoneauth-websso` plugin using pip for Keycloak SSO integration with the OpenStack CLI. This is a prerequisite for using SSO with OpenStack. ```console $ pip install keystoneauth-websso ``` -------------------------------- ### Build and Deploy Atmosphere Heat Stack Source: https://github.com/vexxhost/atmosphere/blob/main/doc/source/quick-start.md Builds and deploys the Atmosphere Heat stack using tox and Molecule. This command initiates the creation of virtual machines and configuration for the Atmosphere cloud. ```console $ tox -e molecule-venv -- converge ``` -------------------------------- ### Node Setup Script Configuration for Local Path Provisioner Source: https://github.com/vexxhost/atmosphere/blob/main/charts/local-path-provisioner/README.md Configures the script to execute setup operations on each node. This script handles directory creation with specified permissions based on provided arguments for path, size, and volume mode. ```shell #!/bin/sh while getopts "m:s:p:" opt do case $opt in p) absolutePath=$OPTARG ;; s) sizeInBytes=$OPTARG ;; m) volMode=$OPTARG ;; esac done mkdir -m 0777 -p ${absolutePath} ``` -------------------------------- ### Helm Chart Installation with --set Arguments Source: https://github.com/vexxhost/atmosphere/blob/main/charts/rabbitmq-cluster-operator/README.md Demonstrates how to install or upgrade a Helm chart using the `--set` argument to override default values. This example disables liveness probes for the RabbitMQ cluster operator. Replace `REGISTRY_NAME` and `REPOSITORY_NAME` with your specific Helm chart registry and repository. ```console helm install my-release \ --set livenessProbe.enabled=false \ oci://REGISTRY_NAME/REPOSITORY_NAME/rabbitmq-cluster-operator ``` -------------------------------- ### Install Kubernetes Mixin and Dependencies Source: https://github.com/vexxhost/atmosphere/blob/main/roles/kube_prometheus_stack/files/jsonnet/vendor/github.com/kubernetes-monitoring/kubernetes-mixin/README.md Steps to clone the Kubernetes Mixin repository, navigate into it, and install its dependencies using jsonnet-bundler. ```bash git clone https://github.com/kubernetes-monitoring/kubernetes-mixin cd kubernetes-mixin jb install ``` -------------------------------- ### Install ksonnet Source: https://github.com/vexxhost/atmosphere/blob/main/roles/kube_prometheus_stack/files/jsonnet/vendor/github.com/kubernetes-monitoring/kubernetes-mixin/README.md Instructions to install a specific version of ksonnet using Homebrew, pinning it to prevent automatic updates. ```bash brew install https://raw.githubusercontent.com/ksonnet/homebrew-tap/82ef24cb7b454d1857db40e38671426c18cd8820/ks.rb brew pin ks ``` -------------------------------- ### Install Helm Chart with Values File Source: https://github.com/vexxhost/atmosphere/blob/main/charts/local-path-provisioner/README.md Installs the Helm chart using a values.yaml file to define configuration parameters. This method is recommended for managing complex configurations. ```console helm install --name local-path-storage --namespace local-path-storage ./deploy/chart/ -f values.yaml ``` -------------------------------- ### Install jsonnet-bundler and jsonnet Source: https://github.com/vexxhost/atmosphere/blob/main/roles/kube_prometheus_stack/files/jsonnet/vendor/github.com/kubernetes-monitoring/kubernetes-mixin/README.md Commands to install the jsonnet-bundler command-line tool and the jsonnet language interpreter, which are required for generating configuration files. ```bash go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@latest brew install jsonnet ``` -------------------------------- ### Configure PrometheusRule with Helm --set Source: https://github.com/vexxhost/atmosphere/blob/main/charts/keycloak/charts/postgresql/README.md Installs a Helm chart, setting specific parameters using the --set argument. This example demonstrates how to set the postgresPassword for a PostgreSQL deployment. Ensure you replace REGISTRY_NAME and REPOSITORY_NAME with your actual Helm chart references. ```console helm install my-release \ --set auth.postgresPassword=secretpassword oci://REGISTRY_NAME/REPOSITORY_NAME/postgresql ``` -------------------------------- ### Install mixtool and jsonnetfmt Source: https://github.com/vexxhost/atmosphere/blob/main/roles/kube_prometheus_stack/files/jsonnet/vendor/github.com/prometheus/mysqld_exporter/mysqld-mixin/README.md Installs the necessary tools, mixtool and jsonnetfmt, for using the MySQLd Mixin. This is typically done using Go's package management. ```bash go get github.com/monitoring-mixins/mixtool/cmd/mixtool go get github.com/google/go-jsonnet/cmd/jsonnetfmt ``` -------------------------------- ### Install doc-util with jb Source: https://github.com/vexxhost/atmosphere/blob/main/roles/kube_prometheus_stack/files/jsonnet/vendor/github.com/jsonnet-libs/docsonnet/doc-util/README.md This command installs the doc-util library using the 'jb' dependency manager. Ensure 'jb' is installed and configured for your project. ```bash jb install github.com/jsonnet-libs/docsonnet/doc-util@master ``` -------------------------------- ### Install Helm Chart with Custom Values Source: https://github.com/vexxhost/atmosphere/blob/main/charts/local-path-provisioner/README.md Installs the Helm chart with custom configuration values specified using the --set argument. This is useful for overriding default settings during installation. ```console helm install ./deploy/chart/ --name local-path-storage --namespace local-path-storage --set storageClass.provisionerName=rancher.io/local-path ``` -------------------------------- ### Install ksonnet Dependencies including Kubernetes Mixin Source: https://github.com/vexxhost/atmosphere/blob/main/roles/kube_prometheus_stack/files/jsonnet/vendor/github.com/kubernetes-monitoring/kubernetes-mixin/README.md Steps to initialize jsonnet-bundler and install the prometheus-ksonnet module, which includes the Kubernetes Mixin. ```bash go get github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb jb init jb install github.com/kausalco/public/prometheus-ksonnet ``` -------------------------------- ### Login to Atmosphere Controller Node Source: https://github.com/vexxhost/atmosphere/blob/main/doc/source/quick-start.md Logs into a specific Atmosphere controller node using the Molecule login command. Replace 'ctl1' with the desired controller node identifier. ```console $ tox -e molecule-venv -- login -h ctl1 ``` -------------------------------- ### Install Valkey using Helm Source: https://github.com/vexxhost/atmosphere/blob/main/charts/valkey/README.md This command installs the Valkey Helm chart with a specified release name. It assumes you have Helm and Kubernetes prerequisites met. Replace `my-release` with your desired release name. ```console helm install my-release oci://registry-1.docker.io/bitnamicharts/valkey ``` -------------------------------- ### Install Valkey with Existing PersistentVolumeClaim Source: https://github.com/vexxhost/atmosphere/blob/main/charts/valkey/README.md Install the Valkey chart using an existing PersistentVolumeClaim (PVC) by specifying the PVC name during the Helm installation. ```bash helm install my-release --set primary.persistence.existingClaim=PVC_NAME oci://REGISTRY_NAME/REPOSITORY_NAME/valkey ``` -------------------------------- ### Install Valkey with custom registry/repository Source: https://github.com/vexxhost/atmosphere/blob/main/charts/valkey/README.md This command installs the Valkey Helm chart, allowing you to specify a custom Helm chart registry and repository. Remember to replace `REGISTRY_NAME` and `REPOSITORY_NAME` with your actual values. ```console helm install my-release oci://REGISTRY_NAME/REPOSITORY_NAME/valkey ``` -------------------------------- ### Install Mixin with jsonnet-bundler Source: https://github.com/vexxhost/atmosphere/blob/main/roles/kube_prometheus_stack/files/jsonnet/vendor/github.com/kubernetes-monitoring/kubernetes-mixin/DESIGN.md Demonstrates how to use the jsonnet-bundler to install a mixin from a remote repository. This command downloads the mixin's code into the local vendor directory, making it available for import in jsonnet configurations. ```bash $ jb install kausal github.com/kausalco/public/consul-mixin ``` -------------------------------- ### Set up Python Virtual Environment and Install Dependencies Source: https://github.com/vexxhost/atmosphere/blob/main/doc/source/deploy/deployment.md This snippet demonstrates how to create a Python virtual environment named 'atmosphere-venv', activate it, and install project dependencies from a requirements file. It is a prerequisite for running the deployment scripts. ```bash python3 -m venv atmosphere-venv && source atmosphere-venv/bin/activate pip install -r atmosphere/requirements.txt ``` -------------------------------- ### Install xtd using jb Source: https://github.com/vexxhost/atmosphere/blob/main/roles/kube_prometheus_stack/files/jsonnet/vendor/github.com/jsonnet-libs/xtd/README.md This command installs the xtd library using the `jb` tool, which is a package manager for Jsonnet. Ensure `jb` is installed and configured in your project. ```console jb install github.com/jsonnet-libs/xtd ``` -------------------------------- ### Install Grafonnet Jsonnet Library Source: https://github.com/vexxhost/atmosphere/blob/main/roles/kube_prometheus_stack/files/jsonnet/vendor/github.com/grafana/grafonnet/gen/grafonnet-v11.4.0/docs/README.md This command installs the Grafonnet library, a Jsonnet library for rendering Grafana resources, using `jb install`. Ensure you have `jsonnet-bundler` installed. ```bash jb install github.com/grafana/grafonnet/gen/grafonnet-v11.4.0@main ``` -------------------------------- ### Install kube-state-metrics Helm Chart Source: https://github.com/vexxhost/atmosphere/blob/main/charts/kube-prometheus-stack/charts/kube-state-metrics/README.md Installs the kube-state-metrics Helm chart. Replace [RELEASE_NAME] with a desired name for the release. Additional flags can be used for customization. ```console helm install [RELEASE_NAME] prometheus-community/kube-state-metrics [flags] ``` -------------------------------- ### Install jsonnet-bundler and jsonnet Source: https://github.com/vexxhost/atmosphere/blob/main/roles/kube_prometheus_stack/files/jsonnet/vendor/github.com/povilasv/coredns-mixin/README.md Installs the jsonnet-bundler command-line tool and the jsonnet language interpreter using Go and Homebrew respectively. These tools are necessary for managing and building the monitoring mixin. ```bash go get github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb brew install jsonnet ``` -------------------------------- ### Install MinIO Helm Chart with a Values File Source: https://github.com/vexxhost/atmosphere/blob/main/charts/loki/charts/minio/README.md Installs the MinIO chart using a custom YAML values file. This method is useful for managing complex configurations or applying the same configuration across multiple installations. ```bash helm install --name my-release -f values.yaml minio/minio ``` -------------------------------- ### Install Keycloak using Helm Source: https://github.com/vexxhost/atmosphere/blob/main/charts/keycloak/README.md Installs the Keycloak chart using Helm. Replace `my-release` with your desired release name and `REGISTRY_NAME/REPOSITORY_NAME` with your Helm chart registry and repository. ```console helm install my-release oci://registry-1.docker.io/bitnamicharts/keycloak ``` ```console helm install my-release oci://REGISTRY_NAME/REPOSITORY_NAME/keycloak ``` -------------------------------- ### Example Kubernetes Ingress Resource Source: https://github.com/vexxhost/atmosphere/blob/main/charts/ingress-nginx/templates/NOTES.txt Defines an example Ingress resource for the ingress-nginx controller. It specifies rules for routing traffic to a service named 'exampleService' on port 80 for the host 'www.example.com'. This example also includes TLS configuration. ```yaml apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: example namespace: foo {{- if eq $isV1 false }} annotations: kubernetes.io/ingress.class: {{ .Values.controller.ingressClass }} {{- end }} spec: {{- if $isV1 }} ingressClassName: {{ .Values.controller.ingressClassResource.name }} {{- end }} rules: - host: www.example.com http: paths: - pathType: Prefix backend: service: name: exampleService port: number: 80 path: / # This section is only required if TLS is to be enabled for the Ingress tls: - hosts: - www.example.com secretName: example-tls ``` -------------------------------- ### Install Keycloak Helm Chart with Values File Source: https://github.com/vexxhost/atmosphere/blob/main/charts/keycloak/README.md Installs the Keycloak Helm chart using a custom values file. This approach is recommended for managing complex configurations and ensuring reproducibility. ```console helm install my-release -f values.yaml oci://REGISTRY_NAME/REPOSITORY_NAME/keycloak ``` -------------------------------- ### Install kube-prometheus-stack Helm Chart Source: https://github.com/vexxhost/atmosphere/blob/main/charts/kube-prometheus-stack/README.md Installs the kube-prometheus-stack Helm chart, deploying Prometheus, Grafana, and related components for Kubernetes monitoring. Requires a release name and the chart repository. ```console helm install [RELEASE_NAME] prometheus-community/kube-prometheus-stack ``` -------------------------------- ### Install Valkey with Existing PVC (Console) Source: https://github.com/vexxhost/atmosphere/blob/main/charts/valkey/README.md This command installs the Valkey Helm chart, reusing an existing PVC for persistence. It requires specifying the Helm chart location, authentication password, and the name of the existing PVC. Ensure you replace placeholders with your specific values. ```console helm install valkey oci://REGISTRY_NAME/REPOSITORY_NAME/valkey --set auth.password=[PASSWORD] --set primary.persistence.existingClaim=[EXISTING_PVC] ``` -------------------------------- ### Install Percona XtraDB Cluster using Helm Source: https://github.com/vexxhost/atmosphere/blob/main/charts/pxc-operator/README.md This command deploys the Percona XtraDB Cluster database using the official Helm chart. Ensure Helm is installed and configured correctly before running this command. The command installs the chart under the name 'my-db'. ```shell helm install my-db percona/pxc-db ``` -------------------------------- ### Initialize ksonnet Application and Environment Source: https://github.com/vexxhost/atmosphere/blob/main/roles/kube_prometheus_stack/files/jsonnet/vendor/github.com/kubernetes-monitoring/kubernetes-mixin/README.md Commands to initialize a new ksonnet application and add a default environment, copying credentials from the current Kubernetes context. ```bash ks init cd ks env add default ``` -------------------------------- ### Example Helper Pod YAML Source: https://github.com/vexxhost/atmosphere/blob/main/charts/local-path-provisioner/README.md Defines a simple Kubernetes Pod named 'helper-pod' using the 'busybox' image. This YAML snippet is an example of a configuration that might be managed by the Helm chart. ```yaml apiVersion: v1 kind: Pod metadata: name: helper-pod spec: containers: - name: helper-pod image: busybox ``` -------------------------------- ### Install and Delete Valkey Cluster Temporarily Source: https://github.com/vexxhost/atmosphere/blob/main/charts/valkey/README.md Install the Valkey cluster using Helm to create PVCs, then delete it. This prepares the environment for data restoration. ```bash helm install new-valkey -f values.yaml . --set cluster.enabled=true --set cluster.replicaCount=3 helm delete new-valkey ``` -------------------------------- ### Install Ansible Roles and Deploy Atmosphere Platform Source: https://github.com/vexxhost/atmosphere/blob/main/doc/source/deploy/deployment.md This snippet covers installing necessary Ansible roles from a requirements file and then executing the main Ansible playbook for deploying the Atmosphere platform. It requires an inventory file and specifies the user and become flags for execution. ```bash cd cloud-config ansible-galaxy install -r requirements.yml ansible-playbook -i inventory/hosts.ini -u ubuntu -b playbooks/site.yml ``` -------------------------------- ### Get Horizon Dashboard Hostname Source: https://github.com/vexxhost/atmosphere/blob/main/doc/source/quick-start.md Retrieves the hostname for the Horizon dashboard using `kubectl`. This command queries Kubernetes ingress resources to find the host associated with the dashboard service. ```console $ kubectl -n openstack get ingress/dashboard -ojsonpath='{.spec.rules[0].host}' ``` -------------------------------- ### Install Ansible Galaxy Collections Source: https://github.com/vexxhost/atmosphere/blob/main/doc/source/admin/upgrading.md Installs or updates Ansible collections based on the requirements.yml file. The --force flag ensures that the specified versions are installed, even if newer versions are already present. ```bash $ ansible-galaxy install -r requirements.yml --force ``` -------------------------------- ### Ansible Role Default Configuration Example Source: https://github.com/vexxhost/atmosphere/blob/main/CLAUDE.md Demonstrates the standard format for defining default variables in an Ansible role for the Atmosphere project. It includes a brief description, an optional commented example, and the default value. ```yaml # Brief description of what this does. # # my_var: # - name: example # key: value my_var: [] ``` -------------------------------- ### Example Certificate File Format Source: https://github.com/vexxhost/atmosphere/blob/main/charts/keycloak/README.md Demonstrates the expected format for certificate files in PEM format, which may include a certificate chain. ```text -----BEGIN CERTIFICATE----- MIID6TCCAtGgAwIBAgIJAIaCwivkeB5EMA0GCSqGSIb3DQEBCwUAMFYxCzAJBgNV ... jScrvkiBO65F46KioCL9h5tDvomdU1aqpI/CBzhvZn1c0ZTf87tGQR8NK7v7 -----END CERTIFICATE----- ``` -------------------------------- ### Install MinIO Helm Chart Source: https://github.com/vexxhost/atmosphere/blob/main/charts/loki/charts/minio/README.md Installs the MinIO chart on a Kubernetes cluster using Helm. It requires specifying the namespace, root user credentials, and optionally generates a release name. This is the primary command for deploying MinIO. ```bash helm install --namespace minio --set rootUser=rootuser,rootPassword=rootpass123 --generate-name minio/minio ``` -------------------------------- ### Defining Init Container Configuration Source: https://github.com/vexxhost/atmosphere/blob/main/charts/keycloak/README.md Shows an example of how to configure an init container, specifying its name, image, pull policy, and ports. ```yaml initContainers: - name: your-image-name image: your-image imagePullPolicy: Always ports: - name: portname containerPort: 1234 ``` -------------------------------- ### Helm Install with Configuration Parameters Source: https://github.com/vexxhost/atmosphere/blob/main/charts/ceph-csi-rbd/README.md Demonstrates how to install or upgrade a Helm chart and set specific configuration values using the --set flag. This is useful for overriding default settings or providing custom configurations during deployment. ```bash helm install --set configMapName=ceph-csi-config --set provisioner.podSecurityPolicy.enabled=true ``` -------------------------------- ### Destroy Atmosphere Heat Stack Source: https://github.com/vexxhost/atmosphere/blob/main/doc/source/quick-start.md Tears down and destroys the deployed Atmosphere Heat stack and associated resources. This command cleans up the environment after use. ```console $ tox -e molecule-venv -- destroy ``` -------------------------------- ### Update Ansible Collections Requirements Source: https://github.com/vexxhost/atmosphere/blob/main/doc/source/admin/upgrading.md Specifies the version of the vexxhost.atmosphere collection to use in the requirements.yml file. This ensures that the correct version of the collection is installed for the upgrade. ```yaml collections: - name: vexxhost.atmosphere version: X.Y.Z ``` -------------------------------- ### Helm Chart Installation with values.yaml Source: https://github.com/vexxhost/atmosphere/blob/main/charts/rabbitmq-cluster-operator/README.md Illustrates installing or upgrading a Helm chart by providing a YAML file containing custom values. This method is useful for managing complex configurations. Ensure `REGISTRY_NAME` and `REPOSITORY_NAME` are correctly substituted. ```console helm install my-release -f values.yaml oci://REGISTRY_NAME/REPOSITORY_NAME/rabbitmq-cluster-operator ``` -------------------------------- ### Get Ceph CSI RBD Chart Status Source: https://github.com/vexxhost/atmosphere/blob/main/charts/ceph-csi-rbd/README.md Retrieves the status of the installed ceph-csi-rbd Helm chart in the specified Kubernetes namespace. ```bash helm status --namespace "ceph-csi-rbd" "ceph-csi-rbd" ``` -------------------------------- ### Example Certificate Key File Format Source: https://github.com/vexxhost/atmosphere/blob/main/charts/keycloak/README.md Shows the expected format for private key files in PEM format, used in conjunction with certificate files. ```text -----BEGIN RSA PRIVATE KEY----- MIIEogIBAAKCAQEAvLYcyu8f3skuRyUgeeNpeDvYBCDcgq+LsWap6zbX5f8oLqp4 ... wrj2wDbCDCFmfqnSJ+dKI3vFLlEz44sAV8jX/kd4Y6ZTQhlLbYc= -----END RSA PRIVATE KEY----- ``` -------------------------------- ### Watch Loki Deployment Status (Bash) Source: https://github.com/vexxhost/atmosphere/blob/main/charts/loki/templates/NOTES.txt Command to monitor the deployment status of Loki pods in a specified namespace. Useful for observing the Helm chart installation process. ```bash kubectl get pods -w --namespace {{ $.Release.Namespace }} ``` -------------------------------- ### Authenticate and List OpenStack Networks Source: https://github.com/vexxhost/atmosphere/blob/main/doc/source/quick-start.md Authenticates to the OpenStack environment using local credentials by sourcing the openrc file and then lists available networks. This is a common task for managing OpenStack resources. ```bash source /root/openrc openstack network list ``` -------------------------------- ### Deploy Valkey Client Pod Source: https://github.com/vexxhost/atmosphere/blob/main/charts/valkey/templates/NOTES.txt Instructions to run a Valkey pod that can be used as a client for connecting to the Valkey server. ```bash To connect to your Valkey server: 1. Run a Valkey pod that you can use as a client: ``` -------------------------------- ### Apply ksonnet Configuration Source: https://github.com/vexxhost/atmosphere/blob/main/roles/kube_prometheus_stack/files/jsonnet/vendor/github.com/kubernetes-monitoring/kubernetes-mixin/README.md Command to apply the configured ksonnet environment to deploy the monitoring stack. ```bash ks apply default ``` -------------------------------- ### Ansible Inventory for StorPool CSI Source: https://github.com/vexxhost/atmosphere/blob/main/doc/source/deploy/csi.md This YAML snippet configures the StorPool CSI driver. It primarily involves setting the `csi_driver` to 'storpool' and specifying the `storpool_csi_template` to be used for the deployment, which is set to 'k8s' in the example. ```yaml csi_driver: storpool storpool_csi_template: k8s ``` -------------------------------- ### Configure OpenStack CLI for SSO Source: https://github.com/vexxhost/atmosphere/blob/main/doc/source/quick-start.md Creates a `clouds.yml` file to configure the OpenStack CLI for SSO authentication using Keycloak. This file specifies the authentication type, authorization URL, identity provider, and protocol. ```yaml clouds: atmosphere: auth_type: v3websso auth_url: https://identity.example.com identity_provider: atmosphere protocol: openid ``` -------------------------------- ### Query Logs from Loki (Curl and JQ) Source: https://github.com/vexxhost/atmosphere/blob/main/charts/loki/templates/NOTES.txt Example using curl to query logs from Loki and jq to parse the JSON response. It demonstrates querying by job label and supports authentication if enabled. ```bash curl "http://127.0.0.1:3100/loki/api/v1/query_range" --data-urlencode 'query={job="test"}' {{- if .Values.loki.auth_enabled }} -H X-Scope-OrgId:foo {{- end}} | jq .data.result ``` -------------------------------- ### Create a new package documentation Source: https://github.com/vexxhost/atmosphere/blob/main/roles/kube_prometheus_stack/files/jsonnet/vendor/github.com/jsonnet-libs/docsonnet/doc-util/README.md Shows how to document a package using 'package.new'. This function requires the package name, URL, and help text, with optional filename and version parameters. It's a shorthand for 'package.new'. ```jsonnet pkg(name, url, help, filename="", version="master") ``` -------------------------------- ### Configure RangeMap by Type (Jsonnet) Source: https://github.com/vexxhost/atmosphere/blob/main/roles/kube_prometheus_stack/files/jsonnet/vendor/github.com/grafana/grafonnet/gen/grafonnet-v11.4.0/docs/librarypanel/index.md Initializes a RangeMap configuration without specific options. This function is typically called to start a RangeMap setup, after which options like `withFrom`, `withTo`, and `withResult` can be chained to define the mapping behavior. ```jsonnet model.fieldConfig.defaults.mappings.RangeMap.withType() ``` -------------------------------- ### Initialize PostgreSQL Instance with Custom Scripts Source: https://github.com/vexxhost/atmosphere/blob/main/charts/keycloak/charts/postgresql/README.md Enables initialization of a fresh PostgreSQL instance using custom scripts. Scripts can be provided as a string via `primary.initdb.scripts`, or from an external ConfigMap using `primary.initdb.scriptsConfigMap`. Sensitive information can be handled with `primary.initdb.scriptsSecret`. Allowed script extensions are .sh, .sql, and .sql.gz. ```yaml # Example using scripts parameter (not a direct code snippet from text, but illustrative) primary: initdb: scripts: | echo "CREATE DATABASE my_db;" | psql -U postgres primary: initdb: scriptsConfigMap: "my-initdb-scripts" primary: initdb: scriptsSecret: "my-initdb-secrets" ``` -------------------------------- ### Send Logs to Loki (Curl) Source: https://github.com/vexxhost/atmosphere/blob/main/charts/loki/templates/NOTES.txt Example using curl to send log data to Loki via the push API. It demonstrates the required JSON format for log streams and values. Supports authentication if enabled. ```bash curl -H "Content-Type: application/json" -XPOST -s "http://127.0.0.1:3100/loki/api/v1/push" --data-raw "{\"streams\": [{\"stream\": {\"job\": \"test\"}, \"values\": [[\"$(date +%s)000000000\", \"fizzbuzz\"]]}]}" {{- if .Values.loki.auth_enabled }} -H X-Scope-OrgId:foo {{- end}} ``` -------------------------------- ### Run Specific Atmosphere Collection Playbook (Ceph Example) Source: https://github.com/vexxhost/atmosphere/blob/main/doc/source/admin/upgrading.md Executes a specific playbook provided by the Atmosphere Ansible collection, such as the Ceph playbook. This allows for targeted upgrades of specific components. Requires an Ansible inventory file (hosts.ini). ```bash $ ansible-playbook -i hosts.ini vexxhost.atmosphere.ceph ``` -------------------------------- ### Filter Data Source Instances with Regex (Jsonnet) Source: https://github.com/vexxhost/atmosphere/blob/main/roles/kube_prometheus_stack/files/jsonnet/vendor/github.com/grafana/grafonnet/gen/grafonnet-v11.4.0/docs/dashboard/variable.md The `datasource.withRegex` function filters which data source instances are available in the variable value list using a regular expression. For example, `/^prod/` would match data sources starting with 'prod'. ```jsonnet datasource.withRegex(value) ``` -------------------------------- ### Upgrade Prometheus Node Exporter and Helm Chart Source: https://github.com/vexxhost/atmosphere/blob/main/charts/kube-prometheus-stack/README.md Deletes the existing prometheus-node-exporter daemonset and then upgrades the kube-prometheus-stack Helm chart. This is required for versions of prometheus-node-exporter starting from 4.0.0 that use Kubernetes recommended labels. Ensure Helm is installed and configured. ```console kubectl delete daemonset -l app=prometheus-node-exporter helm upgrade -i kube-prometheus-stack prometheus-community/kube-prometheus-stack ``` -------------------------------- ### Run Tests Source: https://github.com/vexxhost/atmosphere/blob/main/roles/kube_prometheus_stack/files/jsonnet/vendor/github.com/kubernetes-monitoring/kubernetes-mixin/README.md Command to execute the test suite for the Kubernetes Mixin project. ```bash make test ``` -------------------------------- ### Create On-Demand Backup Custom Resource (YAML) Source: https://github.com/vexxhost/atmosphere/blob/main/doc/source/admin/database-backups.md These YAML examples define a Custom Resource for an on-demand Percona XtraDB Cluster backup. You need to specify the cluster name and the storage name that has been previously configured. ```yaml apiVersion: pxc.percona.com/v1 kind: PerconaXtraDBClusterBackup metadata: finalizers: # Finalizer can be set even if you use a persistent volume. - percona.com/delete-backup name: backup1-pvc spec: pxcCluster: percona-xtradb storageName: fs-pvc ``` ```yaml apiVersion: pxc.percona.com/v1 kind: PerconaXtraDBClusterBackup metadata: finalizers: - percona.com/delete-backup name: backup1-s3 spec: pxcCluster: percona-xtradb storageName: s3-bck ``` -------------------------------- ### Set Time Shift Source: https://github.com/vexxhost/atmosphere/blob/main/roles/kube_prometheus_stack/files/jsonnet/vendor/github.com/grafana/grafonnet/gen/grafonnet-v11.4.0/docs/panel/annotationsList/index.md Overrides the time range for individual panels by shifting their start and end times relative to the dashboard time picker. For example, `2h` shifts the panel's time range two hours earlier. This override is ineffective when the dashboard's time range is absolute. ```jsonnet queryOptions.withTimeShift(value) ``` -------------------------------- ### Create a new function documentation Source: https://github.com/vexxhost/atmosphere/blob/main/roles/kube_prometheus_stack/files/jsonnet/vendor/github.com/jsonnet-libs/docsonnet/doc-util/README.md Demonstrates creating documentation for a function using 'func.new'. This function takes a help string for description and an array of arguments. It's a shorthand for 'func.new'. ```jsonnet fn(help, args) ``` -------------------------------- ### Build Prometheus Configuration Files Source: https://github.com/vexxhost/atmosphere/blob/main/roles/kube_prometheus_stack/files/jsonnet/vendor/github.com/kubernetes-monitoring/kubernetes-mixin/README.md Commands to build Prometheus alert and rules files, as well as dashboard output files from the Kubernetes Mixin. ```bash make prometheus_alerts.yaml make prometheus_rules.yaml make dashboards_out ``` -------------------------------- ### Install Pre-commit Hook for Atmosphere Source: https://github.com/vexxhost/atmosphere/blob/main/README.md This command installs the commit message hook for pre-commit, a framework for managing and automating pre-commit hooks. Ensure pre-commit is installed in your environment before running this command. ```bash pre-commit install --hook-type commit-msg ``` -------------------------------- ### Install Memcached Mixin using Jsonnet Bundler Source: https://github.com/vexxhost/atmosphere/blob/main/roles/kube_prometheus_stack/files/jsonnet/vendor/github.com/grafana/jsonnet-libs/memcached-mixin/README.md This command installs the Memcached monitoring mixin using the Jsonnet Bundler tool. Ensure Jsonnet Bundler is installed before running this command. ```bash jb install github.com/grafana/jsonnet-libs/memcached-mixin ``` -------------------------------- ### Install Grafana Dashboards (CMake) Source: https://github.com/vexxhost/atmosphere/blob/main/roles/kube_prometheus_stack/files/jsonnet/vendor/github.com/ceph/ceph/monitoring/ceph-mixin/CMakeLists.txt Installs Grafana dashboards for Ceph if the WITH_GRAFANA option is enabled. It defines the installation directory and copies JSON dashboard files from a build output directory. ```cmake if(WITH_GRAFANA) set(CEPH_GRAFANA_DASHBOARDS_DIR "${CMAKE_INSTALL_SYSCONFDIR}/grafana/dashboards/ceph-dashboard" CACHE PATH "Location for grafana dashboards") file(GLOB CEPH_GRAFANA_DASHBOARDS "dashboards_out/*.json") install(FILES ${CEPH_GRAFANA_DASHBOARDS} DESTINATION ${CEPH_GRAFANA_DASHBOARDS_DIR}) endif() ``` -------------------------------- ### Panel Creation and Configuration Source: https://github.com/vexxhost/atmosphere/blob/main/roles/kube_prometheus_stack/files/jsonnet/vendor/github.com/grafana/grafonnet/gen/grafonnet-v11.4.0/docs/panel/logs/index.md This section details how to create and configure panels, including setting titles, names, and UIDs. ```APIDOC ## Panel Creation and Configuration ### Description Functions for creating and configuring panels, including setting their titles, names, and unique identifiers. ### Methods #### `fn new(title)` * **Description**: Creates a new logs panel with a specified title. * **Parameters**: * `title` (string) - Required - The title for the new panel. #### `obj libraryPanel` * **Description**: Object for configuring library panel properties. #### `fn libraryPanel.withName(value)` * **Description**: Sets the name of the library panel. * **Parameters**: * `value` (string) - Required - The name for the library panel. #### `fn libraryPanel.withUid(value)` * **Description**: Sets the unique identifier (UID) for the library panel. * **Parameters**: * `value` (string) - Required - The UID for the library panel. ``` -------------------------------- ### Run Full Atmosphere Site Upgrade Playbook Source: https://github.com/vexxhost/atmosphere/blob/main/doc/source/admin/upgrading.md Executes the main site playbook for Atmosphere, which typically orchestrates the entire upgrade process. Requires an Ansible inventory file (hosts.ini). ```bash $ ansible-playbook -i hosts.ini playbooks/site.yml ``` -------------------------------- ### Install Probes CRD for Prometheus Operator 0.40.x Source: https://github.com/vexxhost/atmosphere/blob/main/charts/kube-prometheus-stack/README.md Installs the Probes Custom Resource Definition (CRD) required for Prometheus Operator version 0.40.x and later. This manual installation is necessary before upgrading the Helm chart to versions that utilize this CRD. ```console kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/release-0.42/example/prometheus-operator-crd/monitoring.coreos.com_probes.yaml ``` -------------------------------- ### Connect to PostgreSQL using kubectl exec Source: https://github.com/vexxhost/atmosphere/blob/main/charts/keycloak/charts/postgresql/templates/NOTES.txt This snippet provides the `kubectl exec` command to connect to the PostgreSQL database. It includes logic to dynamically set the PGPASSWORD environment variable if authentication is enabled, and constructs the `psql` command with appropriate host, user, database, and port. ```go-template To connect to your database run the following command: {{- if $authEnabled }} kubectl run {{ include "common.names.fullname" . }}-client --rm --tty -i --restart='Never' --namespace {{ .Release.Namespace }} --image {{ include "postgresql.v1.image" . }} --env="PGPASSWORD=$POSTGRES_PASSWORD" \ --command -- psql --host {{ include "postgresql.v1.primary.fullname" . }} -U {{ default "postgres" $customUser }} -d {{- if include "postgresql.v1.database" . }} {{ include "postgresql.v1.database" . }}{{- else }} postgres{{- end }} -p {{ include "postgresql.v1.service.port" . }} {{- else }} kubectl run {{ include "common.names.fullname" . }}-client --rm --tty -i --restart='Never' --namespace {{ .Release.Namespace }} --image {{ include "postgresql.v1.image" . }} \ --command -- psql --host {{ include "postgresql.v1.primary.fullname" . }} -d {{- if include "postgresql.v1.database" . }} {{ include "postgresql.v1.database" . }}{{- else }} postgres{{- end }} -p {{ include "postgresql.v1.service.port" . }} {{- end }} > NOTE: If you access the container using bash, make sure that you execute "/opt/bitnami/scripts/postgresql/entrypoint.sh /bin/bash" in order to avoid the error "psql: local user with ID {{ .Values.primary.containerSecurityContext.runAsUser }}} does not exist" ``` -------------------------------- ### Configure Time Range Start Source: https://github.com/vexxhost/atmosphere/blob/main/roles/kube_prometheus_stack/files/jsonnet/vendor/github.com/grafana/grafonnet/gen/grafonnet-v11.4.0/docs/query/expr/TypeClassicConditions/index.md Sets the start time for the query's time range, defaulting to 'now-6h'. ```jsonnet timeRange.withFrom(value="now-6h") ``` -------------------------------- ### Check Database Process List (kubectl exec) Source: https://github.com/vexxhost/atmosphere/blob/main/doc/source/admin/monitoring.md This command executes a command within a specified pod to check the database's process list. This is useful for diagnosing database connection issues or performance bottlenecks that might be affecting the service. Replace ``, ``, and `` with appropriate values. ```console kubectl exec -it -n -- -e "SHOW PROCESSLIST;" ``` -------------------------------- ### Create Users After MinIO Installation Source: https://github.com/vexxhost/atmosphere/blob/main/charts/loki/charts/minio/README.md This snippet illustrates how to create MinIO users with specified access keys, secret keys, and policies during chart installation. It supports defining user credentials directly or referencing an existing Kubernetes secret for the secret key. Users can be assigned predefined policies. ```bash helm install --set users[0].accessKey=accessKey,users[0].secretKey=secretKey,users[0].policy=none,users[1].accessKey=accessKey2,users[1].secretRef=existingSecret,users[1].secretKey=password,users[1].policy=none minio/minio ``` -------------------------------- ### Set dashboard week start day Source: https://github.com/vexxhost/atmosphere/blob/main/roles/kube_prometheus_stack/files/jsonnet/vendor/github.com/grafana/grafonnet/gen/grafonnet-v11.4.0/docs/dashboard/index.md Configures the starting day of the week for the dashboard. This affects calendar views and date-related calculations. ```jsonnet withWeekStart(value) ``` -------------------------------- ### Install RabbitMQ Cluster Operator using Helm Source: https://github.com/vexxhost/atmosphere/blob/main/charts/rabbitmq-cluster-operator/README.md Installs the RabbitMQ Cluster Operator on a Kubernetes cluster using the Helm package manager. This command deploys the operator in the default configuration. Ensure you have Helm 3.8.0+ and Kubernetes 1.23+ installed. ```console helm install my-release oci://registry-1.docker.io/bitnamicharts/rabbitmq-cluster-operator ``` -------------------------------- ### Set fiscal year start month Source: https://github.com/vexxhost/atmosphere/blob/main/roles/kube_prometheus_stack/files/jsonnet/vendor/github.com/grafana/grafonnet/gen/grafonnet-v11.4.0/docs/dashboard/index.md Specifies the starting month of the fiscal year for the dashboard. The value is an integer where 0 represents January and 11 represents December. ```jsonnet withFiscalYearStartMonth(value=0) ``` -------------------------------- ### Apply Pod Security Admission Labels to Namespace Source: https://github.com/vexxhost/atmosphere/blob/main/charts/ingress-nginx/README.md This YAML example demonstrates how to apply labels to the `ingress-nginx` namespace to enable Pod Security Admission. It specifies enforcement levels and versions according to Kubernetes documentation. ```yaml apiVersion: v1 kind: Namespace metadata: name: ingress-nginx labels: kubernetes.io/metadata.name: ingress-nginx name: ingress-nginx pod-security.kubernetes.io/enforce: restricted pod-security.kubernetes.io/enforce-version: v1.31 ``` -------------------------------- ### Create New Panel Source: https://github.com/vexxhost/atmosphere/blob/main/roles/kube_prometheus_stack/files/jsonnet/vendor/github.com/grafana/grafonnet/gen/grafonnet-v11.4.0/docs/panel/pieChart/index.md Initializes a new panel with a specified title. This is the starting point for configuring a panel's properties and behavior. ```typescript fn new(title: string): Panel; ``` -------------------------------- ### Verify PostgreSQL Deployment Logs (kubectl) Source: https://github.com/vexxhost/atmosphere/blob/main/charts/keycloak/charts/postgresql/README.md This command retrieves the logs from the primary PostgreSQL pod. Successful deployment with persisted data is indicated by specific log messages. ```console $ kubectl logs $(kubectl get pods -l app.kubernetes.io/instance=postgresql,app.kubernetes.io/name=postgresql,role=primary -o jsonpath="{.items[0].metadata.name}") ... postgresql 08:05:12.59 INFO ==> Deploying PostgreSQL with persisted data... ... ``` ```console $ kubectl logs $(kubectl get pods -l app.kubernetes.io/instance=postgresql,app.kubernetes.io/name=postgresql,role=master -o jsonpath="{.items[0].metadata.name}") ... postgresql 08:05:12.59 INFO ==> Deploying PostgreSQL with persisted data... ... ``` -------------------------------- ### Create Buckets After MinIO Installation Source: https://github.com/vexxhost/atmosphere/blob/main/charts/loki/charts/minio/README.md This snippet demonstrates how to configure the MinIO Helm chart to create specific buckets upon installation. It uses the `--set` parameter to define bucket names, policies, and purge behavior. Each bucket requires a name, and optionally a policy and purge setting. ```bash helm install --set buckets[0].name=bucket1,buckets[0].policy=none,buckets[0].purge=false minio/minio ``` -------------------------------- ### Create a new object documentation Source: https://github.com/vexxhost/atmosphere/blob/main/roles/kube_prometheus_stack/files/jsonnet/vendor/github.com/jsonnet-libs/docsonnet/doc-util/README.md Illustrates creating documentation for an object using 'object.new'. This function accepts a help string for the object's description and an object defining its fields. It's a shorthand for 'object.new'. ```jsonnet obj(help, fields) ```