Skip to content

Commit 0630f0c

Browse files
Install helm charts from OCI registry (#63)
* bump sdk chart version * Install replicated release as customer * use replicated helmfile env * update docs * Use licenseID from env * Document how to switch helmfile env from task
1 parent a4d7404 commit 0630f0c

File tree

7 files changed

+48
-25
lines changed

7 files changed

+48
-25
lines changed

applications/wg-easy/Taskfile.yaml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ vars:
1313
RELEASE_CHANNELd: '{{.RELEASE_CHANNEL | default "Unstable"}}'
1414
RELEASE_VERSION: '{{.RELEASE_VERSION | default "0.0.1"}}'
1515
RELEASE_NOTES: '{{.RELEASE_NOTES | default "Release created via task release-create"}}'
16+
REPLICATED_LICENSE_ID: '{{.REPLICATED_LICENSE_ID}}'
1617

1718
# Cluster configuration
1819
CLUSTER_NAME: '{{.CLUSTER_NAME | default "test-cluster"}}'
@@ -54,7 +55,6 @@ tasks:
5455
silent: false
5556
vars:
5657
EMBEDDED: '{{.EMBEDDED | default "false"}}'
57-
LICENSE_ID: '{{if eq .EMBEDDED "true"}}{{.LICENSE_ID | default "2cmqT1dBVHZ3aSH21kPxWtgoYGr"}}{{end}}'
5858
TIMEOUT: '{{if eq .EMBEDDED "true"}}420{{else}}300{{end}}'
5959
TTL: '{{.TTL | default "4h"}}'
6060
status:
@@ -71,8 +71,8 @@ tasks:
7171
- |
7272
echo "Creating new cluster {{.CLUSTER_NAME}}..."
7373
if [ "{{.EMBEDDED}}" = "true" ]; then
74-
echo "Creating embedded cluster {{.CLUSTER_NAME}} with license ID {{.LICENSE_ID}}..."
75-
replicated cluster create --distribution embedded-cluster --name {{.CLUSTER_NAME}} --license-id {{.LICENSE_ID}} --ttl {{.TTL}}
74+
echo "Creating embedded cluster {{.CLUSTER_NAME}} with license ID {{.REPLICATED_LICENSE_ID}}..."
75+
replicated cluster create --distribution embedded-cluster --name {{.CLUSTER_NAME}} --license-id {{.REPLICATED_LICENSE_ID}} --ttl {{.TTL}}
7676
else
7777
echo "Creating cluster {{.CLUSTER_NAME}} with distribution {{.DISTRIBUTION}}..."
7878
replicated cluster create --name {{.CLUSTER_NAME}} --distribution {{.DISTRIBUTION}} --version {{.K8S_VERSION}} --disk {{.DISK_SIZE}} --instance-type {{.INSTANCE_TYPE}} --ttl {{.TTL}}
@@ -202,7 +202,11 @@ tasks:
202202

203203
helm-install:
204204
desc: Install all charts using helmfile
205-
silent: false
205+
silent: true
206+
vars:
207+
HELM_ENV: '{{.HELM_ENV | default "default"}}'
208+
requires:
209+
vars: [REPLICATED_LICENSE_ID]
206210
cmds:
207211
- echo "Installing all charts via helmfile"
208212
- |
@@ -214,11 +218,11 @@ tasks:
214218
fi
215219
216220
# Get exposed URLs
217-
ENV_VARS=$(task utils:port-operations OPERATION=getenv CLUSTER_NAME={{.CLUSTER_NAME}})
221+
ENV_VARS=$(task utils:port-operations OPERATION=getenv CLUSTER_NAME={{.CLUSTER_NAME}} )
218222
219223
# Deploy with helmfile
220224
echo "Using $ENV_VARS"
221-
eval "KUBECONFIG={{.KUBECONFIG_FILE}} $ENV_VARS helmfile sync --wait"
225+
eval "KUBECONFIG={{.KUBECONFIG_FILE}} HELMFILE_ENVIRONMENT={{.HELM_ENV}} REPLICATED_APP={{.APP_SLUG}} $ENV_VARS helmfile sync --wait"
222226
- echo "All charts installed!"
223227
deps:
224228
- setup-kubeconfig
@@ -258,7 +262,7 @@ tasks:
258262

259263
# Copy all non-config.yaml files
260264
- echo "Copying non-config YAML files to release folder..."
261-
- find . -path '*/replicated/*.yaml' -not -name 'config.yaml' -exec cp {} ./release/ \;
265+
- find . -path './charts/*/replicated/*.yaml' -exec cp {} ./release/ \;
262266
- find ./replicated -name '*.yaml' -not -name 'config.yaml' -exec cp {} ./release/ \; 2>/dev/null || true
263267

264268
# extract namespaces from helmChart files

applications/wg-easy/charts/replicated-sdk/Chart.lock renamed to applications/wg-easy/charts/replicated/Chart.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ dependencies:
44
version: 1.0.0
55
- name: replicated
66
repository: oci://registry.replicated.com/library
7-
version: 1.1.1
8-
digest: sha256:bb2c4743fae54061dfde5812086300bf9ed7c86f9f4d80ccb0858df407d21a2a
9-
generated: "2025-05-06T15:35:43.881588-04:00"
7+
version: 1.5.3
8+
digest: sha256:35588c7f070f319202e6194bd952aa4f4195336e6880855076860acfd7fd1736
9+
generated: "2025-05-15T13:31:37.79846+01:00"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: replicated-sdk
1+
name: replicated
22
version: 1.0.0
33
apiVersion: v2
44
dependencies:
@@ -7,4 +7,4 @@ dependencies:
77
repository: file://../templates
88
- name: replicated
99
repository: oci://registry.replicated.com/library
10-
version: 1.1.1
10+
version: 1.5.3
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
apiVersion: kots.io/v1beta2
22
kind: HelmChart
33
metadata:
4-
name: replicated-sdk
4+
name: replicated
55
spec:
66
chart:
7-
name: replicated-sdk
7+
name: replicated
88
weight: 1
99

1010
# helmUpgradeFlags specifies additional flags to pass to the `helm upgrade` command.
@@ -16,5 +16,5 @@ spec:
1616
- --wait
1717

1818
values: {}
19-
namespace: replicated-sdk
19+
namespace: replicated
2020
builder: {}

applications/wg-easy/docs/development-workflow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,12 @@ Test multiple charts working together using Helmfile orchestration.
194194
2. Deploy all charts:
195195
196196
```bash
197+
# set a license id so we can perform the helm install from the replicated registry
198+
export REPLICATED_LICENSE_ID=<customer license id>
197199
task helm-install
200+
201+
# or to deploy using the replicated released OCI charts
202+
task helm-install HELM_ENV=replicated
198203
```
199204

200205
3. Verify cross-component integration:

applications/wg-easy/helmfile.yaml.gotmpl

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,37 @@ environments:
1414
certManagerIssuers: ./charts/cert-manager-issuers
1515
traefik: ./charts/traefik
1616
wgEasy: ./charts/wg-easy
17-
replicatedSDK: ./charts/replicated-sdk
17+
replicatedSDK: ./charts/replicated
1818
- extras:
1919
enableReplicatedSDK: false
2020
replicated:
2121
values:
22-
- app: '{{ env "APP" | default "wg-easy" }}'
23-
- channel: '{{ env "CHANNEL" | default "Unstable" }}'
22+
- app: '{{ env "REPLICATED_APP" | default "wg-easy" }}'
23+
- channel: '{{ env "CHANNEL" | default "unstable" }}'
24+
- username: "[email protected]"
25+
- password: '{{env "REPLICATED_LICENSE_ID"}}'
2426
- chartSources:
25-
certManager: 'oci://registry.replicated.com/{{ env "APP" | default "wg-easy" }}/{{ env "CHANNEL" | default "Unstable" }}/cert-manager'
26-
certManagerIssuers: 'oci://registry.replicated.com/{{ env "APP" | default "wg-easy" }}/{{ env "CHANNEL" | default "Unstable" }}/cert-manager-issuers'
27-
traefik: 'oci://registry.replicated.com/{{ env "APP" | default "wg-easy" }}/{{ env "CHANNEL" | default "Unstable" }}/traefik'
28-
wgEasy: 'oci://registry.replicated.com/{{ env "APP" | default "wg-easy" }}/{{ env "CHANNEL" | default "Unstable" }}/wg-easy'
29-
replicatedSDK: 'oci://registry.replicated.com/{{ env "APP" | default "wg-easy" }}/{{ env "CHANNEL" | default "Unstable" }}/replicated-sdk'
27+
certManager: 'oci://registry.replicated.com/{{ env "REPLICATED_APP" | default "wg-easy" }}/{{ env "CHANNEL" | default "unstable" }}/cert-manager'
28+
certManagerIssuers: 'oci://registry.replicated.com/{{ env "REPLICATED_APP" | default "wg-easy" }}/{{ env "CHANNEL" | default "unstable" }}/cert-manager-issuers'
29+
traefik: 'oci://registry.replicated.com/{{ env "REPLICATED_APP" | default "wg-easy" }}/{{ env "CHANNEL" | default "unstable" }}/traefik'
30+
wgEasy: 'oci://registry.replicated.com/{{ env "REPLICATED_APP" | default "wg-easy" }}/{{ env "CHANNEL" | default "unstable" }}/wg-easy'
31+
replicatedSDK: 'oci://registry.replicated.com/{{ env "REPLICATED_APP" | default "wg-easy" }}/{{ env "CHANNEL" | default "unstable" }}/replicated'
3032
- extras:
3133
enableReplicatedSDK: true
3234
---
35+
repositories:
36+
- name: registry.replicated.com
37+
oci: true
38+
url: registry.replicated.com
39+
username: '{{ .Values.username }}'
40+
password: '{{ .Values.password }}'
41+
3342
releases:
3443
# Install cert-manager with CRDs but without issuers
3544
- name: cert-manager
3645
namespace: cert-manager
3746
chart: {{ .Values.chartSources.certManager }}
47+
version: 1.0.0
3848
createNamespace: true
3949
wait: true
4050
installed: true
@@ -44,6 +54,7 @@ releases:
4454
- name: cert-manager-issuers
4555
namespace: cert-manager
4656
chart: {{ .Values.chartSources.certManagerIssuers }}
57+
version: 1.0.0
4758
createNamespace: true
4859
wait: true
4960
installed: true
@@ -54,6 +65,7 @@ releases:
5465
- name: traefik
5566
namespace: traefik
5667
chart: {{ .Values.chartSources.traefik }}
68+
version: 1.0.0
5769
createNamespace: true
5870
wait: true
5971
installed: true
@@ -69,9 +81,10 @@ releases:
6981
nodePort: 30443
7082

7183
# Install replicated-sdk (only in replicated environment)
72-
- name: replicated-sdk
73-
namespace: replicated-sdk
84+
- name: replicated
85+
namespace: replicated
7486
chart: {{ .Values.chartSources.replicatedSDK }}
87+
version: 1.0.0
7588
createNamespace: true
7689
wait: true
7790
installed: {{ .Values.extras.enableReplicatedSDK }}
@@ -82,6 +95,7 @@ releases:
8295
- name: wg-easy
8396
namespace: wg-easy
8497
chart: {{ .Values.chartSources.wgEasy }}
98+
version: 1.0.0
8599
createNamespace: true
86100
wait: true
87101
installed: true

0 commit comments

Comments
 (0)