From d800579673fd2c0d6f59181ffd52f8700dc09171 Mon Sep 17 00:00:00 2001 From: Swordsteel Date: Sun, 27 Jul 2025 12:33:20 +0200 Subject: [PATCH] helm hlaeja device registry - update actuator.http - update helmfile.yaml - add 04-service.yaml - add 03-deployment.yaml - add 02-configmap.yaml - add 01-secret.yaml - update 01 secret values.yaml with jwt - add values.yaml - add Chart.yaml --- helm/charts/01-secrets/values.yaml | 10 +++++ helm/charts/04-device-registry/Chart.yaml | 4 ++ .../templates/01-secret.yaml | 11 +++++ .../templates/02-configmap.yaml | 13 ++++++ .../templates/03-deployment.yaml | 42 +++++++++++++++++++ .../templates/04-service.yaml | 19 +++++++++ helm/charts/04-device-registry/values.yaml | 19 +++++++++ helm/helmfile.yaml | 6 +++ http/device-registry/actuator.http | 3 ++ 9 files changed, 127 insertions(+) create mode 100644 helm/charts/04-device-registry/Chart.yaml create mode 100644 helm/charts/04-device-registry/templates/01-secret.yaml create mode 100644 helm/charts/04-device-registry/templates/02-configmap.yaml create mode 100644 helm/charts/04-device-registry/templates/03-deployment.yaml create mode 100644 helm/charts/04-device-registry/templates/04-service.yaml create mode 100644 helm/charts/04-device-registry/values.yaml diff --git a/helm/charts/01-secrets/values.yaml b/helm/charts/01-secrets/values.yaml index e972fe3..1cf22cd 100644 --- a/helm/charts/01-secrets/values.yaml +++ b/helm/charts/01-secrets/values.yaml @@ -20,6 +20,16 @@ secrets: # tier: frontend # jwtFilename: private_key.pem # jwtFile: AccountJwtPublicKeyFileBase64== +# - name: device-jwt-private-key +# app: device-register +# tier: backend +# jwtFilename: private_key.pem +# jwtFile: DeviceJwtPrivateKeyFileBase64== +# - name: device-jwt-public-key +# app: device-register +# tier: frontend +# jwtFilename: private_key.pem +# jwtFile: DeviceJwtPublicKeyFileBase64== # Look at /doc/keystore.md to make these values keystore: diff --git a/helm/charts/04-device-registry/Chart.yaml b/helm/charts/04-device-registry/Chart.yaml new file mode 100644 index 0000000..6d51984 --- /dev/null +++ b/helm/charts/04-device-registry/Chart.yaml @@ -0,0 +1,4 @@ +apiVersion: v2 +name: hlaeja-device-register +description: A Helm chart for the hlaeja device registry +version: 0.1.0 diff --git a/helm/charts/04-device-registry/templates/01-secret.yaml b/helm/charts/04-device-registry/templates/01-secret.yaml new file mode 100644 index 0000000..525d766 --- /dev/null +++ b/helm/charts/04-device-registry/templates/01-secret.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Secret +metadata: + name: device-register-environment + labels: + app: device-register + environment: {{ .Values.environment }} + tier: backend +type: Opaque +data: + SPRING_R2DBC_PASSWORD: {{ .Values.secrets.r2dbcPassword | b64enc | quote }} diff --git a/helm/charts/04-device-registry/templates/02-configmap.yaml b/helm/charts/04-device-registry/templates/02-configmap.yaml new file mode 100644 index 0000000..74a6820 --- /dev/null +++ b/helm/charts/04-device-registry/templates/02-configmap.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: device-register-environment + labels: + app: device-register + environment: {{ .Values.environment }} + tier: backend +data: + SPRING_PROFILES_ACTIVE: {{ .Values.config.profiles | quote }} + SPRING_R2DBC_URL: {{ .Values.config.r2dbcUrl | quote }} + SPRING_R2DBC_USERNAME: {{ .Values.config.r2dbcUsername | quote }} + JWT_PRIVATE_KEY: "cert/{{ .Values.jwtPrivetKey.filename }}" diff --git a/helm/charts/04-device-registry/templates/03-deployment.yaml b/helm/charts/04-device-registry/templates/03-deployment.yaml new file mode 100644 index 0000000..75077db --- /dev/null +++ b/helm/charts/04-device-registry/templates/03-deployment.yaml @@ -0,0 +1,42 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: device-register + labels: + app: device-register + environment: {{ .Values.environment }} + tier: backend +spec: + replicas: {{ .Values.replicas }} + selector: + matchLabels: + app: device-register + template: + metadata: + labels: + app: device-register + spec: + imagePullSecrets: + - name: {{ .Values.docker.registry }} + containers: + - name: device-register-app + image: {{ .Values.docker.image }} + imagePullPolicy: IfNotPresent + envFrom: + - configMapRef: + name: device-register-environment + - secretRef: + name: device-register-environment + volumeMounts: + - name: jwt-key-volume + mountPath: /app/resources/cert + readOnly: true + ports: + - containerPort: 8080 + volumes: + - name: jwt-key-volume + secret: + secretName: {{ .Values.jwtPrivetKey.name }} + items: + - key: {{ .Values.jwtPrivetKey.filename }} + path: {{ .Values.jwtPrivetKey.filename }} diff --git a/helm/charts/04-device-registry/templates/04-service.yaml b/helm/charts/04-device-registry/templates/04-service.yaml new file mode 100644 index 0000000..eb052c7 --- /dev/null +++ b/helm/charts/04-device-registry/templates/04-service.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: Service +metadata: + name: device-register + labels: + app: device-register + environment: {{ .Values.environment }} + tier: backend +spec: + {{- if and .Values.loadBalancerIP (ne .Values.loadBalancerIP "") }} + type: LoadBalancer + loadBalancerIP: {{ .Values.loadBalancerIP }} + {{- end }} + selector: + app: device-register + ports: + - protocol: TCP + port: 80 + targetPort: 8080 diff --git a/helm/charts/04-device-registry/values.yaml b/helm/charts/04-device-registry/values.yaml new file mode 100644 index 0000000..6ca6c10 --- /dev/null +++ b/helm/charts/04-device-registry/values.yaml @@ -0,0 +1,19 @@ +environment: testing +replicas: 1 +#loadBalancerIP: 10.0.3.22 + +docker: + registry: dockerRegistry + image: lulz.ltd/hlaeja/hlaeja-device-registry:0.1.0 + +secrets: + r2dbcPassword: "password" + +config: + profiles: testing + r2dbcUrl: r2dbc:postgresql://database-postgresql:5432/device_registry + r2dbcUsername: services + +jwtPrivetKey: + name: device-jwt-private-key + filename: private_key.pem diff --git a/helm/helmfile.yaml b/helm/helmfile.yaml index 545abb7..0301284 100644 --- a/helm/helmfile.yaml +++ b/helm/helmfile.yaml @@ -16,3 +16,9 @@ releases: chart: ./charts/03-account-registry values: [] historyMax: 3 + + - name: device-registry + namespace: hlaeja-testing + chart: ./charts/04-device-registry + values: [] + historyMax: 3 diff --git a/http/device-registry/actuator.http b/http/device-registry/actuator.http index 4d03087..de4867d 100644 --- a/http/device-registry/actuator.http +++ b/http/device-registry/actuator.http @@ -1,2 +1,5 @@ ### get actuator GET {{hostname}}/actuator + +### get actuator health +GET {{hostname}}/actuator/health