From 832baa584caa1086c8d56219e03ffb5c963fc863 Mon Sep 17 00:00:00 2001 From: hedge-sparrow Date: Thu, 15 May 2025 13:43:52 +0100 Subject: [PATCH 1/6] bump sdk chart version --- applications/wg-easy/charts/replicated-sdk/Chart.lock | 6 +++--- applications/wg-easy/charts/replicated-sdk/Chart.yaml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/applications/wg-easy/charts/replicated-sdk/Chart.lock b/applications/wg-easy/charts/replicated-sdk/Chart.lock index fffac1cf..2719b739 100644 --- a/applications/wg-easy/charts/replicated-sdk/Chart.lock +++ b/applications/wg-easy/charts/replicated-sdk/Chart.lock @@ -4,6 +4,6 @@ dependencies: version: 1.0.0 - name: replicated repository: oci://registry.replicated.com/library - version: 1.1.1 -digest: sha256:bb2c4743fae54061dfde5812086300bf9ed7c86f9f4d80ccb0858df407d21a2a -generated: "2025-05-06T15:35:43.881588-04:00" + version: 1.5.3 +digest: sha256:35588c7f070f319202e6194bd952aa4f4195336e6880855076860acfd7fd1736 +generated: "2025-05-15T13:31:37.79846+01:00" diff --git a/applications/wg-easy/charts/replicated-sdk/Chart.yaml b/applications/wg-easy/charts/replicated-sdk/Chart.yaml index 2906a616..2d387a7c 100644 --- a/applications/wg-easy/charts/replicated-sdk/Chart.yaml +++ b/applications/wg-easy/charts/replicated-sdk/Chart.yaml @@ -7,4 +7,4 @@ dependencies: repository: file://../templates - name: replicated repository: oci://registry.replicated.com/library - version: 1.1.1 \ No newline at end of file + version: 1.5.3 From 7ec0bde30e3b567158b4bf1aec05ce2e6a77a23c Mon Sep 17 00:00:00 2001 From: hedge-sparrow Date: Fri, 16 May 2025 14:13:40 +0100 Subject: [PATCH 2/6] Install replicated release as customer --- applications/wg-easy/Taskfile.yaml | 7 +++++- .../{replicated-sdk => replicated}/Chart.lock | 0 .../{replicated-sdk => replicated}/Chart.yaml | 2 +- .../replicated/helmChart-replicated.yaml} | 6 ++--- .../values.yaml | 0 applications/wg-easy/helmfile.yaml.gotmpl | 25 +++++++++++-------- 6 files changed, 25 insertions(+), 15 deletions(-) rename applications/wg-easy/charts/{replicated-sdk => replicated}/Chart.lock (100%) rename applications/wg-easy/charts/{replicated-sdk => replicated}/Chart.yaml (90%) rename applications/wg-easy/charts/{replicated-sdk/replicated/helmChart-replicated-sdk.yaml => replicated/replicated/helmChart-replicated.yaml} (79%) rename applications/wg-easy/charts/{replicated-sdk => replicated}/values.yaml (100%) diff --git a/applications/wg-easy/Taskfile.yaml b/applications/wg-easy/Taskfile.yaml index 8d5dc9f5..22fbb551 100644 --- a/applications/wg-easy/Taskfile.yaml +++ b/applications/wg-easy/Taskfile.yaml @@ -175,6 +175,8 @@ tasks: helm-install: desc: Install all charts using helmfile silent: false + vars: + LICENSE_ID: '{{.LICENSE_ID | default "2cmqT1dBVHZ3aSH21kPxWtgoYGr"}}' cmds: - echo "Installing all charts via helmfile" - | @@ -189,8 +191,11 @@ tasks: ENV_VARS=$(task utils:port-operations OPERATION=getenv CLUSTER_NAME={{.CLUSTER_NAME}}) # Deploy with helmfile + helm registry logout registry.replicated.com || true + helm registry login registry.replicated.com --username test@example.com --password {{.LICENSE_ID}} echo "Using $ENV_VARS" eval "KUBECONFIG={{.KUBECONFIG_FILE}} $ENV_VARS helmfile sync --wait" + helm registry logout registry.replicated.com - echo "All charts installed!" deps: - setup-kubeconfig @@ -230,7 +235,7 @@ tasks: # Copy all non-config.yaml files - echo "Copying non-config YAML files to release folder..." - - find . -path '*/replicated/*.yaml' -not -name 'config.yaml' -exec cp {} ./release/ \; + - find . -path './charts/*/replicated/*.yaml' -exec cp {} ./release/ \; - find ./replicated -name '*.yaml' -not -name 'config.yaml' -exec cp {} ./release/ \; 2>/dev/null || true # extract namespaces from helmChart files diff --git a/applications/wg-easy/charts/replicated-sdk/Chart.lock b/applications/wg-easy/charts/replicated/Chart.lock similarity index 100% rename from applications/wg-easy/charts/replicated-sdk/Chart.lock rename to applications/wg-easy/charts/replicated/Chart.lock diff --git a/applications/wg-easy/charts/replicated-sdk/Chart.yaml b/applications/wg-easy/charts/replicated/Chart.yaml similarity index 90% rename from applications/wg-easy/charts/replicated-sdk/Chart.yaml rename to applications/wg-easy/charts/replicated/Chart.yaml index 2d387a7c..6433f996 100644 --- a/applications/wg-easy/charts/replicated-sdk/Chart.yaml +++ b/applications/wg-easy/charts/replicated/Chart.yaml @@ -1,4 +1,4 @@ -name: replicated-sdk +name: replicated version: 1.0.0 apiVersion: v2 dependencies: diff --git a/applications/wg-easy/charts/replicated-sdk/replicated/helmChart-replicated-sdk.yaml b/applications/wg-easy/charts/replicated/replicated/helmChart-replicated.yaml similarity index 79% rename from applications/wg-easy/charts/replicated-sdk/replicated/helmChart-replicated-sdk.yaml rename to applications/wg-easy/charts/replicated/replicated/helmChart-replicated.yaml index acbc2e60..53e89300 100644 --- a/applications/wg-easy/charts/replicated-sdk/replicated/helmChart-replicated-sdk.yaml +++ b/applications/wg-easy/charts/replicated/replicated/helmChart-replicated.yaml @@ -1,10 +1,10 @@ apiVersion: kots.io/v1beta2 kind: HelmChart metadata: - name: replicated-sdk + name: replicated spec: chart: - name: replicated-sdk + name: replicated weight: 1 # helmUpgradeFlags specifies additional flags to pass to the `helm upgrade` command. @@ -16,5 +16,5 @@ spec: - --wait values: {} - namespace: replicated-sdk + namespace: replicated builder: {} diff --git a/applications/wg-easy/charts/replicated-sdk/values.yaml b/applications/wg-easy/charts/replicated/values.yaml similarity index 100% rename from applications/wg-easy/charts/replicated-sdk/values.yaml rename to applications/wg-easy/charts/replicated/values.yaml diff --git a/applications/wg-easy/helmfile.yaml.gotmpl b/applications/wg-easy/helmfile.yaml.gotmpl index 26cd34b3..00d56467 100644 --- a/applications/wg-easy/helmfile.yaml.gotmpl +++ b/applications/wg-easy/helmfile.yaml.gotmpl @@ -14,19 +14,19 @@ environments: certManagerIssuers: ./charts/cert-manager-issuers traefik: ./charts/traefik wgEasy: ./charts/wg-easy - replicatedSDK: ./charts/replicated-sdk + replicatedSDK: ./charts/replicated - extras: enableReplicatedSDK: false replicated: values: - - app: '{{ env "APP" | default "wg-easy" }}' - - channel: '{{ env "CHANNEL" | default "Unstable" }}' + - app: '{{ env "REPLICATED_APP" | default "wg-easy" }}' + - channel: '{{ env "CHANNEL" | default "unstable" }}' - chartSources: - certManager: 'oci://registry.replicated.com/{{ env "APP" | default "wg-easy" }}/{{ env "CHANNEL" | default "Unstable" }}/cert-manager' - certManagerIssuers: 'oci://registry.replicated.com/{{ env "APP" | default "wg-easy" }}/{{ env "CHANNEL" | default "Unstable" }}/cert-manager-issuers' - traefik: 'oci://registry.replicated.com/{{ env "APP" | default "wg-easy" }}/{{ env "CHANNEL" | default "Unstable" }}/traefik' - wgEasy: 'oci://registry.replicated.com/{{ env "APP" | default "wg-easy" }}/{{ env "CHANNEL" | default "Unstable" }}/wg-easy' - replicatedSDK: 'oci://registry.replicated.com/{{ env "APP" | default "wg-easy" }}/{{ env "CHANNEL" | default "Unstable" }}/replicated-sdk' + certManager: 'oci://registry.replicated.com/{{ env "REPLICATED_APP" | default "wg-easy" }}/{{ env "CHANNEL" | default "unstable" }}/cert-manager' + certManagerIssuers: 'oci://registry.replicated.com/{{ env "REPLICATED_APP" | default "wg-easy" }}/{{ env "CHANNEL" | default "unstable" }}/cert-manager-issuers' + traefik: 'oci://registry.replicated.com/{{ env "REPLICATED_APP" | default "wg-easy" }}/{{ env "CHANNEL" | default "unstable" }}/traefik' + wgEasy: 'oci://registry.replicated.com/{{ env "REPLICATED_APP" | default "wg-easy" }}/{{ env "CHANNEL" | default "unstable" }}/wg-easy' + replicatedSDK: 'oci://registry.replicated.com/{{ env "REPLICATED_APP" | default "wg-easy" }}/{{ env "CHANNEL" | default "unstable" }}/replicated' - extras: enableReplicatedSDK: true --- @@ -35,6 +35,7 @@ releases: - name: cert-manager namespace: cert-manager chart: {{ .Values.chartSources.certManager }} + version: 1.0.0 createNamespace: true wait: true installed: true @@ -44,6 +45,7 @@ releases: - name: cert-manager-issuers namespace: cert-manager chart: {{ .Values.chartSources.certManagerIssuers }} + version: 1.0.0 createNamespace: true wait: true installed: true @@ -54,6 +56,7 @@ releases: - name: traefik namespace: traefik chart: {{ .Values.chartSources.traefik }} + version: 1.0.0 createNamespace: true wait: true installed: true @@ -69,9 +72,10 @@ releases: nodePort: 30443 # Install replicated-sdk (only in replicated environment) - - name: replicated-sdk - namespace: replicated-sdk + - name: replicated + namespace: replicated chart: {{ .Values.chartSources.replicatedSDK }} + version: 1.0.0 createNamespace: true wait: true installed: {{ .Values.extras.enableReplicatedSDK }} @@ -82,6 +86,7 @@ releases: - name: wg-easy namespace: wg-easy chart: {{ .Values.chartSources.wgEasy }} + version: 1.0.0 createNamespace: true wait: true installed: true From 1b44e26cea95e585400ff1b895170b44154461fc Mon Sep 17 00:00:00 2001 From: hedge-sparrow Date: Fri, 16 May 2025 14:27:15 +0100 Subject: [PATCH 3/6] use replicated helmfile env --- applications/wg-easy/Taskfile.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/applications/wg-easy/Taskfile.yaml b/applications/wg-easy/Taskfile.yaml index 22fbb551..c15bf5ce 100644 --- a/applications/wg-easy/Taskfile.yaml +++ b/applications/wg-easy/Taskfile.yaml @@ -188,13 +188,13 @@ tasks: fi # Get exposed URLs - ENV_VARS=$(task utils:port-operations OPERATION=getenv CLUSTER_NAME={{.CLUSTER_NAME}}) + ENV_VARS=$(task utils:port-operations OPERATION=getenv CLUSTER_NAME={{.CLUSTER_NAME}} ) # Deploy with helmfile helm registry logout registry.replicated.com || true helm registry login registry.replicated.com --username test@example.com --password {{.LICENSE_ID}} echo "Using $ENV_VARS" - eval "KUBECONFIG={{.KUBECONFIG_FILE}} $ENV_VARS helmfile sync --wait" + eval "KUBECONFIG={{.KUBECONFIG_FILE}} HELMFILE_ENVIRONMENT=replicated $ENV_VARS helmfile sync --wait" helm registry logout registry.replicated.com - echo "All charts installed!" deps: From 31891584c4c7a9aafeb8a779f8bb53e525024d07 Mon Sep 17 00:00:00 2001 From: hedge-sparrow Date: Fri, 16 May 2025 14:29:50 +0100 Subject: [PATCH 4/6] update docs --- applications/wg-easy/docs/development-workflow.md | 4 +++- applications/wg-easy/docs/task-reference.md | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/applications/wg-easy/docs/development-workflow.md b/applications/wg-easy/docs/development-workflow.md index 29e359dc..13fce2c7 100644 --- a/applications/wg-easy/docs/development-workflow.md +++ b/applications/wg-easy/docs/development-workflow.md @@ -172,7 +172,9 @@ Test multiple charts working together using Helmfile orchestration. 2. Deploy all charts: ```bash - task helm-deploy + # set a license id so we can perform the helm install from the replicated registry + export LICENSE_ID= + task helm-install ``` 3. Verify cross-component integration: diff --git a/applications/wg-easy/docs/task-reference.md b/applications/wg-easy/docs/task-reference.md index 2723c29f..364bc003 100644 --- a/applications/wg-easy/docs/task-reference.md +++ b/applications/wg-easy/docs/task-reference.md @@ -9,7 +9,7 @@ These tasks support the iterative development process, focusing on fast feedback | Task | Description | Related Workflow Stage | |------|-------------|------------------------| | `dependencies-update` | Updates Helm dependencies for all charts in the repository | Stage 1: Dependencies | -| `helm-deploy` | Deploys all charts using helmfile with proper sequencing | Stage 5: Integration Testing | +| `helm-install` | Deploys all charts using helmfile with proper sequencing | Stage 5: Integration Testing | | `ports-expose` | Exposes the configured ports on the cluster for testing | Stage 4-5: Chart Installation/Integration | | `remove-k3s-traefik` | Removes pre-installed Traefik from k3s clusters to avoid conflicts | Stage 4-5: Chart Installation/Integration | @@ -121,7 +121,7 @@ Parameters in the Taskfile.yaml try to always have defaults so that it works out These tasks are designed to support the progressive complexity approach: 1. **Early Stages** - Use `dependencies-update` and helm commands directly -2. **Middle Stages** - Use `cluster-create`, `helm-deploy`, and `test` +2. **Middle Stages** - Use `cluster-create`, `helm-install`, and `test` 3. **Later Stages** - Use `release-prepare`, `release-create`, and embedded cluster tasks This organization allows developers to focus on the appropriate level of complexity at each stage of development. From 08381192937b3020f775563a7c6151988647e172 Mon Sep 17 00:00:00 2001 From: hedge-sparrow Date: Fri, 16 May 2025 16:17:59 +0100 Subject: [PATCH 5/6] Use licenseID from env --- applications/wg-easy/Taskfile.yaml | 17 ++++++++--------- .../wg-easy/docs/development-workflow.md | 2 +- applications/wg-easy/helmfile.yaml.gotmpl | 9 +++++++++ 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/applications/wg-easy/Taskfile.yaml b/applications/wg-easy/Taskfile.yaml index c15bf5ce..b6ae1585 100644 --- a/applications/wg-easy/Taskfile.yaml +++ b/applications/wg-easy/Taskfile.yaml @@ -13,6 +13,7 @@ vars: RELEASE_CHANNELd: '{{.RELEASE_CHANNEL | default "Unstable"}}' RELEASE_VERSION: '{{.RELEASE_VERSION | default "0.0.1"}}' RELEASE_NOTES: '{{.RELEASE_NOTES | default "Release created via task release-create"}}' + REPLICATED_LICENSE_ID: '{{.REPLICATED_LICENSE_ID}}' # Cluster configuration CLUSTER_NAME: '{{.CLUSTER_NAME | default "test-cluster"}}' @@ -54,7 +55,6 @@ tasks: silent: false vars: EMBEDDED: '{{.EMBEDDED | default "false"}}' - LICENSE_ID: '{{if eq .EMBEDDED "true"}}{{.LICENSE_ID | default "2cmqT1dBVHZ3aSH21kPxWtgoYGr"}}{{end}}' TIMEOUT: '{{if eq .EMBEDDED "true"}}420{{else}}300{{end}}' TTL: '{{.TTL | default "4h"}}' status: @@ -62,8 +62,8 @@ tasks: cmds: - | if [ "{{.EMBEDDED}}" = "true" ]; then - echo "Creating embedded cluster {{.CLUSTER_NAME}} with license ID {{.LICENSE_ID}}..." - replicated cluster create --distribution embedded-cluster --name {{.CLUSTER_NAME}} --license-id {{.LICENSE_ID}} --ttl {{.TTL}} + echo "Creating embedded cluster {{.CLUSTER_NAME}} with license ID {{.REPLICATED_LICENSE_ID}}..." + replicated cluster create --distribution embedded-cluster --name {{.CLUSTER_NAME}} --license-id {{.REPLICATED_LICENSE_ID}} --ttl {{.TTL}} else echo "Creating cluster {{.CLUSTER_NAME}} with distribution {{.DISTRIBUTION}}..." replicated cluster create --name {{.CLUSTER_NAME}} --distribution {{.DISTRIBUTION}} --version {{.K8S_VERSION}} --disk {{.DISK_SIZE}} --instance-type {{.INSTANCE_TYPE}} --ttl {{.TTL}} @@ -174,9 +174,11 @@ tasks: helm-install: desc: Install all charts using helmfile - silent: false + silent: true vars: - LICENSE_ID: '{{.LICENSE_ID | default "2cmqT1dBVHZ3aSH21kPxWtgoYGr"}}' + HELM_ENV: '{{.HELM_ENV | default "default"}}' + requires: + vars: [REPLICATED_LICENSE_ID] cmds: - echo "Installing all charts via helmfile" - | @@ -191,11 +193,8 @@ tasks: ENV_VARS=$(task utils:port-operations OPERATION=getenv CLUSTER_NAME={{.CLUSTER_NAME}} ) # Deploy with helmfile - helm registry logout registry.replicated.com || true - helm registry login registry.replicated.com --username test@example.com --password {{.LICENSE_ID}} echo "Using $ENV_VARS" - eval "KUBECONFIG={{.KUBECONFIG_FILE}} HELMFILE_ENVIRONMENT=replicated $ENV_VARS helmfile sync --wait" - helm registry logout registry.replicated.com + eval "KUBECONFIG={{.KUBECONFIG_FILE}} HELMFILE_ENVIRONMENT={{.HELM_ENV}} REPLICATED_APP={{.APP_SLUG}} $ENV_VARS helmfile sync --wait" - echo "All charts installed!" deps: - setup-kubeconfig diff --git a/applications/wg-easy/docs/development-workflow.md b/applications/wg-easy/docs/development-workflow.md index 13fce2c7..2abd5385 100644 --- a/applications/wg-easy/docs/development-workflow.md +++ b/applications/wg-easy/docs/development-workflow.md @@ -173,7 +173,7 @@ Test multiple charts working together using Helmfile orchestration. ```bash # set a license id so we can perform the helm install from the replicated registry - export LICENSE_ID= + export REPLICATED_LICENSE_ID= task helm-install ``` diff --git a/applications/wg-easy/helmfile.yaml.gotmpl b/applications/wg-easy/helmfile.yaml.gotmpl index 00d56467..6c0017b9 100644 --- a/applications/wg-easy/helmfile.yaml.gotmpl +++ b/applications/wg-easy/helmfile.yaml.gotmpl @@ -21,6 +21,8 @@ environments: values: - app: '{{ env "REPLICATED_APP" | default "wg-easy" }}' - channel: '{{ env "CHANNEL" | default "unstable" }}' + - username: "test@example.com" + - password: '{{env "REPLICATED_LICENSE_ID"}}' - chartSources: certManager: 'oci://registry.replicated.com/{{ env "REPLICATED_APP" | default "wg-easy" }}/{{ env "CHANNEL" | default "unstable" }}/cert-manager' certManagerIssuers: 'oci://registry.replicated.com/{{ env "REPLICATED_APP" | default "wg-easy" }}/{{ env "CHANNEL" | default "unstable" }}/cert-manager-issuers' @@ -30,6 +32,13 @@ environments: - extras: enableReplicatedSDK: true --- +repositories: + - name: registry.replicated.com + oci: true + url: registry.replicated.com + username: '{{ .Values.username }}' + password: '{{ .Values.password }}' + releases: # Install cert-manager with CRDs but without issuers - name: cert-manager From 80dd3ea2864798964aa0831f403345d8e7f27f5f Mon Sep 17 00:00:00 2001 From: hedge-sparrow Date: Fri, 16 May 2025 16:38:37 +0100 Subject: [PATCH 6/6] Document how to switch helmfile env from task --- applications/wg-easy/docs/development-workflow.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/applications/wg-easy/docs/development-workflow.md b/applications/wg-easy/docs/development-workflow.md index f3cd91d6..c90e3855 100644 --- a/applications/wg-easy/docs/development-workflow.md +++ b/applications/wg-easy/docs/development-workflow.md @@ -189,6 +189,9 @@ Test multiple charts working together using Helmfile orchestration. # set a license id so we can perform the helm install from the replicated registry export REPLICATED_LICENSE_ID= task helm-install + + # or to deploy using the replicated released OCI charts + task helm-install HELM_ENV=replicated ``` 3. Verify cross-component integration: