### Installing CNDI on Windows Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/eks/airflow.md This PowerShell command installs CNDI on Windows systems. It uses 'irm' (Invoke-RestMethod) to download the installation script from the official GitHub repository and 'iex' (Invoke-Expression) to execute it, streamlining the setup process for Windows users. ```powershell irm https://raw.githubusercontent.com/polyseam/cndi/main/install.ps1 | iex ``` -------------------------------- ### Installing CNDI on macOS and Linux Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/dev/airflow.md This command downloads and executes the CNDI installation script for macOS and Linux systems. It uses `curl` to fetch the script from GitHub and pipes it to `sh` for execution, providing a quick and straightforward way to get CNDI set up on Unix-like environments. ```bash curl -fsSL https://raw.githubusercontent.com/polyseam/cndi/main/install.sh | sh ``` -------------------------------- ### Installing CNDI on Windows Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/aks/airflow.md This PowerShell command installs CNDI on Windows by invoking a web request to download the installation script from the official GitHub repository and then executing it. This method streamlines the setup process for Windows users. ```powershell irm https://raw.githubusercontent.com/polyseam/cndi/main/install.ps1 | iex ``` -------------------------------- ### Setting Up CNDI Development Alias (Bash) Source: https://github.com/polyseam/cndi/blob/main/docs/contributing.md This alias allows developers to run the CNDI CLI directly from the source code using Deno, without conflicting with the globally installed `cndi` binary. It executes the `main.ts` file with all permissions (`-A`) using Deno. Users must adjust the path to `main.ts` to match their local repository location. ```bash alias cndi-next="deno run -A ~/dev/polyseam/cndi/main.ts" ``` -------------------------------- ### Downloading CNDI for macOS and Linux Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/aks/cnpg.md This command downloads and executes the CNDI installation script for macOS and Linux systems using `curl`. It fetches the script from the official GitHub repository and pipes it directly to the `sh` shell for execution, automating the CNDI setup. ```bash curl -fsSL https://raw.githubusercontent.com/polyseam/cndi/main/install.sh | sh ``` -------------------------------- ### Installing CNDI on Windows with PowerShell Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/gke/airflow.md This PowerShell command installs CNDI on Windows. It uses `irm` (Invoke-RestMethod) to download the installation script from GitHub and `iex` (Invoke-Expression) to execute it, streamlining the installation process for Windows users. ```powershell irm https://raw.githubusercontent.com/polyseam/cndi/main/install.ps1 | iex ``` -------------------------------- ### Installing CNDI on Windows Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/eks/pgvector-cnpg.md This PowerShell command installs CNDI on Windows. It uses `irm` (Invoke-RestMethod) to download the installation script from the official GitHub repository and `iex` (Invoke-Expression) to execute it, streamlining the setup process for Windows users. ```powershell irm https://raw.githubusercontent.com/polyseam/cndi/main/install.ps1 | iex ``` -------------------------------- ### Downloading CNDI for macOS and Linux Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/gke/cnpg.md This command downloads and executes the CNDI installation script for macOS and Linux systems. It uses `curl` to fetch the script from the official GitHub repository and pipes it directly to `sh` for execution, facilitating a quick setup of the CNDI CLI. ```bash curl -fsSL https://raw.githubusercontent.com/polyseam/cndi/main/install.sh | sh ``` -------------------------------- ### Downloading CNDI for Windows Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/eks/cnpg.md This PowerShell command downloads and executes the CNDI installation script for Windows. It uses `irm` (Invoke-RestMethod) to fetch the script from the official GitHub repository and `iex` (Invoke-Expression) to run it, facilitating CNDI installation on Windows. ```powershell irm https://raw.githubusercontent.com/polyseam/cndi/main/install.ps1 | iex ``` -------------------------------- ### Installing CNDI on Windows Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/gke/pgvector-cnpg.md This PowerShell command installs CNDI on Windows. It uses 'irm' (Invoke-RestMethod) to download the installation script from the CNDI GitHub repository and 'iex' (Invoke-Expression) to execute it, facilitating the setup process on Windows environments. ```powershell irm https://raw.githubusercontent.com/polyseam/cndi/main/install.ps1 | iex ``` -------------------------------- ### Downloading CNDI Executable (Bash) Source: https://github.com/polyseam/cndi/blob/main/demo.md This command downloads and executes the CNDI installation script from the official GitHub repository. It uses `curl` to fetch the script securely and pipes its output directly to `sh` for execution. For Windows users, it is recommended to run this command within a 'git bash' environment. ```bash curl -fsSL https://raw.githubusercontent.com/polyseam/cndi/main/install.sh | sh ``` -------------------------------- ### Installing CNDI on Windows Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/dev/airflow.md This PowerShell command installs CNDI on Windows by invoking a remote script. It uses `irm` (Invoke-RestMethod) to download the installation script from GitHub and `iex` (Invoke-Expression) to execute it, streamlining the installation process for Windows users. ```powershell irm https://raw.githubusercontent.com/polyseam/cndi/main/install.ps1 | iex ``` -------------------------------- ### Creating a CNDI Project and Navigating to its Directory (Shell) Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/eks/cnpg.md This command initializes a new CNDI project by cloning the specified repository (`polyseam/my-cndi-cluster` in this example) and then changes the current directory into the newly created project folder. It's the first step in setting up a CNDI-managed cluster, followed by a series of interactive configuration prompts. ```Shell cndi create polyseam/my-cndi-cluster && cd my-cndi-cluster ``` -------------------------------- ### Installing CNDI on Windows Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/aks/pgvector-cnpg.md This PowerShell command installs CNDI on Windows. It uses `irm` (Invoke-RestMethod) to download the installation script from the official GitHub repository and `iex` (Invoke-Expression) to execute it, facilitating the setup of the CNDI tool on Windows. ```powershell irm https://raw.githubusercontent.com/polyseam/cndi/main/install.ps1 | iex ``` -------------------------------- ### Installing CNDI on macOS and Linux Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/eks/airflow.md This command downloads and executes the CNDI installation script for macOS and Linux systems. It uses 'curl' to fetch the script from the official GitHub repository and pipes it directly to 'sh' for execution, providing a quick and easy way to set up CNDI. ```bash curl -fsSL https://raw.githubusercontent.com/polyseam/cndi/main/install.sh | sh ``` -------------------------------- ### Installing CNDI on macOS and Linux Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/gke/airflow.md This command downloads and executes the CNDI installation script for macOS and Linux systems. It uses `curl` to fetch the script from GitHub and pipes it directly to `sh` for execution, providing a quick and easy way to set up CNDI. ```bash curl -fsSL https://raw.githubusercontent.com/polyseam/cndi/main/install.sh | sh ``` -------------------------------- ### Installing CNDI on macOS and Linux Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/aks/pgvector-cnpg.md This command downloads and executes the CNDI installation script for macOS and Linux systems. It uses `curl` to fetch the script from the official GitHub repository and pipes it to `sh` for execution, enabling quick setup of the CNDI tool. ```bash curl -fsSL https://raw.githubusercontent.com/polyseam/cndi/main/install.sh | sh ``` -------------------------------- ### Committing and Pushing Initial CNDI Project to GitHub Source: https://github.com/polyseam/cndi/blob/main/blocks/common/clusterless/core-readme.md These standard Git commands are used to stage all local changes, create an initial commit with a descriptive message, and push the committed changes to the 'main' branch of the remote GitHub repository. Pushing to 'main' automatically triggers the CNDI deployment workflow configured in .github/workflows/cndi-run.yaml. ```bash git add . git commit -m "initial commit" git push ``` -------------------------------- ### Downloading CNDI for Windows Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/aks/cnpg.md This PowerShell command downloads and executes the CNDI installation script for Windows. It uses `Invoke-RestMethod` (irm) to fetch the script from the official GitHub repository and `Invoke-Expression` (iex) to run it, facilitating the CNDI installation on Windows. ```powershell irm https://raw.githubusercontent.com/polyseam/cndi/main/install.ps1 | iex ``` -------------------------------- ### Downloading CNDI for macOS and Linux Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/eks/cnpg.md This command downloads and executes the CNDI installation script for macOS and Linux systems. It uses `curl` to fetch the script from the official GitHub repository and pipes it directly to `sh` for execution, providing a quick way to install CNDI. ```bash curl -fsSL https://raw.githubusercontent.com/polyseam/cndi/main/install.sh | sh ``` -------------------------------- ### Deploying Local MicroK8s Cluster with CNDI Source: https://github.com/polyseam/cndi/blob/main/blocks/dev/microk8s.md This command initiates the deployment of a local development cluster using CNDI, which leverages Multipass to create a virtual machine with MicroK8s installed and deploys the defined workload. ```bash cndi run ``` -------------------------------- ### Installing CNDI on macOS and Linux Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/aks/airflow.md This command downloads and executes the CNDI installation script for macOS and Linux systems. It fetches the script from the official GitHub repository and pipes it directly to the shell for execution, providing a convenient way to set up CNDI. ```bash curl -fsSL https://raw.githubusercontent.com/polyseam/cndi/main/install.sh | sh ``` -------------------------------- ### Downloading CNDI for Windows Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/gke/cnpg.md This PowerShell command downloads and executes the CNDI installation script specifically for Windows operating systems. It uses `irm` (Invoke-RestMethod) to retrieve the script from the GitHub repository and `iex` (Invoke-Expression) to run it, enabling CNDI CLI installation on Windows. ```powershell irm https://raw.githubusercontent.com/polyseam/cndi/main/install.ps1 | iex ``` -------------------------------- ### Installing CNDI on Windows using PowerShell Source: https://github.com/polyseam/cndi/blob/main/docs/install.md This PowerShell command installs CNDI on Windows. It uses `irm` (Invoke-RestMethod) to download the `install.ps1` script from the CNDI GitHub repository and pipes it to `iex` (Invoke-Expression) for immediate execution, handling the installation process. ```PowerShell irm https://raw.githubusercontent.com/polyseam/cndi/main/install.ps1 | iex ``` -------------------------------- ### Cloning CNDI Repository (Bash) Source: https://github.com/polyseam/cndi/blob/main/docs/contributing.md This command clones the CNDI GitHub repository to your local machine. It requires the GitHub CLI (`gh`) to be installed and configured. The cloned repository will contain the source code for the CNDI project, which is essential for local development. ```bash gh repo clone polyseam/cndi ``` -------------------------------- ### Installing CNDI on macOS and Linux using cURL Source: https://github.com/polyseam/cndi/blob/main/docs/install.md This script downloads and executes the CNDI installation script for macOS and Linux. It uses `curl` to fetch the `install.sh` script from the CNDI GitHub repository and pipes it directly to `sh` for execution, automating the binary download and PATH configuration. ```Bash curl -fsSL https://raw.githubusercontent.com/polyseam/cndi/main/install.sh | sh ``` -------------------------------- ### Creating a New CNDI Project with CLI (Bash) Source: https://github.com/polyseam/cndi/blob/main/README.md This command initializes a new CNDI project by creating a repository based on a specified template and then navigates into the newly created project directory. It requires the CNDI CLI to be installed and configured. The / placeholder should be replaced with the desired template's owner and repository name. ```bash cndi create / && cd ``` -------------------------------- ### Installing CNDI on macOS and Linux Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/eks/pgvector-cnpg.md This command downloads and executes the CNDI installation script for macOS and Linux systems. It uses `curl` to fetch the script from the official GitHub repository and pipes it directly to `sh` for execution, providing a quick way to set up the CNDI tool. ```bash curl -fsSL https://raw.githubusercontent.com/polyseam/cndi/main/install.sh | sh ``` -------------------------------- ### Installing CNDI on macOS and Linux Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/gke/pgvector-cnpg.md This command downloads and executes the CNDI installation script for macOS and Linux systems. It uses 'curl' to fetch the script from the official GitHub repository and pipes it to 'sh' for execution, performing a silent and fast installation. ```bash curl -fsSL https://raw.githubusercontent.com/polyseam/cndi/main/install.sh | sh ``` -------------------------------- ### Creating a CNDI Cluster with `cndi create` Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/eks/airflow.md This snippet demonstrates an interactive session of the `cndi create` command, used to initialize a new CNDI project. It guides the user through selecting a template (Airflow), deployment target (AWS EKS), configuring Git credentials, DNS settings, AWS access details, and domain names for ArgoCD and Airflow, ultimately creating a new cluster repository. ```shell cndi create polyseam/my-cndi-cluster Please confirm the destination directory for your CNDI project: » (C:\Users\Taylor\polyseam\my-cndi-cluster) Please enter a name for your CNDI project: (my-cndi-cluster) » my-cndi-cluster Pick a template » airflow Where do you want to deploy your cluster? » aws Select a distribution » eks Would you like ArgoCD to connect to your repo using a Git token or SSH key? » token What is your git username? () » IamTamika Please enter your Git Personal Access Token: () » **************************** Please enter your Git Repo URL: () » What email address should be used for Lets Encrypt certificate registration? » tamika.taylor@untribe.com Would you like to enable external-dns for automatic DNS management? (Y/n) » Yes Please select your DNS provider (aws) » aws Please enter your AWS Access Key ID: () » ***************** Please enter your AWS Secret Access Key: () » ****************** Please enter your AWS Region: (us-east-1) » us-east-1 Do you want to expose ArgoCD with an Ingress? (Y/n) » Yes What hostname should ArgoCD be accessible at? » argocd.untribe.com Do you want to expose the Airflow UI to the web? (Y/n) » Yes What hostname should Airflow be accessible at? » airflow.untribe.com What is the URL of the Git repository containing your Airflow DAGs? (https://github.com/polyseam/demo-dag-bag) » https://github.com/polyseam/demo-dag-bag Do you want to use your cluster credentials for Airflows Git Sync? (Y/n) » Yes created cndi cluster repo at https://github.com/polyseam/my-cndi-cluster ``` -------------------------------- ### Setting GitHub Actions Secrets from .env File Source: https://github.com/polyseam/cndi/blob/main/blocks/common/clusterless/core-readme.md This Bash command leverages the GitHub CLI to securely transfer environment variables defined in the local .env file directly into GitHub Actions encrypted secrets. This step is crucial for providing necessary credentials and configurations to your CI/CD workflows without exposing them in the repository. ```bash gh secret set -f .env ``` -------------------------------- ### Selecting the Airflow Template Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/aks/airflow.md This prompt allows the user to select a pre-defined template for the CNDI project. The `airflow` template is highlighted, indicating it's the recommended choice for this guide. ```shell "Pick a template" basic ❯ airflow cnpg neo4j mssqlserver ``` -------------------------------- ### Installing CNDI CLI on Windows (PowerShell) Source: https://github.com/polyseam/cndi/blob/main/README.md This command installs the CNDI CLI on Windows systems using PowerShell. It utilizes irm (Invoke-RestMethod) to download the installation script from the official GitHub repository and iex (Invoke-Expression) to execute it. This method requires PowerShell to be installed and configured on the Windows machine. ```powershell irm https://raw.githubusercontent.com/polyseam/cndi/main/install.ps1 | iex ``` -------------------------------- ### Example CNDI Configuration File Source: https://github.com/polyseam/cndi/blob/main/docs/config.md This comprehensive example of a `cndi_config.yaml` file demonstrates how to define a Kubernetes cluster's desired state. It includes configurations for infrastructure components such as Azure AKS nodes, cert-manager, external-dns, ArgoCD, and Grafana for observability. Additionally, it specifies Kubernetes cluster manifests for a WordPress Ingress, WordPress password secret, WordPress namespace, and an ExternalDNS secret, along with the deployment of a WordPress application via Helm. ```YAML project_name: wordpress-cluster cndi_version: v2 provider: azure distribution: aks infrastructure: cndi: nodes: # ./docs/config/infrastructure/cndi/nodes.md - name: wordpress-nodes count: 3 instance_type: Standard_D2_v2 cert_manager: # ./docs/config/infrastructure/cndi/cert_manager.md email: jane.smith@example.com external_dns: provider: azure argocd: # ./docs/config/infrastructure/cndi/argocd.md hostname: argocd.my-cluster.example.com observability: # ./docs/config/infrastructure/cndi/observability.md grafana: hostname: observability.my-cluster.example.com cluster_manifests: # ./docs/config/cluster_manifests.md wordpress-ingress: # https://kubernetes.io/docs/concepts/services-networking/ingress/ wp-ingress: kind: Ingress apiVersion: networking.k8s.io/v1 metadata: name: wordpress-ingress namespace: wordpress annotations: cert-manager.io/cluster-issuer: cluster-issuer kubernetes.io/tls-acme: "true" nginx.ingress.kubernetes.io/backend-protocol: HTTPS external-dns.alpha.kubernetes.io/hostname: wordpress.my-cluster.example.com spec: ingressClassName: public tls: - hosts: - wordpress.my-cluster.example.com secretName: cluster-issuer-private-key rules: - host: wordpress.my-cluster.example.com http: paths: - path: / pathType: ImplementationSpecific backend: service: name: wordpress port: number: 443 wordpress-secret: # https://kubernetes.io/docs/concepts/configuration/secret/ apiVersion: v1 kind: Secret metadata: name: wordpress-pw namespace: wordpress stringData: wordpress-password: $cndi_on_ow.seal_secret_from_env_var(WORDPRESS_PASSWORD) wordpress-ns: # https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ apiVersion: v1 kind: Namespace metadata: name: wordpress external-dns-secret: # https://kubernetes.io/docs/concepts/configuration/secret/ apiVersion: v1 kind: Secret metadata: name: external-dns namespace: external-dns stringData: # credentials in JSON string in .env used to modify DNS records azure.json: $cndi_on_ow.seal_secret_from_env_var(AZURE_CREDENTIALS) applications: # ./docs/config/applications.md wordpress: repoURL: https://charts.bitnami.com/bitnami chart: wordpress targetRevision: 23.1.17 destinationNamespace: wordpress values: existingSecret: wordpress-pw wordpressUsername: admin ``` -------------------------------- ### Installing CNDI CLI on Mac/Linux (Bash) Source: https://github.com/polyseam/cndi/blob/main/README.md This command downloads and executes the CNDI installation script for Unix-like systems (macOS, Linux). It uses curl to fetch the script from the official GitHub repository and pipes it directly to sh for execution. This method requires curl to be available on the system. ```bash curl -fsSL https://raw.githubusercontent.com/polyseam/cndi/main/install.sh | sh ``` -------------------------------- ### Selecting the Airflow Template during CNDI Project Creation Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/eks/airflow.md This snippet shows the interactive prompt for selecting a project template during the 'cndi create' process. The user is guided to choose the 'airflow' template, which pre-configures the cluster for Airflow deployments. ```shell "Pick a template" basic ❯ airflow cnpg neo4j mssqlserver ``` -------------------------------- ### Port-Forwarding ArgoCD UI to Local Machine (Bash) Source: https://github.com/polyseam/cndi/blob/main/blocks/dev/microk8s.md This command forwards the ArgoCD server service from the MicroK8s cluster to the local machine. It uses `multipass exec` to run `kubectl port-forward` on the VM, mapping port 443 (ArgoCD) to local port 8080, accessible via the previously obtained `$NODE_IP`. ```bash multipass exec my-project-node -- sudo microk8s kubectl port-forward svc/argocd-server -n argocd 8080:443 --address $NODE_IP ``` -------------------------------- ### Port-Forwarding Generic Service to Local Machine (Bash) Source: https://github.com/polyseam/cndi/blob/main/blocks/dev/microk8s.md This command demonstrates how to port-forward any service running in the MicroK8s cluster to the local machine. Users need to substitute `my-service` with the actual service name and `my-namespace` with its namespace, mapping the service's internal port (e.g., 80) to a local port (e.g., 8080). ```bash multipass exec my-project-node -- sudo microk8s kubectl port-forward svc/my-service -n my-namespace 8080:80 --address $NODE_IP ``` -------------------------------- ### Defining Extra Output Files with `outputs` in CNDI Templates (YAML) Source: https://github.com/polyseam/cndi/blob/main/docs/template-authoring.md This YAML snippet illustrates the `outputs` section, specifically the `extra_files` property, which allows defining additional files to be generated during project creation. It shows two examples: `my-file.txt` with multiline inline content and `some-other/file.json` whose content is fetched from a URL, providing flexibility for including various types of supplementary files. ```YAML # eg. outputs: extra_files: ./my-file.txt: | This is the multiline content of my file ./some-other/file.json: https://example.com/some-other-file.json ``` -------------------------------- ### Defining Kubernetes Manifests in cndi_config.yaml Source: https://github.com/polyseam/cndi/blob/main/docs/config/cluster_manifests.md This YAML snippet illustrates how to define Kubernetes manifests within the `cluster_manifests` section of `cndi_config.yaml`. It includes an example of a standard `Namespace` resource (`wp-ns`) and a `Secret` resource (`wordpress-secret`). The `Secret` resource demonstrates the required `$cndi_on_ow.seal_secret_from_env_var(VAR_NAME)` syntax for secure encryption and automatic conversion to a `SealedSecret` by `cndi ow`. ```yaml infrastructure: { ... } applications: { ... } cluster_manifests: wp-ns: # typical resource, written to ./cndi/cluster_manifests/wp-ns.yaml apiVersion: v1 kind: Namespace metadata: name: wordpress wordpress-secret: # secret resource, written to ./cndi/cluster_manifests/wordpress-secret.yaml as kind: SealedSecret apiVersion: v1 kind: Secret metadata: name: wp-secret namespace: wordpress stringData: wordpress-password: $cndi_on_ow.seal_secret_from_env_var(WORDPRESS_PASSWORD) ``` -------------------------------- ### Full Interactive CNDI Project Creation Walkthrough Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/aks/airflow.md This comprehensive snippet demonstrates a complete interactive session of the `cndi create` command, showing all prompts and typical user inputs for setting up an Airflow cluster on Azure AKS, including Git, DNS, and Azure credential configurations. ```shell cndi create polyseam/my-cndi-cluster Please confirm the destination directory for your CNDI project: » (C:\Users\Taylor\polyseam\my-cndi-cluster) Please enter a name for your CNDI project: (my-cndi-cluster) » my-cndi-cluster Pick a template » airflow Where do you want to deploy your cluster? » azure Select a distribution » aks Would you like ArgoCD to connect to your repo using a Git token or SSH key? » token What is your git username? () » IamTamika Please enter your Git Personal Access Token: () » **************************** Please enter your Git Repo URL: () » What email address should be used for Lets Encrypt certificate registration? » tamika.taylor@untribe.com Would you like to enable external-dns for automatic DNS management? (Y/n) » Yes Please select your DNS provider (azure) » azure Please enter your Azure Subscription ID: () » ***************** Please enter your Azure Client ID: () » ****************** Please enter your Azure Client Secret: () » ***************** Please enter your Azure Tenant ID: () » ****************** Please enter your Azure Region: (us-east-1) » us-east-1 ``` -------------------------------- ### Creating a CNDI Project and Navigating to its Directory (Shell) Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/gke/cnpg.md This command initializes a new CNDI project by cloning a specified repository template and then changes the current directory into the newly created project folder. It's the first step in setting up a CNDI-managed infrastructure, followed by a series of interactive prompts to configure the project. ```shell cndi create polyseam/my-cndi-cluster && cd my-cndi-cluster ``` -------------------------------- ### Initializing CNDI Project with a Template Source: https://github.com/polyseam/cndi/blob/main/src/use-template/README.md This shell command initializes a new CNDI repository using the `basic.yaml` template from a remote URL. The `--interactive` flag enables an interactive prompt experience, and `--create` instructs CNDI to create a new GitHub repository for managing the cluster. ```Shell cndi init --interactive --template https://raw.githubusercontent.com/cndi/templates/main/basic.yaml --create ``` -------------------------------- ### Minimal CNDI Node Configuration for AWS EKS Source: https://github.com/polyseam/cndi/blob/main/docs/config/infrastructure/cndi/nodes.md This YAML snippet demonstrates a minimal configuration for the 'nodes' block within a CNDI infrastructure setup. It defines a node group named 'my-node-group' with 3 't3.medium' instances, each having a 100GB disk, intended for an AWS EKS cluster. It also shows commented-out examples for applying labels and taints to nodes. ```yaml project_name: my-cluster cndi_version: v2 provider: aws distribution: eks infrastructure: cndi: nodes: - name: my-node-group count: 3 instance_type: t3.medium disk_size: 100 # labels: # foo: bar # taints: # - key: "dedicated" # value: "special" # effect: "NoSchedule" ``` -------------------------------- ### Initializing a CNDI Project with `cndi create` Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/aks/airflow.md This command initializes a new CNDI project, creating a directory named `my-cndi-cluster` and then navigating into it. It's the first step in setting up a new CNDI cluster. ```shell cndi create polyseam/my-cndi-cluster && cd my-cndi-cluster ``` -------------------------------- ### Full Interactive CNDI Project Initialization Session Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/gke/airflow.md This comprehensive log captures the complete interactive session for initializing a CNDI project. It demonstrates the sequence of prompts and user inputs required to configure the cluster, including project name, template, deployment target, and various service-specific settings. ```shell cndi create polyseam/my-cndi-cluster Please confirm the destination directory for your CNDI project: » (C:\Users\Taylor\polyseam\my-cndi-cluster) Please enter a name for your CNDI project: (my-cndi-cluster) » my-cndi-cluster Pick a template » airflow Where do you want to deploy your cluster? » gcp Select a distribution » gke Please in your GCP Region: us-central1 Please enter the path GCP credentials JSON to your () » ~/polyseam/gcp-testing.json Would you like ArgoCD to connect to your repo using a Git token or SSH key? » token What is your git username? () » IamTamika Please enter your Git Personal Access Token: () » **************************** Please enter your Git Repo URL: () » What email address should be used for Lets Encrypt certificate registration? » tamika.taylor@untribe.com Would you like to enable external-dns for automatic DNS management? (Y/n) » Yes Please select your DNS provider (aws) » gke Do you want to expose ArgoCD with an Ingress? (Y/n) » Yes What hostname should ArgoCD be accessible at? » argocd.untribe.com Do you want to expose the Airflow UI to the web? (Y/n) » Yes What hostname should Airflow be accessible at? » airflow.untribe.com What is the URL of the Git repository containing your Airflow DAGs? (https://github.com/polyseam/demo-dag-bag) » https://github.com/polyseam/demo-dag-bag ``` -------------------------------- ### Pushing Initial Project to GitHub Source: https://github.com/polyseam/cndi/blob/main/blocks/common/cluster/core-readme.md These Git commands stage all changes, create an initial commit with a descriptive message, and push the local repository to the remote GitHub repository. This action triggers the cndi-run.yaml workflow via GitHub Actions, initiating the cluster deployment. ```bash git add . git commit -m "initial commit" git push ``` -------------------------------- ### Initializing a CNDI Project and Navigating (Shell) Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/gke/pgvector-cnpg.md This command initializes a new CNDI project by cloning a specified template repository and then changes the current directory into the newly created project folder. This is the first step in setting up a CNDI-managed Kubernetes cluster. ```shell cndi create polyseam/my-cndi-cluster && cd my-cndi-cluster ``` -------------------------------- ### Initializing a CNDI Project with `cndi create` (Shell) Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/eks/pgvector-cnpg.md This command initializes a new CNDI project by cloning a specified repository template and then navigates into the newly created project directory. It's the first step in setting up a CNDI-managed Kubernetes cluster, prompting the user for various configuration details. ```shell cndi create polyseam/my-cndi-cluster && cd my-cndi-cluster ``` -------------------------------- ### Initializing CNDI Project with `cndi create` Command (Shell) Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/aks/cnpg.md This command initiates the creation of a new CNDI project by specifying the owner and repository. After execution, it automatically changes the current directory to the newly created project, preparing for further configuration. ```shell cndi create polyseam/my-cndi-cluster && cd my-cndi-cluster ``` -------------------------------- ### Creating a CNDI Project and Navigating to its Directory Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/eks/airflow.md This command initializes a new CNDI project named 'my-cndi-cluster' within the 'polyseam' organization and then changes the current directory into the newly created project folder. This sets up the local GitOps repository for cluster configuration. ```shell cndi create polyseam/my-cndi-cluster && cd my-cndi-cluster ``` -------------------------------- ### Selecting AWS as Deployment Target for CNDI Cluster Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/eks/airflow.md This interactive prompt guides the user to select the cloud provider for cluster deployment. For this walkthrough, 'aws' is chosen, indicating that the Kubernetes cluster will be provisioned within Amazon Web Services. ```shell "Where do you want to deploy your cluster?" ❯ aws azure gcp dev ``` -------------------------------- ### Retrieving GCP GKE Kubeconfig Command using CNDI Source: https://github.com/polyseam/cndi/blob/main/docs/connect.md This command displays the outputs of your CNDI project, including the `get_kubeconfig_command` which is essential for configuring `kubectl` to interact with your cluster. It serves as the initial step to retrieve the cloud-provider specific command needed for `kubectl` setup. ```shell cndi show-outputs ``` -------------------------------- ### Retrieving Azure AKS Kubeconfig Command using CNDI Source: https://github.com/polyseam/cndi/blob/main/docs/connect.md This command displays the outputs of your CNDI project, including the `get_kubeconfig_command` which is essential for configuring `kubectl` to interact with your cluster. It serves as the initial step to retrieve the cloud-provider specific command needed for `kubectl` setup. ```shell cndi show-outputs ``` -------------------------------- ### Retrieving AWS EKS Kubeconfig Command using CNDI Source: https://github.com/polyseam/cndi/blob/main/docs/connect.md This command displays the outputs of your CNDI project, including the `get_kubeconfig_command` which is essential for configuring `kubectl` to interact with your cluster. It serves as the initial step to retrieve the cloud-provider specific command needed for `kubectl` setup. ```shell cndi show-outputs ``` -------------------------------- ### Deploying CNDI Cluster Configuration (Shell) Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/dev/airflow.md These commands prepare and push the generated CNDI cluster configuration to a GitHub repository, followed by initiating the cluster deployment process. `git add .`, `git commit`, and `git push` manage the source control, while `cndi run` executes the deployment based on the committed configuration. ```shell git add . git status # take a quick look and make sure these are all files you want to push git commit -m "initial commit" git push --set-upstream origin main cndi run ``` -------------------------------- ### Handling Kubernetes Secrets with CNDI Cluster Manifests (YAML) Source: https://github.com/polyseam/cndi/blob/main/docs/config.md This example demonstrates how CNDI processes Kubernetes `Secret` resources within `cluster_manifests`. It highlights that plain-text secrets are invalid and will not be written, while securely encrypted secrets using `$cndi_on_ow.seal_secret_from_env_var()` are valid and will be transformed into SealedSecrets, preventing sensitive data from being committed to Git. ```YAML cluster_manifests: valid-simple-ns: apiVersion: v1 kind: Namespace metadata: name: simple-ns bad-secret: # invalid, CNDI will not write this to ./cndi/cluster_manifests apiVersion: v1 kind: Secret metadata: name: my-user-secret namespace: foo stringData: username: admin password: password123 valid-secret: # valid! CNDI will write this to ./cndi/cluster_manifests as a SealedSecret # you can trust the real Secret will be available in your cluster safely # without putting the plain-text values in git apiVersion: v1 kind: Secret metadata: name: my-user-secret namespace: foo stringData: username: $cndi_on_ow.seal_secret_from_env_var(MY_USERNAME) password: $cndi_on_ow.seal_secret_from_env_var(MY_PASSWORD) ``` -------------------------------- ### Initializing CNDI Project with Airflow Template on GCP Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/gke/airflow.md This command initializes a new CNDI project named 'my-cndi-cluster' from the 'polyseam/my-cndi-cluster' template and navigates into the newly created project directory. It's the first step in setting up a CNDI-managed cluster. ```shell cndi create polyseam/my-cndi-cluster && cd my-cndi-cluster ``` -------------------------------- ### Creating a CNDI Project and Navigating to Directory (Shell) Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/aks/pgvector-cnpg.md This shell command initializes a new CNDI project by cloning a specified template repository (e.g., `polyseam/my-cndi-cluster`) and then changes the current directory into the newly created project folder. This is the foundational step for setting up a CNDI-managed Kubernetes cluster, preparing the environment for subsequent configuration and deployment. ```Shell cndi create polyseam/my-cndi-cluster && cd my-cndi-cluster ``` -------------------------------- ### Configuring Kubectl for AWS EKS Cluster Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/eks/pgvector-cnpg.md This command configures `kubectl` to interact with your Amazon EKS cluster by updating your kubeconfig file. It requires the AWS CLI to be installed and configured. Replace `` with the actual name of your EKS cluster and `` with its AWS region. ```bash aws eks update-kubeconfig --name --region ``` -------------------------------- ### Deploying WordPress Application with CNDI (YAML) Source: https://github.com/polyseam/cndi/blob/main/docs/config.md This YAML snippet demonstrates how to configure the `applications` section in `cndi_config.yaml` to deploy a Helm chart. It specifies the repository URL, chart name, target version, destination namespace, and custom values to be passed to the chart, effectively deploying the Bitnami WordPress chart via ArgoCD. ```YAML # metadata project_name: wordpress-project cndi_version: v2 provider: azure distribution: aks # infrastructure infrastructure: { ... } # applications applications: wordpress: repoURL: https://charts.bitnami.com/bitnami chart: wordpress targetRevision: 23.1.17 destinationNamespace: wordpress values: existingSecret: wordpress-pw wordpressUsername: admin ``` -------------------------------- ### Creating a CNDI GitOps Repository with GitHub CLI Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/dev/airflow.md This command uses the GitHub CLI (`gh`) to create a new private repository named 'my-cndi-cluster', clones it locally, and then changes the current directory into the newly created repository. This sets up the local environment for managing cluster configuration via a GitOps workflow. ```bash gh repo create my-cndi-cluster --private --clone && cd my-cndi-cluster ``` -------------------------------- ### Creating a CNDI Project with Airflow Template (Bash) Source: https://github.com/polyseam/cndi/blob/main/README.md This command initializes a new CNDI project using the `cndi create` utility. It specifies an Airflow template and creates a new GitHub repository under the provided `/`. After successful creation, it navigates into the newly generated project directory ``. ```bash cndi create / -t airflow && cd ``` -------------------------------- ### Configuring CNDI for Existing VNet Insertion (YAML) Source: https://github.com/polyseam/cndi/blob/main/docs/config/infrastructure/cndi/network.md This configuration snippet shows how to set up CNDI to insert a cluster into an existing Virtual Network ('insert' mode). It requires specifying the 'vnet_identifier' which varies by cloud provider (AWS, Azure, GCP examples are provided). This mode is beneficial when the cluster needs to communicate with pre-existing infrastructure within a specific VNet. ```yaml infrastructure: cndi: network: mode: insert # AWS: vnet_identifier: vpc-0a1b2c3d4e5f6g7h8 # Azure: # vnet_identifier: /subscriptions/.../resourceGroups/my-rg/providers/Microsoft.Network/virtualNetworks/my-vnet # GCP: # vnet_identifier: my-network ``` -------------------------------- ### Connecting to PostgreSQL Database with psql (Bash) Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/eks/cnpg.md This command connects to a PostgreSQL database using the `psql` command-line client. It requires replacing ``, ``, and `` with your specific database details. You will be prompted for the password, which, along with other connection details, can be found in the `.env` file under `PSQL_CONNECTION_COMMAND`. ```bash psql -h -p 5432 -U -d ``` -------------------------------- ### Retrieving MicroK8s Node IP Address (Bash) Source: https://github.com/polyseam/cndi/blob/main/blocks/dev/microk8s.md This command retrieves the IP address of the Multipass virtual machine hosting the MicroK8s cluster. It uses `multipass exec` to run an `ip route` command on the VM and `awk` to extract the IP, then exports it as an environment variable `NODE_IP`. Users must replace `my-project-node` with their actual node name. ```bash # replace `my-project-node` with the name of your node in cndi_config.yaml export NODE_IP=$(multipass exec my-project-node -- ip route get 1.2.3.4 | awk '{print $7}') ``` -------------------------------- ### Retrieving Node IP Address using Multipass (Shell) Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/dev/airflow.md This command uses `multipass exec` to run `ip route get 1.2.3.4` on the specified node (`$YOUR_NODE_NAME`) to obtain its IP address. The output is then piped to `awk` to extract the 7th field (the IP address) and `tr -d '\\n'` to remove any trailing newline characters, making it suitable for direct use. ```shell multipass exec $YOUR_NODE_NAME -- ip route get 1.2.3.4 | awk '{print $7}' | tr -d '\\n' ``` -------------------------------- ### Port Forwarding ArgoCD Web UI (Bash) Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/eks/cnpg.md This command establishes a port-forwarding session from your local machine to the ArgoCD server service within the Kubernetes cluster. It allows you to access the ArgoCD web UI on `http://127.0.0.1:8080` by forwarding local port 8080 to the service's port 80. The username for login is `admin`, and the password is found in the `.env` file under `ARGOCD_ADMIN_PASSWORD`. ```bash kubectl port-forward -n argocd svc/argocd-server 8080:80 ``` -------------------------------- ### Selecting Airflow Template for CNDI Project Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/gke/airflow.md This snippet shows the interactive prompt for selecting a project template during CNDI initialization. The 'airflow' template is highlighted, indicating its selection for deploying an Airflow-based cluster. ```shell "Pick a template" basic ❯ airflow cnpg neo4j mssqlserver ``` -------------------------------- ### Minimal Cert Manager Configuration for Let's Encrypt (YAML) Source: https://github.com/polyseam/cndi/blob/main/docs/config/infrastructure/cndi/cert_manager.md This YAML snippet demonstrates a minimal configuration for the `cert_manager` block within a CNDI infrastructure setup. It shows how to specify an email address for Let's Encrypt certificate requests, which is crucial for receiving notifications about certificate issues. This configuration is typically used for production environments to enable automatic certificate issuance. ```YAML project_name: my-cluster cndi_version: v2 provider: aws distribution: eks infrastructure: cndi: cert_manager: email: jane.smith@example.com ``` -------------------------------- ### Opening Jupyter Notebook File (URL) Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/eks/pgvector-cnpg.md This URL provides the path to the Jupyter Notebook file that contains the necessary code and steps for processing the dataset and performing semantic search queries against a PostgreSQL database. ```bash https://raw.githubusercontent.com/Polyseam/cndi-examples-and-datasets/main/databases/postgres-pgvector/semantic-search/vector-database.ipynb ``` -------------------------------- ### CNDI Configuration for External-DNS Azure Provider Source: https://github.com/polyseam/cndi/blob/main/docs/cloud-setup/external-dns/azure-dns.md This YAML snippet illustrates the `cndi_config.yaml` configuration for integrating External-DNS with Azure. It specifies `azure` as the provider and references the `AZURE_CREDENTIALS` environment variable to securely inject the Azure authentication details into a Kubernetes Secret named `external-dns` within the `external-dns` namespace. This setup enables External-DNS to manage DNS records in the specified Azure resource group. ```yaml infrastructure: cndi: {...} external_dns: provider: azure values: azure: resourceGroup: 'my-dns-rg' cluster_manifests: {...} external-dns: apiVersion: v1 kind: Secret metadata: name: external-dns namespace: external-dns stringData: azure.json: $cndi_on_ow.seal_secret_from_env_var(AZURE_CREDENTIALS) ``` -------------------------------- ### Defining Minimum Permissions for CNDI Cluster Deployment in Azure (JSON) Source: https://github.com/polyseam/cndi/blob/main/docs/cloud-setup/azure/azure-setup.md This JSON defines a custom Azure role named "cndi-min-role" with the minimum permissions required for deploying a CNDI cluster to Azure Kubernetes Service (AKS). It specifies actions for managing Container Service (AKS), Resources (Resource Groups), and Network (Virtual Networks, Subnets, DNS Zones), ensuring CNDI has the necessary access to create and manage resources within a specified subscription. ```json { "properties": { "roleName": "cndi-min-role", "description": "minimum permissions required for deploying a CNDI cluster to AKS", "assignableScopes": [ "/subscriptions/" ], "permissions": [ { "actions": [ "Microsoft.ContainerService/managedClusters/write", "Microsoft.ContainerService/managedClusters/delete", "Microsoft.ContainerService/managedClusters/read", "Microsoft.ContainerService/managedClusters/listClusterUserCredential/action", "Microsoft.Resources/subscriptions/resourceGroups/write", "Microsoft.Resources/subscriptions/resourceGroups/delete", "Microsoft.Resources/subscriptions/resourceGroups/read", "Microsoft.Network/virtualNetworks/write", "Microsoft.Network/virtualNetworks/read", "Microsoft.Network/virtualNetworks/delete", "Microsoft.Network/virtualNetworks/subnets/delete", "Microsoft.Network/virtualNetworks/subnets/write", "Microsoft.Network/virtualNetworks/subnets/read", "Microsoft.Network/virtualNetworks/subnets/join/action", "Microsoft.Network/dnszones/A/write", "Microsoft.Network/dnszones/A/read", "Microsoft.Network/dnszones/A/delete", "Microsoft.Network/dnszones/TXT/write", "Microsoft.Network/dnszones/TXT/read", "Microsoft.Network/dnszones/TXT/delete", "Microsoft.Network/dnszones/read" ] } ] } } ``` -------------------------------- ### Logging into Azure CLI Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/aks/cnpg.md This command initiates the Azure CLI login process, opening a browser window for authentication. It is a prerequisite for interacting with Azure resources via the command line. ```bash az login ``` -------------------------------- ### Connecting to PostgreSQL Database via psql CLI (Bash) Source: https://github.com/polyseam/cndi/blob/main/docs/walkthroughs/gke/cnpg.md This command connects to a PostgreSQL database using the `psql` command-line tool. It requires specifying the database host, port (default 5432), username, and database name. The password will be prompted separately, and connection details can often be found in the .env file. ```bash psql -h -p 5432 -U -d ```