Skip to content

Commit b40c573

Browse files
feat: add helm chart (#41)
Signed-off-by: Andres Vallecilla <andresfelipe083195@hotmail.com> Signed-off-by: Gabriel Mata <gabrielmatau@gmail.com> Co-authored-by: Gabriel Mata <gabrielmatau@gmail.com>
1 parent 74181dc commit b40c573

File tree

7 files changed

+435
-7
lines changed

7 files changed

+435
-7
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ jobs:
4141
- name: Checkout credo-ts-indy-vdr-proxy
4242
uses: actions/checkout@v2
4343

44+
- name: Setup Helm
45+
uses: azure/setup-helm@v3
46+
4447
- name: Setup NodeJS
4548
uses: ./.github/actions/setup-node
4649
with:
@@ -58,6 +61,9 @@ jobs:
5861
- name: Compile
5962
run: yarn check-types
6063

64+
- name: Validate Helm chart
65+
run: helm lint ./charts
66+
6167
tests:
6268
runs-on: ubuntu-latest
6369
name: Tests
@@ -107,6 +113,10 @@ jobs:
107113
fail-fast: false
108114
matrix:
109115
package: ${{fromJson(needs.package-finder.outputs.packages)}}
116+
env:
117+
DH_USERNAME: ${{ secrets.DOCKER_HUB_LOGIN }}
118+
DH_TOKEN: ${{ secrets.DOCKER_HUB_PWD }}
119+
IMAGE_NAME: "indy-vdr-proxy"
110120
steps:
111121
- uses: google-github-actions/release-please-action@v2
112122
id: release-please
@@ -137,14 +147,26 @@ jobs:
137147
env:
138148
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
139149
if: ${{ steps.release-please.outputs.release_created }}
150+
- name: Setup Helm
151+
if: ${{ steps.release-please.outputs.release_created }}
152+
uses: azure/setup-helm@v3
140153

141154
- name: Build and publish Docker image
142-
env:
143-
DH_USERNAME: ${{ secrets.DOCKER_HUB_LOGIN }}
144-
DH_TOKEN: ${{ secrets.DOCKER_HUB_PWD }}
145-
IMAGE_NAME: "indy-vdr-proxy"
146155
run: |
147156
echo "$DH_TOKEN" | docker login -u "$DH_USERNAME" --password-stdin
148-
docker build -f ./packages/{{ matrix.package }}/Dockerfile -t $DH_USERNAME/$IMAGE_NAME:dev ./packages/{{ matrix.package }}
149-
docker push $DH_USERNAME/$IMAGE_NAME:dev
157+
docker build -t $DH_USERNAME/$IMAGE_NAME:v$RELEASE_VERSION ./packages/{{ matrix.package }}
158+
docker push $DH_USERNAME/$IMAGE_NAME:v$RELEASE_VERSION
150159
if: ${{ (steps.release-please.outputs.release_created == 'true') && (matrix.package == 'server') }}
160+
161+
- name: Log in to Docker Hub Helm Registry
162+
run: |
163+
echo "$DH_TOKEN" | helm registry login -u "$DH_USERNAME" --password-stdin docker.io
164+
165+
- name: Push Helm chart to Docker Hub OCI repo
166+
env:
167+
RELEASE_VERSION: ${{ steps.release-please.outputs.release_version }}
168+
run: |
169+
sed -i "s/^version:.*/version: $RELEASE_VERSION/" ./charts/Chart.yaml
170+
helm dependency update ./charts
171+
helm package ./charts -d ./charts
172+
helm push ./charts/$IMAGE_NAME-$RELEASE_VERSION.tgz oci://docker.io/$DH_USERNAME

.prettierignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ build
44
.idea
55
coverage
66
CHANGELOG.md
7-
routes
7+
routes
8+
charts

charts/Chart.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
apiVersion: v2
2+
name: indy-vdr-proxy-chart
3+
description: Helm chart for deploying indy-vdr-proxy
4+
type: application
5+
version: 0.0.4

charts/README.md

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
# indy-vdr-proxy-server-chart
2+
3+
## 🛍️ Overview
4+
5+
This Helm chart deploys the `indy-vdr-proxy` application and its optional companion service `app-check-proxy`. It includes:
6+
7+
- **StatefulSet**: Main application container with optional app-check-proxy sidecar.
8+
- **Service**: Exposes HTTP and optionally App Check endpoints.
9+
- **Ingress**: Routes external traffic based on configuration.
10+
- **ConfigMap**: Defines runtime configurations such as `app.config.json` and (optionally) `ENDPOINT_URLS`.
11+
12+
---
13+
14+
## 📁 Chart Structure
15+
16+
```
17+
indy-vdr-proxy-server-chart/
18+
├── Chart.yaml
19+
├── values.yaml
20+
└── templates/
21+
├── _helpers.tpl
22+
├── deployment.yaml
23+
```
24+
25+
- `Chart.yaml`: Chart metadata.
26+
- `values.yaml`: Centralized configuration file (all logic controlled from here).
27+
- `templates/`: All Kubernetes manifests, conditionally rendered using Helm logic.
28+
29+
---
30+
31+
## 🚀 Installation
32+
33+
### 1. Lint the Chart
34+
35+
```bash
36+
helm lint ./deployments/indy-vdr-proxy-server
37+
```
38+
39+
### 2. Render Templates (preview output)
40+
41+
```bash
42+
helm template indy-vdr ./deployments/indy-vdr-proxy-server --namespace <your-namespace>
43+
```
44+
45+
### 3. Dry-Run Installation
46+
47+
```bash
48+
helm install --dry-run --debug indy-vdr ./deployments/indy-vdr-proxy-server --namespace <your-namespace>
49+
```
50+
51+
### 4. Install the Chart
52+
53+
```bash
54+
helm install indy-vdr ./deployments/indy-vdr-proxy-server --namespace <your-namespace>
55+
```
56+
57+
> If the namespace doesn't exist, create it manually or configure `createNamespace` in your Helm pipeline logic.
58+
59+
---
60+
61+
## ⚙️ Configuration
62+
63+
All configuration is centralized in `values.yaml`.
64+
65+
### 🌐 Global
66+
67+
```yaml
68+
global:
69+
domain: dev.2060.io
70+
```
71+
72+
### 📦 Application
73+
74+
```yaml
75+
app:
76+
name: indy-vdr-proxy
77+
```
78+
79+
### 🏗️ StatefulSet
80+
81+
- Fully configurable image, resources, replicas.
82+
- Includes support for optional `app-check-proxy` sidecar.
83+
84+
```yaml
85+
statefulset:
86+
replicas: 1
87+
containerName: indy-vdr-proxy-container
88+
image:
89+
repository: io2060/indy-vdr-proxy
90+
tag: dev
91+
pullPolicy: Always
92+
env:
93+
INDY_VDR_PROXY_PORT: "3000"
94+
INDY_VDR_PROXY_CONFIG_PATH: "/config/vdr-proxy/app.config.json"
95+
```
96+
97+
### ✅ App Check Proxy (optional sidecar)
98+
99+
```yaml
100+
appCheckProxy:
101+
enabled: true
102+
name: app-check-proxy-container
103+
image:
104+
repository: io2060/app-check-proxy
105+
tag: dev
106+
pullPolicy: Always
107+
env:
108+
APP_PORT: "3100"
109+
FIREBASE_CFG_FILE: "/config/app-check-proxy/firebase-cfg.json"
110+
```
111+
112+
If disabled, the following are skipped:
113+
114+
- Sidecar container
115+
- App Check port in service and ingress
116+
- `ENDPOINT_URLS` from ConfigMap
117+
118+
### 🧹 ConfigMap
119+
120+
Includes two key files:
121+
122+
- `app.config.json` (always rendered)
123+
- `ENDPOINT_URLS` (only rendered if `appCheckProxy.enabled: true`)
124+
125+
Uses `tpl` to support inline template logic from `values.yaml`.
126+
127+
```yaml
128+
configMap:
129+
appConfigJson: |
130+
{
131+
"some": "config"
132+
}
133+
endpointUrls: |
134+
{
135+
"verana:gov": "https://verana.gov/endpoint"
136+
}
137+
```
138+
139+
### 🌐 Ingress
140+
141+
```yaml
142+
ingress:
143+
enabled: true
144+
name: indy-vdr-proxy
145+
className: nginx
146+
host: "indyvdrproxy.ca.{{ .Values.global.domain }}"
147+
tlsSecretName: "indyvdrproxy.ca.{{ .Values.global.domain }}-cert"
148+
annotations:
149+
cert-manager.io/cluster-issuer: letsencrypt-prod
150+
```
151+
152+
> The ingress backend port is dynamically selected depending on whether `appCheckProxy` is enabled.
153+
154+
### 📡 Service
155+
156+
Exposes two ports if `appCheckProxy.enabled: true`, otherwise only HTTP.
157+
158+
```yaml
159+
service:
160+
ports:
161+
http: 3000
162+
appCheck: 3100
163+
```
164+
165+
---
166+
167+
## 🔄 Uninstalling
168+
169+
```bash
170+
helm uninstall indy-vdr --namespace <your-namespace>
171+
```

charts/templates/_helpers.tpl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{{- define "indy-vdr-proxy.name" -}}
2+
{{- .Chart.Name -}}
3+
{{- end -}}
4+
5+
{{- define "indy-vdr-proxy.fullname" -}}
6+
{{- printf "%s" .Chart.Name | trunc 63 | trimSuffix "-" -}}
7+
{{- end -}}
8+
9+
{{- define "indy-vdr-proxy.labels" -}}
10+
helm.sh/chart: {{ include "indy-vdr-proxy.name" . }}-{{ .Chart.Version | replace "+" "_" }}
11+
app.kubernetes.io/managed-by: {{ .Release.Service }}
12+
{{- end -}}
13+
14+
{{- define "indy-vdr-proxy.selectorLabels" -}}
15+
app.kubernetes.io/name: {{ include "indy-vdr-proxy.name" . }}
16+
app.kubernetes.io/instance: {{ .Release.Name }}
17+
{{- end -}}

0 commit comments

Comments
 (0)