Skip to content

Commit 5ef84ce

Browse files
authored
Initial helmchart (#35)
* Add initial helm chart * rename to Charts * remove helm folder * add publish helm workflow
1 parent 2ced600 commit 5ef84ce

16 files changed

+544
-0
lines changed

.github/workflows/publish-containers.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ jobs:
4646
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
4747
with:
4848
images: ${{ env.IMAGE_REPOSITORY }}
49+
tags: |
50+
type=ref,event=tag
51+
type=raw,value=latest
4952
# This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages.
5053
# It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository.
5154
# It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step.

.github/workflows/publish-helm.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Package helm charts
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
env:
8+
HELM_VERSION_TO_INSTALL: 3.14.3
9+
10+
jobs:
11+
package-helm-charts:
12+
name: Package and Push Helm Chart
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Install helm
21+
uses: Azure/setup-helm@v3
22+
with:
23+
version: ${{ env.HELM_VERSION_TO_INSTALL }}
24+
25+
# Check that alpha/beta versions have the form X.Y.Z-alpha.A requried by Helm.
26+
# An early check saves waiting for the entire build before finding a problem.
27+
- name: Check helm version tag
28+
if: ${{ github.ref_type == 'tag' }}
29+
env:
30+
VERSION: "${{ github.ref_name }}"
31+
run: |
32+
if [[ "${VERSION}" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-alpha|-beta|-rc).*?$ ]]; then
33+
echo "Valid version format: ${VERSION}"
34+
else
35+
echo "Invalid version: ${VERSION}. Expected: X.Y.Z or X.Y.Z-beta.1 or X.Y.Z-alpha.1"
36+
exit 1
37+
fi
38+
39+
- name: Package helm charts
40+
env:
41+
VERSION: "${{ github.ref_type == 'tag' && github.ref_name || '0.0.0' }}"
42+
run: |
43+
set -xe
44+
45+
mkdir -p charts
46+
for i in $(find Charts -type d -maxdepth 1 -mindepth 1); do
47+
if [[ ${i} =~ ^.*-ioc$ ]]; then
48+
echo "Skipping IOC schema chart: ${i}"
49+
continue
50+
fi
51+
echo "Packaging chart: ${i}"
52+
helm package -u --app-version ${VERSION} --version ${VERSION} ${i}
53+
mv $(basename ${i})-*.tgz charts/
54+
done
55+
56+
- name: Upload helm chart values schemas
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: helm-chart-schemas
60+
path: schemas/*
61+
62+
- name: Push tagged helm chart to registry
63+
# TODO - switch to using https://github.com/helm/chart-releaser-action of maybe the docker action?
64+
if: ${{ github.ref_type == 'tag' }}
65+
run: |
66+
set -x
67+
68+
echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io/${{ github.repository_owner }} --username ${{ github.repository_owner }} --password-stdin
69+
REGISTRY=oci://ghcr.io/${{github.repository_owner }}/charts
70+
for i in charts/*.tgz; do
71+
helm push "${i}" ${REGISTRY,,}
72+
done

Charts/web-conexs/.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Created by https://www.toptal.com/developers/gitignore/api/helm
2+
# Edit at https://www.toptal.com/developers/gitignore?templates=helm
3+
4+
### Helm ###
5+
# Chart dependencies
6+
**/charts/*.tgz
7+
8+
# End of https://www.toptal.com/developers/gitignore/api/helm

Charts/web-conexs/Chart.lock

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
dependencies:
2+
- name: postgresql
3+
repository: https://charts.bitnami.com/bitnami
4+
version: 12.4.1
5+
- name: oauth2-proxy
6+
repository: https://oauth2-proxy.github.io/manifests/
7+
version: 7.5.1
8+
digest: sha256:edfe90fd4cbfb521123b798b9dfbb2edf43eb7f3c1493150482a9ce6d20554f8
9+
generated: "2025-08-29T09:21:49.022387356+01:00"

Charts/web-conexs/Chart.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
apiVersion: v2
2+
name: web-conexs-app
3+
description: A Helm chart for Kubernetes
4+
5+
# A chart can be either an 'application' or a 'library' chart.
6+
#
7+
# Application charts are a collection of templates that can be packaged into versioned archives
8+
# to be deployed.
9+
#
10+
# Library charts provide useful utilities or functions for the chart developer. They're included as
11+
# a dependency of application charts to inject those utilities and functions into the rendering
12+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
13+
type: application
14+
15+
# This is the chart version. This version number should be incremented each time you make changes
16+
# to the chart and its templates, including the app version.
17+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18+
version: 0.1.0
19+
20+
# This is the version number of the application being deployed. This version number should be
21+
# incremented each time you make changes to the application. Versions are not expected to
22+
# follow Semantic Versioning. They should reflect the version the application is using.
23+
# It is recommended to use it with quotes.
24+
appVersion: "0.1.0"
25+
26+
dependencies:
27+
- name: postgresql
28+
version: "12.4.1"
29+
repository: https://charts.bitnami.com/bitnami
30+
- name: oauth2-proxy
31+
version: "7.5.1"
32+
repository: https://oauth2-proxy.github.io/manifests/
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "web-conexs.name" -}}
5+
{{- default .Values.global.name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
9+
{{/*
10+
Create a default fully qualified app name.
11+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
12+
If release name contains chart name it will be used as a full name.
13+
*/}}
14+
15+
{{- define "web-conexs.fullname2" -}}
16+
{{- if .Values.fullnameOverride }}
17+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
18+
{{- else }}
19+
{{- $name := default .Values.global.name .Values.nameOverride }}
20+
{{- if contains $name .Release.Name }}
21+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
22+
{{- else }}
23+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
24+
{{- end }}
25+
{{- end }}
26+
{{- end }}
27+
28+
29+
{{- define "web-conexs.fullname" -}}
30+
{{ "web-conexs-app" }}
31+
{{- end }}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ include "web-conexs.fullname" . }}-api
5+
spec:
6+
replicas: {{ .Values.api.deployment.replicas }}
7+
selector:
8+
matchLabels:
9+
app: {{ include "web-conexs.fullname" . }}-api
10+
template:
11+
metadata:
12+
labels:
13+
app: {{ include "web-conexs.fullname" . }}-api
14+
spec:
15+
volumes:
16+
- name: data-pv-volume
17+
persistentVolumeClaim:
18+
claimName: data-pv-claim
19+
containers:
20+
- name: {{ include "web-conexs.fullname" . }}-api
21+
image: "{{ .Values.api.deployment.image.repository }}:{{ .Values.api.deployment.image.tag | default .Chart.AppVersion }}"
22+
args: ["-m", "web_conexs_api"]
23+
resources:
24+
{{- toYaml .Values.api.resources | nindent 12 }}
25+
ports:
26+
- name: http
27+
containerPort: {{ .Values.api.service.targetPort }}
28+
volumeMounts:
29+
- mountPath: {{ .Values.data.mountPath}}
30+
name: data-pv-volume
31+
env:
32+
- name: POSTGRESS_PASSWORD
33+
valueFrom:
34+
secretKeyRef:
35+
name: application-passwords
36+
key: passwords
37+
- name: POSTGRESURL
38+
value: {{ .Values.database.protocol }}://{{ .Values.database.username }}:$(POSTGRESS_PASSWORD)@{{.Release.Name}}-postgresql.{{.Release.Namespace}}.svc.cluster.local/{{ .Values.database.dbname }}
39+
- name: OIDC_USER_INFO_ENDPOINT
40+
value: {{ .Values.auth.userInfoEndpoint}}
41+
- name: OIDC_ID_KEY
42+
value: {{ .Values.auth.idKey}}
43+
- name: CONEXS_STORAGE_DIR
44+
value: {{ .Values.data.location}}
45+
- name: PMG_MAPI_KEY
46+
valueFrom:
47+
secretKeyRef:
48+
name: matproj-api-key
49+
key: key
50+
envFrom:
51+
- configMapRef:
52+
name: {{ include "web-conexs.fullname" . }}-dbenv-configmap
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ include "web-conexs.fullname" . }}-api-svc
5+
spec:
6+
ports:
7+
- name: http
8+
port: {{ .Values.global.api.port }}
9+
protocol: TCP
10+
targetPort: {{ .Values.api.service.targetPort }}
11+
selector:
12+
app: {{ include "web-conexs.fullname" . }}-api
13+
type: {{ .Values.api.service.type }}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ include "web-conexs.fullname" . }}-client
5+
spec:
6+
replicas: 1
7+
selector:
8+
matchLabels:
9+
app: {{ include "web-conexs.fullname" . }}-client
10+
template:
11+
metadata:
12+
labels:
13+
app: {{ include "web-conexs.fullname" . }}-client
14+
spec:
15+
containers:
16+
- name: {{ include "web-conexs.fullname" . }}-client
17+
image: "{{ .Values.client.deployment.image.repository }}:{{ .Values.client.deployment.image.tag | default .Chart.AppVersion }}"
18+
resources:
19+
{{- toYaml .Values.api.resources | nindent 12 }}
20+
ports:
21+
- name: http
22+
containerPort: 80
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ include "web-conexs.fullname" . }}-client-svc
5+
spec:
6+
ports:
7+
- name: http
8+
port: {{ .Values.global.client.port }}
9+
protocol: TCP
10+
targetPort: 80
11+
selector:
12+
app: {{ include "web-conexs.fullname" . }}-client
13+
type: {{ .Values.client.service.type }}

0 commit comments

Comments
 (0)