Skip to content

Commit 5c63be2

Browse files
committed
feat: complete charts
1 parent 37cff87 commit 5c63be2

7 files changed

Lines changed: 181 additions & 14 deletions

File tree

.github/workflows/release-chart.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: Release Charts
22
on:
3-
push:
4-
paths:
5-
- charts/**
3+
workflow_dispatch:
64
jobs:
75
release:
86
permissions:

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ The folder also contains both a github and gitlab actions file that shows an exa
88

99
NOTE: This has not been created yet
1010

11-
NOTE 2: Ingress is currently not set up yet, so any ingress configuration isn't happening just yet
11+
## Ingress
12+
This helm chart does not automatically take care of any ingress configuration.
13+
If you are using ingress (or Gateway), you need to manually update these configs, or update this helm chart and host it yourself.

charts/backend/templates/Deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ spec:
4444
value: {{ .Values.config.db.username }}
4545
- name: SPRING_DATASOURCE_PASSWORD
4646
value: {{ .Values.config.db.password }}
47+
- name: ALLOWED_CORS_ORIGINS
48+
value: {{ .Values.config.cors }}
49+
- name: JWT_SECRET_KEY
50+
value: {{ .Values.config.secrets.jwt }}
51+
- name: DEBUG_SECRET
52+
value: {{ .Values.config.secrets.debug }}
4753
ports:
4854
- containerPort: {{ .Values.app.port }}
4955
restartPolicy: {{ .Values.app.restartPolicy }}

charts/backend/values.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
config:
22
namespace: eyetap
33
clusterName: cluster
4+
cors: ''
5+
secrets:
6+
jwt: ''
7+
debug: ''
48
db:
5-
url: "eyetap-postgres:5432/{{ .Values.config.db.db }}"
6-
# url: "eyetap-postgres.{{ .Values.config.namespace }}.svc.{{ .Values.config.clusterName }}.local:5432/{{ .Values.config.db.db }}"
9+
url: "eyetap-pg.{{ .Values.config.namespace }}.svc.{{ .Values.config.clusterName }}.local:5432/{{ .Values.config.db.db }}"
710
username: eyetap
811
db: eyetap
912
password: eyetap
@@ -16,7 +19,3 @@ app:
1619

1720
name: eyetap-backend
1821
port: 8080
19-
20-
ingress:
21-
enabled: true
22-
url: null

charts/frontend/values.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ app:
1010
name: eyetap-frontend
1111
port: 8080
1212

13-
ingress:
14-
enabled: true
15-
url: null
16-
1713
resources:
1814
requests:
1915
cpu: null

templates/github-actions.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Create or update deployment
2+
on:
3+
workflow_dispatch:
4+
5+
env:
6+
BASE_URL: eyetap.yourdomain.tld
7+
8+
# Helm Timeout
9+
HELM_TIMEOUT: 5m0s
10+
11+
# Kube configuartion
12+
K8S_NAMESPACE: eyetap
13+
K8S_CONTEXT: eyetap
14+
K8S_CLUSTER_NAME: eyetap
15+
16+
# The helm chart to use
17+
HELM_CHART: oci://eye-tap.github.io/helm-chart/charts
18+
19+
20+
jobs:
21+
deploy:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Check out Git repository
25+
uses: actions/checkout@v6
26+
with:
27+
ref: ${{ github.ref }}
28+
- name: Deploy Postgres
29+
run: |
30+
helm upgrade
31+
eyetap-pg
32+
${HELM_CHART}/postgres
33+
--namespace $K8S_NAMESPACE
34+
--kube-context $K8S_CONTEXT
35+
--install
36+
--atomic
37+
-f "./postgres/values.yaml"
38+
--timeout "${HELM_TIMEOUT}"
39+
--set config.db="${POSTGRES_DB}"
40+
--set config.username="${POSTGRES_USER}"
41+
--set config.password="${POSTGRES_PASSWORD}"
42+
- name: Deploy Frontend
43+
run: |
44+
helm upgrade
45+
eyetap-frontend
46+
${HELM_CHART}/frontend
47+
--version ${HELM_CHART_VERSION}
48+
--namespace $K8S_NAMESPACE
49+
--kube-context $K8S_CONTEXT
50+
--install
51+
--atomic
52+
-f "./frontend/values.yaml"
53+
--timeout "${HELM_TIMEOUT}"
54+
- name: Publish to GitHub Container Registry
55+
run: |
56+
helm upgrade
57+
eyetap-backend
58+
${HELM_CHART}/backend
59+
--namespace $K8S_NAMESPACE
60+
--kube-context $K8S_CONTEXT
61+
--install
62+
--atomic
63+
-f "./backend/values.yaml"
64+
--timeout "${HELM_TIMEOUT}"
65+
--set config.db.url="${RELEASE_NAME}-pg.${K8S_NAMESPACE}.svc.cluster.local:5432/${POSTGRES_DB}"
66+
--set config.cors="https://${BASE_URL}"
67+
--set config.namespace="${K8S_NAMESPACE}"
68+
--set config.clusterName="${K8S_CLUSTER_NAME}"
69+
--set config.db.username="${POSTGRES_USER}"
70+
--set config.db.db="${POSTGRES_DB}"
71+
--set config.db.password="${POSTGRES_PASSWORD}"
72+
--set config.secrets.jwt="secret" # TODO: Update this
73+
--set config.secrets.debug="secret" # TODO: Update this

templates/gitlab-ci.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# ┌ ┐
2+
# │ # CONFIGURATION │
3+
# └ ┘
4+
stages:
5+
- deploy:db
6+
- deploy:app
7+
8+
9+
variables:
10+
BASE_URL: eyetap.yourdomain.tld
11+
12+
# Helm Timeout
13+
HELM_TIMEOUT: 5m0s
14+
15+
# Kube configuartion
16+
K8S_NAMESPACE: eyetap
17+
K8S_CONTEXT: eyetap
18+
K8S_CLUSTER_NAME: eyetap
19+
20+
# The helm chart to use
21+
HELM_CHART: oci://eye-tap.github.io/helm-chart/charts
22+
23+
24+
# ─────────────────────────────────────────────────────────────────────
25+
# ┌ ┐
26+
# │ # DEPLOY │
27+
# └ ┘
28+
.deploy-template:
29+
stage: deploy
30+
image:
31+
name: alpine/helm:3.14.1
32+
entrypoint: ["bash"]
33+
34+
# Database
35+
deploy-postgres:
36+
extends: .deploy-template
37+
stage: deploy:db
38+
script:
39+
- >
40+
helm upgrade
41+
eyetap-pg
42+
${HELM_CHART}/postgres
43+
--namespace $K8S_NAMESPACE
44+
--kube-context $K8S_CONTEXT
45+
--install
46+
--atomic
47+
-f "./postgres/values.yaml"
48+
--timeout "${HELM_TIMEOUT}"
49+
--set config.db="${POSTGRES_DB}"
50+
--set config.username="${POSTGRES_USER}"
51+
--set config.password="${POSTGRES_PASSWORD}"
52+
53+
# Frontend
54+
deploy-frontend:
55+
extends: .deploy-template
56+
stage: deploy:app
57+
script:
58+
- >
59+
helm upgrade
60+
eyetap-frontend
61+
${HELM_CHART}/frontend
62+
--version ${HELM_CHART_VERSION}
63+
--namespace $K8S_NAMESPACE
64+
--kube-context $K8S_CONTEXT
65+
--install
66+
--atomic
67+
-f "./frontend/values.yaml"
68+
--timeout "${HELM_TIMEOUT}"
69+
70+
# Backend
71+
deploy-backend:
72+
extends: .deploy-template
73+
stage: deploy:app
74+
script:
75+
- >
76+
helm upgrade
77+
eyetap-backend
78+
${HELM_CHART}/backend
79+
--namespace $K8S_NAMESPACE
80+
--kube-context $K8S_CONTEXT
81+
--install
82+
--atomic
83+
-f "./backend/values.yaml"
84+
--timeout "${HELM_TIMEOUT}"
85+
--set config.db.url="${RELEASE_NAME}-pg.${K8S_NAMESPACE}.svc.cluster.local:5432/${POSTGRES_DB}"
86+
--set config.cors="https://${BASE_URL}"
87+
--set config.namespace="${K8S_NAMESPACE}"
88+
--set config.clusterName="${K8S_CLUSTER_NAME}"
89+
--set config.db.username="${POSTGRES_USER}"
90+
--set config.db.db="${POSTGRES_DB}"
91+
--set config.db.password="${POSTGRES_PASSWORD}"
92+
--set config.secrets.jwt="secret" # TODO: Update this
93+
--set config.secrets.debug="secret" # TODO: Update this

0 commit comments

Comments
 (0)