Skip to content

Commit 686dee2

Browse files
authored
Helm deployment (#56)
* feat(helm): support
1 parent 5b3111f commit 686dee2

19 files changed

+1228
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Publish Helm Chart to GHCR
2+
3+
on:
4+
push:
5+
tags:
6+
- 'chart-v*'
7+
workflow_dispatch:
8+
9+
env:
10+
REGISTRY: ghcr.io
11+
CHART_NAME: aconext
12+
CHART_PATH: charts/aconext
13+
HELM_VERSION: 'v4.0.1'
14+
15+
jobs:
16+
publish:
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
packages: write
21+
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
26+
- name: Set up Helm
27+
uses: azure/setup-helm@v4
28+
with:
29+
version: ${{ env.HELM_VERSION }}
30+
31+
- name: Package Helm chart
32+
run: |
33+
helm dependency update ${{ env.CHART_PATH }}
34+
35+
- name: Publish new helm chart for aconext
36+
run: |
37+
echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ghcr.io --username ${{ github.actor }} --password-stdin
38+
39+
ACONEXT_CHART_VERSION_TAG=$(cat ${{ env.CHART_PATH }}/Chart.yaml | grep version: | cut -d " " -f 2)
40+
41+
echo "ACONEXT_CHART_VERSION_TAG=${ACONEXT_CHART_VERSION_TAG}" >> $GITHUB_ENV
42+
43+
helm package ${{ env.CHART_PATH }}/ --version="${ACONEXT_CHART_VERSION_TAG}"
44+
45+
helm push ${{ env.CHART_NAME }}-"${ACONEXT_CHART_VERSION_TAG}".tgz oci://ghcr.io/${{ github.repository_owner }}/helm-charts
46+
47+
- name: Output chart location
48+
run: |
49+
echo "Chart published to: ${{ env.REGISTRY }}/${{ github.repository_owner }}/helm-charts/${{ env.CHART_NAME }}:${ACONEXT_CHART_VERSION_TAG}"
50+
echo "Install with: helm install my-release oci://${{ env.REGISTRY }}/${{ github.repository_owner }}/helm-charts/${{ env.CHART_NAME }} --version ${ACONEXT_CHART_VERSION_TAG}"
51+

charts/aconext/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
test-values.yaml

charts/aconext/.helmignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

charts/aconext/Chart.lock

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
dependencies:
2+
- name: postgresql
3+
repository: https://charts.bitnami.com/bitnami
4+
version: 18.1.13
5+
- name: redis
6+
repository: https://charts.bitnami.com/bitnami
7+
version: 24.0.0
8+
- name: rabbitmq
9+
repository: https://charts.bitnami.com/bitnami
10+
version: 16.0.14
11+
digest: sha256:a6dacb3ae4b421677920042468a45a83db2632a5dc4e2ff8fce26738c28ace94
12+
generated: "2025-12-02T21:17:35.634297+02:00"

charts/aconext/Chart.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
apiVersion: v2
2+
name: aconext
3+
description: A Helm chart for Acontext deployment on Kubernetes
4+
5+
type: application
6+
7+
version: 0.0.1
8+
appVersion: "0.0.1"
9+
10+
dependencies:
11+
- name: postgresql
12+
repository: https://charts.bitnami.com/bitnami
13+
version: 18.1.13
14+
condition: postgresql.enabled
15+
- name: redis
16+
repository: https://charts.bitnami.com/bitnami
17+
version: 24.0.0
18+
condition: redis.enabled
19+
- name: rabbitmq
20+
repository: https://charts.bitnami.com/bitnami
21+
version: 16.0.14
22+
condition: rabbitmq.enabled
87.1 KB
Binary file not shown.
72.2 KB
Binary file not shown.
114 KB
Binary file not shown.

charts/aconext/templates/NOTES.txt

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
1. Get the application URL by running these commands:
2+
{{- if contains "NodePort" .Values.api.service.type }}
3+
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "aconext.api.name" . }})
4+
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
5+
echo "API URL: http://$NODE_IP:$NODE_PORT"
6+
{{- else if contains "LoadBalancer" .Values.api.service.type }}
7+
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
8+
You can watch its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "aconext.api.name" . }}'
9+
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "aconext.api.name" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
10+
echo "API URL: http://$SERVICE_IP:{{ .Values.api.service.port }}"
11+
{{- else if contains "ClusterIP" .Values.api.service.type }}
12+
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "aconext.name" . }}-api,app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
13+
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
14+
echo "Visit http://127.0.0.1:8080 to use your application"
15+
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
16+
{{- end }}
17+
18+
2. Check service status:
19+
kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/instance={{ .Release.Name }}"
20+
kubectl get svc --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/instance={{ .Release.Name }}"
21+
22+
3. View logs:
23+
kubectl logs --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "aconext.name" . }}-api" --tail=100
24+
kubectl logs --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "aconext.name" . }}-core" --tail=100
25+
26+
4. Service endpoints:
27+
{{- if .Values.core.enabled }}
28+
Core Service: {{ include "aconext.core.name" . }}:{{ .Values.core.service.port }}
29+
{{- end }}
30+
{{- if .Values.api.enabled }}
31+
API Service: {{ include "aconext.api.name" . }}:{{ .Values.api.service.port }}
32+
{{- end }}
33+
34+
5. Dependencies status:
35+
{{- if .Values.postgresql.enabled }}
36+
PostgreSQL: Enabled (internal)
37+
{{- else }}
38+
PostgreSQL: External ({{ .Values.external.postgresql.host }}:{{ .Values.external.postgresql.port }})
39+
{{- end }}
40+
{{- if .Values.redis.enabled }}
41+
Redis: Enabled (internal)
42+
{{- else }}
43+
Redis: External ({{ .Values.external.redis.host }}:{{ .Values.external.redis.port }})
44+
{{- end }}
45+
{{- if .Values.rabbitmq.enabled }}
46+
RabbitMQ: Enabled (internal)
47+
{{- else }}
48+
RabbitMQ: External ({{ .Values.external.rabbitmq.host }}:{{ .Values.external.rabbitmq.port }})
49+
{{- end }}
50+
51+
{{- if and .Values.httpRoute.enabled .Values.httpRoute.gateway.name }}
52+
{{- if .Values.httpRoute.hostnames }}
53+
6. API Health Check:
54+
{{- range .Values.httpRoute.hostnames }}
55+
Health Check: http://{{ . }}/health
56+
{{- end }}
57+
{{- else }}
58+
6. API Health Check:
59+
Health Check: http://<GATEWAY_IP>/health
60+
(Note: Configure httpRoute.hostnames to get the full URL)
61+
{{- end }}
62+
{{- end }}

0 commit comments

Comments
 (0)