### Install RMK using Installer Script Source: https://github.com/edenlabllc/rmk/blob/develop/docs/index.md Installs the RMK tool by downloading and executing a self-installer script from a provided URL. This is the primary method for initial setup. ```shell curl -sL "https://edenlabllc-rmk.s3.eu-north-1.amazonaws.com/rmk/s3-installer" | bash ``` -------------------------------- ### RMK Secret Key Creation Output Example Source: https://github.com/edenlabllc/rmk/blob/develop/docs/quickstart.md Provides an example of the output generated when creating SOPS Age secret keys, showing the logging of key generation and SOPS configuration updates for different scopes. ```text 2025-01-29T16:23:00.325+0100 INFO generate age key for scope: deps 2025-01-29T16:23:00.326+0100 INFO update SOPS config file: /home/user/rmk-test/etc/deps/develop/secrets/.sops.yaml 2025-01-29T16:23:00.337+0100 INFO generate age key for scope: rmk-test 2025-01-29T16:23:00.338+0100 INFO update SOPS config file: /home/user/rmk-test/etc/rmk-test/develop/secrets/.sops.yaml ``` -------------------------------- ### project.yaml: Full Example Source: https://github.com/edenlabllc/rmk/blob/develop/docs/configuration/project-management/preparation-of-project-repository.md A complete example of a `project.yaml` file demonstrating the usage of project dependencies, environments, owners, scopes, Helm plugins, hooks, and various tools like clusterctl, kubectl, helm, and helmfile. ```yaml project: dependencies: - name: cluster-deps.bootstrap.infra version: v0.1.0 url: git::https://github.com/edenlabllc/{{.Name}}.git?ref={{.Version}} spec: environments: - develop: root-domain: localhost - production: root-domain: localhost - staging: root-domain: localhost owners: - owner1 - owner2 scopes: - deps - project1 inventory: helm-plugins: diff: version: v3.8.1 url: https://github.com/databus23/helm-diff helm-git: version: v0.15.1 url: https://github.com/aslafy-z/helm-git secrets: version: v4.5.0 url: https://github.com/jkroepke/helm-secrets hooks: helmfile.hooks.infra: version: v1.29.1 url: git::https://github.com/edenlabllc/{{.Name}}.git?ref={{.Version}} tools: clusterctl: version: 1.7.4 url: https://github.com/kubernetes-sigs/cluster-api/releases/download/v{{.Version}}/{{.Name}}-{{.Os}}-amd64 os-linux: linux os-mac: darwin rename: true kubectl: version: 1.28.13 url: https://dl.k8s.io/release/v{{.Version}}/bin/{{.Os}}/amd64/{{.Name}} checksum: https://dl.k8s.io/release/v{{.Version}}/bin/{{.Os}}/amd64/{{.Name}}.sha256 os-linux: linux os-mac: darwin helm: version: 3.10.3 url: https://get.helm.sh/{{.Name}}-v{{.Version}}-{{.Os}}-amd64.tar.gz checksum: https://get.helm.sh/{{.Name}}-v{{.Version}}-{{.Os}}-amd64.tar.gz.sha256sum os-linux: linux os-mac: darwin helmfile: version: 0.157.0 url: https://github.com/{{.Name}}/{{.Name}}/releases/download/v{{.Version}}/{{.Name}}_{{.Version}}_{{.Os}}_amd64.tar.gz checksum: https://github.com/{{.Name}}/{{.Name}}/releases/download/v{{.Version}}/{{.Name}}_{{.Version}}_checksums.txt ``` -------------------------------- ### RMK Release Synchronization Examples Source: https://github.com/edenlabllc/rmk/blob/develop/docs/configuration/release-management/release-management.md Illustrates different ways to synchronize releases, including synchronizing all releases, a specific scope, or a particular release with custom Helm arguments. ```shell rmk release sync rmk release sync --selector scope=deps rmk release sync --selector app=myapp1 --helmfile-args="--set='values.key1=value1'" ``` -------------------------------- ### globals.yaml.gotmpl Configuration Examples Source: https://github.com/edenlabllc/rmk/blob/develop/docs/configuration/project-management/requirement-for-project-repository.md Provides examples of how to structure `globals.yaml.gotmpl` for managing global configurations like Kubernetes ConfigMaps (`configs`), environment variables (`envs`), and Helmfile hooks (`hooks`). ```yaml configs: auditLog: | {{- readFile (printf "%s/audit-log.json" "values/configs") | nindent 4 }} envs: FOO: false hooks: : common-postuninstall-hook: events: - postuninstall showlogs: true command: "{{`{{ .Release.Labels.bin }}`}}/common-postuninstall-hook.sh" args: - "{{`{{ .Release.Namespace }}`}}" ``` -------------------------------- ### RMK Release Templating Example Source: https://github.com/edenlabllc/rmk/blob/develop/docs/configuration/release-management/release-management.md Demonstrates viewing a specific release's YAML output after Helm values templating, using the '--selector' flag to target a particular application. ```shell rmk release template --selector app=myapp1 ``` -------------------------------- ### Build RMK from Source Source: https://github.com/edenlabllc/rmk/blob/develop/docs/development-and-release.md Builds the RMK project from source using GoReleaser. This command can also be used for recompilation during development. ```shell goreleaser build --snapshot --clean ``` -------------------------------- ### RMK Release Management with Selectors Source: https://github.com/edenlabllc/rmk/blob/develop/docs/configuration/release-management/release-management.md Examples demonstrating the use of selectors with RMK release commands to target specific releases based on labels like name, namespace, or chart. ```shell rmk release list --selector name=myapp1 rmk release sync --selector namespace=kube-system rmk release destroy --selector chart=mychart1 ``` -------------------------------- ### Create K3D Cluster with RMK Source: https://github.com/edenlabllc/rmk/blob/develop/docs/quickstart.md This command creates a local K3D cluster managed by RMK. It requires Docker to be running and uses K3D to provision the cluster resources. The output shows the cluster creation process and network setup. ```shell rmk cluster k3d create ``` -------------------------------- ### Define Machine Pool Configuration Source: https://github.com/edenlabllc/rmk/blob/develop/docs/configuration/release-management/release-management.md Example YAML configuration for defining machine pool settings, including enabled status, instance type, disk size, scaling parameters, and taints. ```yaml machinePools: app: enabled: false annotations: {} labels: {} managed: spec: # AdditionalTags is an optional set of tags to add to AWS resources managed by the AWS provider, in addition # to the ones added by default. additionalTags: {} # DiskSize specifies the root disk size diskSize: 10 # InstanceType specifies the AWS instance type instanceType: t3.medium # Labels specifies labels for the Kubernetes node objects labels: db: app # Scaling specifies scaling for the ASG behind this pool scaling: maxSize: 1 minSize: 1 # Taints specifies the taints to apply to the nodes of the machine pool taints: - effect: NoSchedule key: old-taint value: value1 # ... # Number of desired machines. replicas: 1 spec: # ... ``` -------------------------------- ### RMK Release Destruction Example Source: https://github.com/edenlabllc/rmk/blob/develop/docs/configuration/release-management/release-management.md Command to destroy all managed releases. ```shell rmk release destroy ``` -------------------------------- ### SOPS Configuration File Example Source: https://github.com/edenlabllc/rmk/blob/develop/docs/configuration/secrets-management/secrets-management.md An example `.sops.yaml` configuration file, defining creation rules for encrypting secrets. It includes a `path_regex` for filtering files and specifies the Age recipient for encryption. ```yaml creation_rules: - path_regex: .+\.yaml$ age: 'age1rq0gx9zuwphw8kjx6ams84rgysqk5kdmhnysxs28r0x955xnzsdsslgtn0' ``` -------------------------------- ### Generate Project Structure with RMK Source: https://github.com/edenlabllc/rmk/blob/develop/docs/configuration/project-management/preparation-of-project-repository.md Automatically generates the project structure from scratch using the RMK tool, based on a project specification file (project.yaml). It sets up a default structure and an example release, and can optionally create SOPS age private keys with the `--create-sops-age-keys` flag. If project.yaml is missing, it will be created. ```shell rmk project generate --environment="develop.root-domain=" \ --owner=gh_user --scope= \ --scope= ``` -------------------------------- ### Update RMK to Release Candidate Source: https://github.com/edenlabllc/rmk/blob/develop/docs/development-and-release.md Updates the RMK application to a release candidate version using the CLI. This is used for intermediate or beta testing. ```shell rmk update --release-candidate ``` -------------------------------- ### GitHub Actions Workflow for RMK Release Updates Source: https://github.com/edenlabllc/rmk/blob/develop/docs/configuration/release-management/release-management.md This workflow automates release updates using RMK. It checks out the repository, sets up environment variables including secrets for AWS and Slack, installs RMK via a curl command, initializes RMK configuration, and then executes the `rmk release update` command. It requires `image_repository_full_name` and `version` as inputs. ```yaml name: Release update on: workflow_dispatch: inputs: image_repository_full_name: description: Image repository full name of application. required: true version: description: Current application version. required: true jobs: release-update: runs-on: ubuntu-22.04 steps: - name: Checkout main repository uses: actions/checkout@v4 with: ref: ${{ github.ref }} fetch-depth: 0 - name: Release update env: AWS_REGION: us-east-1 AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} RMK_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN_REPO }} RMK_SLACK_WEBHOOK: ${{ secrets.RMK_SLACK_WEBHOOK }} RMK_SLACK_CHANNEL: project1-cd-notifications RMK_RELEASE_UPDATE_REPOSITORY: ${{ github.event.inputs.image_repository_full_name }} RMK_RELEASE_UPDATE_TAG: ${{ github.event.inputs.version }} run: | curl -sL "https://edenlabllc-rmk-tools-infra.s3.eu-north-1.amazonaws.com/rmk/s3-installer" | bash rmk config init --cluster-provider=aws --progress-bar=false --slack-notifications rmk release update --skip-ci --deploy ``` -------------------------------- ### RMK CLI Commands for Release Update Source: https://github.com/edenlabllc/rmk/blob/develop/docs/configuration/release-management/release-management.md This entry details the RMK command-line interface commands used within the GitHub Actions workflow. It includes installing RMK, initializing its configuration for AWS, and performing the release update process, which analyzes release files, updates tags, commits changes, and synchronizes releases. ```APIDOC RMK CLI Commands: Install RMK: curl -sL "https://edenlabllc-rmk-tools-infra.s3.eu-north-1.amazonaws.com/rmk/s3-installer" | bash - Downloads and installs the RMK tool. Initialize RMK Configuration: rmk config init --cluster-provider= [--progress-bar=] [--slack-notifications] - Initializes RMK configuration for a specific cluster provider (e.g., 'aws'). - Parameters: - --cluster-provider: The cloud provider for the cluster (e.g., 'aws'). Required. - --progress-bar: Controls the display of a progress bar (optional, defaults to true). - --slack-notifications: Enables Slack notifications for RMK operations (optional). Update Release: rmk release update [--skip-ci] [--deploy] - Updates release information based on configured repositories and tags. - Analyzes `releases.yaml` files to match `image_repository_full_name` and updates the `tag` field if versions differ. - Automatically commits changes to `releases.yaml` and synchronizes releases. - Parameters: - --skip-ci: Skips Continuous Integration checks during the update process (optional). - --deploy: Triggers deployment after the release update (optional). - Environment Variables: - AWS_REGION, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY: For AWS authentication. - RMK_GITHUB_TOKEN: GitHub token for repository operations. - RMK_SLACK_WEBHOOK, RMK_SLACK_CHANNEL: For Slack notifications. - RMK_RELEASE_UPDATE_REPOSITORY: The full name of the image repository to update. - RMK_RELEASE_UPDATE_TAG: The new tag/version to apply. ``` -------------------------------- ### Helmfile Configuration Example for RMK Environments Source: https://github.com/edenlabllc/rmk/blob/develop/docs/configuration/project-management/requirement-for-project-repository.md This snippet demonstrates the structure of a `helmfile.yaml.gotmpl` file for the RMK project. It defines configurations for various environments (local, develop, production, staging), specifying which value files to include based on environment settings and conditional logic, such as the presence of a K3D cluster. ```gotemplate environments: local: develop: missingFileHandler: Warn values: - etc//{{ .Environment.Name }}/globals.yaml - etc//{{ .Environment.Name }}/globals.yaml.gotmpl - etc//{{ .Environment.Name }}/releases.yaml {{- if eq (env "K3D_CLUSTER") "true" }} - etc//{{ .Environment.Name }}/values/k3d/releases.yaml {{- end }} - {{ requiredEnv "PWD" }}/etc//{{ .Environment.Name }}/globals.yaml - {{ requiredEnv "PWD" }}/etc//{{ .Environment.Name }}/globals.yaml.gotmpl - {{ requiredEnv "PWD" }}/etc//{{ .Environment.Name }}/releases.yaml {{- if eq (env "K3D_CLUSTER") "true" }} - {{ requiredEnv "PWD" }}/etc//{{ .Environment.Name }}/values/k3d/releases.yaml {{- end }} production: missingFileHandler: Warn values: - etc//{{ .Environment.Name }}/globals.yaml - etc//{{ .Environment.Name }}/globals.yaml.gotmpl - etc//{{ .Environment.Name }}/releases.yaml {{- if eq (env "K3D_CLUSTER") "true" }} - etc//{{ .Environment.Name }}/values/k3d/releases.yaml {{- end }} - {{ requiredEnv "PWD" }}/etc//{{ .Environment.Name }}/globals.yaml - {{ requiredEnv "PWD" }}/etc//{{ .Environment.Name }}/globals.yaml.gotmpl - {{ requiredEnv "PWD" }}/etc//{{ .Environment.Name }}/releases.yaml {{- if eq (env "K3D_CLUSTER") "true" }} - {{ requiredEnv "PWD" }}/etc//{{ .Environment.Name }}/values/k3d/releases.yaml {{- end }} staging: missingFileHandler: Warn values: - etc//{{ .Environment.Name }}/globals.yaml - etc//{{ .Environment.Name }}/globals.yaml.gotmpl - etc//{{ .Environment.Name }}/releases.yaml {{- if eq (env "K3D_CLUSTER") "true" }} - etc//{{ .Environment.Name }}/values/k3d/releases.yaml {{- end }} - {{ requiredEnv "PWD" }}/etc//{{ .Environment.Name }}/globals.yaml - {{ requiredEnv "PWD" }}/etc//{{ .Environment.Name }}/globals.yaml.gotmpl - {{ requiredEnv "PWD" }}/etc//{{ .Environment.Name }}/releases.yaml {{- if eq (env "K3D_CLUSTER") "true" }} - {{ requiredEnv "PWD" }}/etc//{{ .Environment.Name }}/values/k3d/releases.yaml {{- end }} --- helmDefaults: wait: true waitForJobs: true timeout: 3600 # The set of paths for the inherited Helmfiles is controlled through the project.yaml file using RMK. ``` -------------------------------- ### RMK CLI Cluster Management (K3D) Source: https://github.com/edenlabllc/rmk/blob/develop/docs/commands.md Commands for managing K3D clusters, including creation, deletion, image import, listing, starting, and stopping clusters. ```APIDOC RMK CLI Cluster Management (K3D): cluster k3d create, c Create K3D cluster. --k3d-volume-host-path, --kv="" Host local directory path for mount into K3D cluster. (default: present working directory) cluster k3d delete, d Delete K3D cluster. cluster k3d import, i Import images from docker to K3D cluster. --k3d-import-image, --ki="" List of images to import into running K3D cluster. cluster k3d list, l List K3D clusters. cluster k3d start, s Start K3D cluster. cluster k3d stop Stop K3D cluster. ``` -------------------------------- ### Override Machine Pool Configuration Source: https://github.com/edenlabllc/rmk/blob/develop/docs/configuration/release-management/release-management.md Example YAML for overriding specific machine pool configurations, demonstrating how to update enabled status, replicas, and scaling settings by repeating their YAML path. ```yaml machinePools: app: enabled: true managed: spec: scaling: maxSize: 10 minSize: 10 replicas: 10 ``` -------------------------------- ### project.yaml: Inventory Section Structure Source: https://github.com/edenlabllc/rmk/blob/develop/docs/configuration/project-management/preparation-of-project-repository.md Specifies extra configurations for launching the project, such as Helm plugins, hooks, and binary tool sources. It includes details like plugin versions, repository URLs, and tool download locations. ```yaml inventory: # Optional, contains a map of the Helm plugins repositories. helm-plugins: # Optional, Helm plugin name. diff: # Required, Helm plugin version in the `SemVer2` format. version: # Required, Helm plugin repository URL. url: https://github.com//helm-diff # ... # Optional, contains a map of the Helmfile hooks repositories with shell scripts. hooks: # Optional, Helmfile hooks repository name. helmfile.hooks.infra: # Required, Helmfile hooks repository version in the `SemVer2` format. version: # Required, Helmfile hooks repository URL. url: git::https://github.com//{{.Name}}.git?ref={{.Version}} # Optional, contains a map of the sources of binary file tools. tools: # Optional, tool name. clusterctl: # Required, tool version in `SemVer2` format. version: # Required, tool source URL. url: https://github.com/kubernetes-sigs/cluster-api/releases/download/v{{.Version}}/{{.Name}}-{{.Os}}-amd64 # Optional, specific key overrides for the described OS name. os-linux: linux os-mac: darwin # Optional, an option that allows to rename the downloaded binary file by the tool name. rename: true # ... ``` -------------------------------- ### Encrypted Secret File Example (AES256-GCM) Source: https://github.com/edenlabllc/rmk/blob/develop/docs/configuration/secrets-management/secrets-management.md An example of an encrypted secret file using AES256-GCM, where sensitive values are encrypted while keys remain in plaintext. This format facilitates PR reviews without exposing sensitive data. ```yaml username: ENC[AES256_GCM,data:A0jb1wU=,iv:RM8V1IOHvCrBv7f9f/GKobaBYyjcX9jcNQp6XPopNcU=,tag:T79VY3/yqlIffdbvYDwukQ==,type:str] password: ENC[AES256_GCM,data:Kjo5hDSb+VmhdLLuq48oVg==,iv:5wpJBsiA5B82RRaguW8/TcKgGYbiZhihdIhXnPwyRG8=,tag:yQ5Chi949jBB1cSaFDVlOQ==,type:str] sops: kms: [] gcp_kms: [] azure_kv: [] hc_vault: [] age: - recipient: age1rq0gx9zuwphw8kjx6ams84rgysqk5kdmhnysxs28r0x955xnzsdsslgtn0 enc: | -----BEGIN AGE ENCRYPTED FILE----- YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA1ZnBDR1pLNWt3TGVOVDlI TGdNOEdDZmEzQjFzaWZuWXVqN0RZMWxBcjN3CnZvdDRtSDZIaTlyenF4bG9wRzg3 ZURpTGUrd3JIZGV6clpwTkVKeDT5ekkKLS0tIHUwMGVvWnFDY2FQWm8rcmg4Wnl3 YlJtb1dIczAvbnRNZWtqZlJLdXB5K1EKZHC1YAnMnRJdXfin1KYsbBZBViSysroo 8wLK53RXN4dgyLsLMmESAWqEqIGOgkns7gbP8N7efakI1aI239SlVg== -----END AGE ENCRYPTED FILE----- lastmodified: "2025-01-25T09:40:29Z" mac: ENC[AES256_GCM,data:ytSnoJOi6eIzWjETgJo8/ppttKbHiSDcxQRJfocW0SWC2kQhyXtM0Y9R/d9JXbJrupqEcFH3yS4NJQz4uFyButI78pOrFxuhxNIhL3YSghTrBZKZ71IpjTe6W/oqz4UUhio5r1VU6KKFcKRKIvZZIUUnlqhJToOLB/VcLxqIQgw=,iv:Gufcas0JD7RVCTPIycN46EUq8V5OzYu++qmtolFu7hA=,tag:46k/pE546i4h18sXudp6Qw==,type:str] pgp: [] unencrypted_suffix: _unencrypted version: 3.7.1 ``` -------------------------------- ### Install/Update Provider Extensions with Helmfile Source: https://github.com/edenlabllc/rmk/blob/develop/docs/configuration/cluster-management/cluster-management.md This YAML snippet demonstrates how to install or update provider extensions using Helmfile labels. The labels `cluster=` and `config=extension` are used to target specific provider extensions for installation or updates within the CAPI management cluster. ```yaml - name: aws-iam-provision-operator namespace: capa-system chart: "{{`{{ .Release.Labels.repo }}`}}/app" version: "{{`{{ .Release.Labels.appChartVersion }}`}}" labels: cluster: aws config: extension installed: {{ eq (env "CAPI_CLUSTER" | default "false") "true" }} inherit: - template: release ``` -------------------------------- ### Open Application URL Source: https://github.com/edenlabllc/rmk/blob/develop/docs/quickstart.md Opens the application's URL in the default web browser, assuming the port forwarding is active. This is used to visually verify the Nginx welcome page. ```shell open http://localhost:8080 ``` -------------------------------- ### GCP Cluster Configuration Example Source: https://github.com/edenlabllc/rmk/blob/develop/docs/configuration/cluster-management/usage-gcp-provider.md Example YAML configuration for a GCP GKE cluster, specifying control plane version and machine pool settings like machine type, auto-upgrade, and replicas. This configuration is used to customize cluster provisioning. ```yaml controlPlane: spec: version: "v1.30.5" machinePools: app: enabled: true managed: spec: # MachineType is the name of a Google Compute Engine # (https://cloud.google.com/compute/docs/machine-types). # If unspecified, the default machine type is `e2-medium`. machineType: "e2-medium" management: # AutoUpgrade specifies whether node auto-upgrade is enabled for the node # pool. If enabled, node auto-upgrade helps keep the nodes in your node pool # up to date with the latest release version of Kubernetes. autoUpgrade: true # MaxPodsPerNode is constraint enforced on the max num of pods per node. replicas: 1 # ... ``` -------------------------------- ### Initialize RMK Configuration Source: https://github.com/edenlabllc/rmk/blob/develop/docs/quickstart.md This command initializes the RMK configuration for the current repository. It downloads necessary packages and sets up RMK to use specific environment values. The default cluster provider is k3d. ```shell rmk config init ``` -------------------------------- ### RMK Secrets Generation Template Example Source: https://github.com/edenlabllc/rmk/blob/develop/docs/configuration/secrets-management/secrets-management.md An example of a `.spec.yaml.gotmpl` file used for batch secret generation. It defines generation rules, secret fields, and utilizes custom RMK template functions like `requiredEnv` and `prompt`, along with Sprig functions like `randAlphaNum`. ```yaml generation-rules: - name: email-sender template: | envSecret: EMAIL_API_KEY: {{ requiredEnv "EMAIL_API_KEY" }} EMAIL_SENDER: {{ prompt "EMAIL_SENDER" }} - name: postgres template: | rootUsername: root rootPassword: {{ randAlphaNum 16 }} appUsername: {{ requiredEnv "POSTGRES_USERNAME" }} appPassword: {{ prompt "POSTGRES_PASSWORD" }} - name: redis template: | auth: password: {{ randAlphaNum 16 }} cacheTTL: {{ requiredEnv "REDIS_TTL" }} ``` -------------------------------- ### AWS Cluster YAML Configuration Example Source: https://github.com/edenlabllc/rmk/blob/develop/docs/configuration/cluster-management/usage-aws-provider.md Provides an example YAML configuration for provisioning an AWS EKS cluster. It details settings for the control plane, including IAM authenticator configuration, and machine pools with instance types and scaling. This configuration serves as a template for customizing cluster resources. ```yaml # A complete list of all options can be found here https://capz.sigs.k8s.io/reference/v1beta1-api controlPlane: spec: iamAuthenticatorConfig: # UserMappings is a list of user mappings mapUsers: # TODO: Add a list of users at the downstream project repository level - groups: - system:masters # UserARN is the AWS ARN for the user to map userarn: arn:aws:iam::{{ env "AWS_ACCOUNT_ID" }}:user/user1 # UserName is a kubernetes RBAC user subject*/}} username: user1 version: v1.29.8 # ^v?(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.?(\.(0|[1-9][0-9]*))?$ ## The machine pools configurations machinePools: app: enabled: true managed: spec: instanceType: t3.medium # Labels specifies labels for the Kubernetes node objects labels: db: app # Scaling specifies scaling for the ASG behind this pool scaling: maxSize: 1 minSize: 1 # Number of desired machines. Defaults to 1. replicas: 1 # ... ``` -------------------------------- ### Update CAPI Management Cluster Configuration Source: https://github.com/edenlabllc/rmk/blob/develop/docs/configuration/cluster-management/cluster-management.md The `rmk cluster capi update` command initializes or updates the required provider controller and installs or updates credentials for the selected cloud provider. This command is a singleton and can only be executed once until the existing management cluster is deleted. It must be run before provisioning or destroying a target cluster if the provider is not yet installed. ```shell rmk cluster capi update ``` -------------------------------- ### K3d Download Specification Source: https://github.com/edenlabllc/rmk/blob/develop/docs/configuration/project-management/preparation-of-project-repository.md Configuration for downloading the K3d container orchestrator. Provides the version, download URL pattern, OS mappings, and specifies that the downloaded file requires renaming to match the tool's name. ```APIDOC K3D: version: 5.7.3 url: https://github.com/k3d-io/{{.Name}}/releases/download/v{{.Version}}/{{.Name}}-{{.Os}}-amd64 os-linux: linux os-mac: darwin rename: true ``` -------------------------------- ### Initialize RMK Configuration Source: https://github.com/edenlabllc/rmk/blob/develop/docs/configuration/configuration-management/configuration-management.md Initializes the RMK configuration for the current environment. This command prepares the environment by downloading and resolving dependencies based on the project.yaml file. It supports various flags for specifying cluster providers, authentication tokens, and regions. ```shell rmk config init ``` ```shell # Example with AWS provider and GitHub token rmk config init --cluster-provider=aws \ --github-token= \ --aws-access-key-id= \ --aws-region=us-east-1 \ --aws-secret-access-key= ``` ```shell # Example for private GitHub repositories rmk config init --github-token= ``` ```shell # Example updating a specific option (e.g., GitHub token) rmk config init --github-token= ``` -------------------------------- ### Export Required Environment Variables Source: https://github.com/edenlabllc/rmk/blob/develop/docs/configuration/secrets-management/secrets-management.md Example commands to export environment variables that are required by the `.spec.yaml.gotmpl` templates using the `requiredEnv` function. ```shell export EMAIL_API_KEY="dummy-email-api-key-XXX" export POSTGRES_USER="user1" export REDIS_TTL="3600" ``` -------------------------------- ### RMK CLI Configuration Management Source: https://github.com/edenlabllc/rmk/blob/develop/docs/commands.md Commands for initializing, deleting, listing, and viewing configurations for projects and environments, including cloud provider specific options. ```APIDOC RMK CLI Configuration Management: config init, i Initialize configuration for current project and selected environment. --aws-access-key-id, --awid="" AWS access key ID for IAM user. --aws-region, --awr="" AWS region for current AWS account. --aws-secret-access-key, --awsk="" AWS secret access key for IAM user. --aws-session-token, --awst="" AWS session token for IAM user. --azure-client-id, --azid="" Azure client ID for Service Principal. --azure-client-secret, --azp="" Azure client secret for Service Principal. --azure-key-vault-resource-group-name, --azkvrg="" Azure Key Vault custom resource group name. --azure-location, --azl="" Azure location. --azure-service-principle, --azsp Azure service principal STDIN content. --azure-subscription-id, --azs="" Azure subscription ID for current platform domain. --azure-tenant-id, --azt="" Azure tenant ID for Service Principal. --cluster-provider, --cp="" Cluster provider for provisioning. (default: "k3d") --gcp-region, --gr="" GCP region. --github-token, --ght="" GitHub personal access token, required when using private repositories. --google-application-credentials, --gac="" Path to GCP service account credentials JSON file. --progress-bar, -p Globally disable or enable progress bar for download process. --slack-channel, --sc="" Channel name for Slack notifications. --slack-message-details, --smd="" Additional details for Slack message body. --slack-notifications, -n Enable Slack notifications. --slack-webhook, --sw="" URL for Slack webhook. config delete, d Delete configuration for selected environment. config list, l List available configurations for current project. --all, -a List all project configurations. config view, v View configuration for selected environment. ``` -------------------------------- ### Decrypted Secret File Example Source: https://github.com/edenlabllc/rmk/blob/develop/docs/configuration/secrets-management/secrets-management.md The human-readable version of a secrets file after RMK decrypts it using the appropriate secret key, revealing the plaintext values. ```yaml username: user1 password: password1 ``` -------------------------------- ### SOPS Download Specification Source: https://github.com/edenlabllc/rmk/blob/develop/docs/configuration/project-management/preparation-of-project-repository.md Defines the configuration for downloading the SOPS tool. Includes version, download URL template, and OS-specific path mappings. The 'rename' flag indicates if the downloaded binary needs to be renamed. ```APIDOC SOPS: version: 3.8.1 url: https://github.com/getsops/{{.Name}}/releases/download/v{{.Version}}/{{.Name}}-v{{.Version}}.{{.Os}} os-linux: linux os-mac: darwin rename: true ``` -------------------------------- ### GKE Auth Plugin Download Specification Source: https://github.com/edenlabllc/rmk/blob/develop/docs/configuration/project-management/preparation-of-project-repository.md Defines the download configuration for the GKE Auth Plugin. Includes version, URL template for fetching the tarball, and OS mappings for Linux and macOS, indicating the need for renaming. ```APIDOC GKE-AUTH-PLUGIN: version: 0.1.1 url: https://github.com/traviswt/{{.Name}}/releases/download/{{.Version}}/{{.Name}}_{{.Os}}_x86_64.tar.gz os-linux: Linux os-mac: Darwin ``` -------------------------------- ### Initialize New Git Repository Source: https://github.com/edenlabllc/rmk/blob/develop/docs/configuration/project-management/preparation-of-project-repository.md Manually initializes a new Git repository in the current directory, adds a remote origin pointing to a repository URL, and creates an initial empty commit. RMK requires a Git branch with at least one commit and a configured `origin` remote. ```shell git init git remote add git commit --allow-empty --message "Initial commit" ``` -------------------------------- ### Age Download Specification Source: https://github.com/edenlabllc/rmk/blob/develop/docs/configuration/project-management/preparation-of-project-repository.md Specifies the download configuration for the Age encryption tool. Details the version, the URL template for fetching binaries, and OS-specific identifiers for Linux and macOS. ```APIDOC AGE: version: 1.1.1 url: https://github.com/FiloSottile/{{.Name}}/releases/download/v{{.Version}}/{{.Name}}-v{{.Version}}-{{.Os}}-amd64.tar.gz os-linux: linux os-mac: darwin ``` -------------------------------- ### YQ Download Specification Source: https://github.com/edenlabllc/rmk/blob/develop/docs/configuration/project-management/preparation-of-project-repository.md Details the download parameters for YQ, a portable YAML, JSON, XML, CSV and properties processor. Includes version, URL template, OS mappings, and a flag to rename the downloaded binary. ```APIDOC YQ: version: 4.35.2 url: https://github.com/mikefarah/{{.Name}}/releases/download/v{{.Version}}/{{.Name}}_{{.Os}}_amd64 os-linux: linux os-mac: darwin rename: true ``` -------------------------------- ### RMK AWS Configuration without MFA Source: https://github.com/edenlabllc/rmk/blob/develop/docs/configuration/configuration-management/init-aws-provider.md YAML configuration example for RMK when not using AWS Multi-Factor Authentication (MFA), specifying core cluster attributes and AWS account details. ```yaml name: rmk-test-develop # RMK config name, a unique identifier which consists of the project (tenant) name and the abbreviated name of the Git branch. tenant: rmk-test # Tenant name, which is equivalent to the project name. environment: develop # Environment name. root-domain: rmk-test-develop.edenlab.dev # Root domain name used across the cluster. cluster-provider: aws # Selected cluster provider. # ... aws: account_id: "123456789012" # AWS account ID. config-source: /Users/user/.aws/config_rmk-test-develop # Absolute path to the AWS profile config. credentials-source: /Users/user/.aws/credentials_rmk-test-develop # Absolute path to the AWS profile credentials. user-name: user # AWS user name. profile: rmk-test-develop # AWS profile name. region: us-east-1 # AWS region of the current Kubernetes cluster. # ... ``` -------------------------------- ### Initialize RMK Configuration with GitHub Token (Shell) Source: https://github.com/edenlabllc/rmk/blob/develop/docs/backward-compatibility.md Downloads necessary private SOPS Age keys for the current RMK version. Requires a GitHub personal access token for authentication. This step is crucial for secrets management. ```shell rmk config init --github-token= ``` -------------------------------- ### Change Inherited Project Dependency Versions Source: https://github.com/edenlabllc/rmk/blob/develop/docs/configuration/project-management/dependencies-management-and-project-inheritance.md This example shows how to modify the version of an inherited project dependency in the `project.dependencies` section of `project.yaml`. It allows specifying a different stable tag for upstream repositories. ```yaml project: dependencies: # ... - name: .bootstrap.infra version: v2.17.0 # e.g., a different version of the dependency is required by this project url: git::https://github.com//{{.Name}}.git?ref={{.Version}} # ... ``` -------------------------------- ### RMK Secret Key Directory Structure Source: https://github.com/edenlabllc/rmk/blob/develop/docs/configuration/secrets-management/secrets-management.md Illustrates the typical directory structure for storing RMK secret keys locally, organized by project name. Includes examples of key files like .keys.txt, project-deps.txt, and project-project.txt. ```shell ${HOME}/.rmk/sops-age-keys// ${HOME}/.rmk/sops-age-keys/rmk-test/ - .keys.txt - rmk-test-deps.txt - rmk-test-rmk-test.txt ``` -------------------------------- ### RMK GCP Cluster Initialization (CLI & Env Vars) Source: https://github.com/edenlabllc/rmk/blob/develop/docs/configuration/configuration-management/init-gcp-provider.md This API documentation covers the initialization of the RMK cluster provider for GCP. It details how to configure the provider using command-line flags or environment variables, explaining precedence rules and the automatic generation of GCP service account files. It also includes instructions for reconfiguring credentials. ```APIDOC RMK GCP Cluster Initialization: Purpose: Initializes the RMK cluster provider for Google Cloud Platform (GCP). Configuration Methods: 1. Via RMK Flags: Command: rmk config init --cluster-provider=gcp \ --gcp-region= \ --google-application-credentials Description: Initializes RMK using specific command-line flags for GCP configuration. Parameters: --cluster-provider: Specifies 'gcp' as the cluster provider. --gcp-region: The GCP region for the Kubernetes cluster (e.g., 'us-east1'). --google-application-credentials: Absolute path to the GCP service account JSON key file. 2. Via Environment Variables: Commands: export GCP_REGION= export GOOGLE_APPLICATION_CREDENTIALS= rmk config init --cluster-provider=gcp Description: Initializes RMK using environment variables for GCP configuration. Environment Variables: GCP_REGION: Sets the GCP region. GOOGLE_APPLICATION_CREDENTIALS: Sets the path to the GCP service account JSON key file. Precedence: CLI flags take precedence over environment variables if both are specified. Automatic Service Account File Generation: If a GCP service account key file with the correct name is not found during initial configuration, RMK will generate it automatically at `${HOME}/.config/gcloud/gcp-credentials--.json`. Reconfiguration: To update GCP service account credentials: Command: rmk config init --google-application-credentials Description: Modifies the GCP service account credentials by providing a new path to the service account file. ``` -------------------------------- ### RMK AWS Configuration with MFA Source: https://github.com/edenlabllc/rmk/blob/develop/docs/configuration/configuration-management/init-aws-provider.md YAML configuration example for RMK when using AWS Multi-Factor Authentication (MFA), detailing attributes like MFA profile, token expiration, and AWS account details. ```yaml name: rmk-test-develop tenant: rmk-test environment: develop root-domain: rmk-test-develop.edenlab.dev cluster-provider: aws # ... aws-mfa-profile: rmk-test-develop-mfa # AWS profile name for MFA. aws-mfa-token-expiration: "1738006158" # Time expiration MFA token. aws: account_id: "123456789012" config-source: /Users/test-mfa-user/.aws/config_rmk-test-develop credentials-source: /Users/test-mfa-user/.aws/credentials_rmk-test-develop user-name: test-mfa-user mfa-device: arn:aws:iam::123456789012:mfa/test-mfa-user # MFA device AWS ARN. profile: rmk-test-develop region: us-east-1 ``` -------------------------------- ### Generate RMK Project Structure and SOPS Keys Source: https://github.com/edenlabllc/rmk/blob/develop/docs/quickstart.md This command generates the project structure, project.yaml file, and SOPS Age keys for a new RMK project. It requires the rmk CLI tool and specifies the project scope and environment. The output includes generated files and key information. ```shell rmk project generate --scope rmk-test --environment "develop.root-domain=localhost" --create-sops-age-keys ``` -------------------------------- ### Clone Existing Project Repository Source: https://github.com/edenlabllc/rmk/blob/develop/docs/configuration/project-management/preparation-of-project-repository.md Clones an existing project repository from a specified URL using Git. This is a standard Git operation for obtaining a copy of a remote repository. ```shell git clone ``` -------------------------------- ### RMK CAPI Management Cluster Operations Source: https://github.com/edenlabllc/rmk/blob/develop/docs/configuration/cluster-management/cluster-management.md Provides essential commands for managing the local Kubernetes Cluster API (CAPI) management cluster using RMK. This includes creating the initial cluster, updating its configuration or installed providers, and deleting it when no longer needed. The management cluster is crucial for orchestrating the deployment of cloud provider-specific Kubernetes clusters. ```shell rmk cluster capi create # Creates a local CAPI management cluster using a K3D cluster with a lightweight configuration. ``` ```shell rmk cluster capi update # Updates the configuration of the installed CAPI provider, credentials, or adds additional cloud providers to the management cluster. ``` ```shell rmk cluster capi delete # Deletes the existing local CAPI management cluster. Note that this operation does not affect any target Kubernetes clusters provisioned by the management cluster. ``` -------------------------------- ### RMK Help Command Source: https://github.com/edenlabllc/rmk/blob/develop/docs/commands.md Documentation for the help command, used to display command lists or detailed help for a specific command. ```APIDOC help, h Shows a list of commands or help for one command ``` -------------------------------- ### RMK Configuration Initialization with Custom Root Domain Source: https://github.com/edenlabllc/rmk/blob/develop/docs/configuration/configuration-management/configuration-management.md Demonstrates how to initialize RMK configuration when a custom root domain is specified in the project.yaml file. After updating the project.yaml, the standard init command is used. ```yaml project: spec: environments: develop: root-domain: test.example.com ``` ```shell rmk config init ```