From 0368a2c6fa7f7fd431cb8da5fa04d19f49f7b7fb Mon Sep 17 00:00:00 2001 From: Swordsteel Date: Mon, 28 Jul 2025 11:08:20 +0200 Subject: [PATCH] helm hlaeja management - add actuator.http - add http-client.env.json-dev - update helmfile.yaml - add 04-service.yaml - add 03-deployment.yaml - add 02-configmap.yaml - add 01-secret.yaml - add values.yaml - add Chart.yaml --- helm/charts/09-management/Chart.yaml | 4 ++ .../09-management/templates/01-secret.yaml | 11 +++++ .../09-management/templates/02-configmap.yaml | 14 ++++++ .../templates/03-deployment.yaml | 43 +++++++++++++++++++ .../09-management/templates/03-service.yaml | 19 ++++++++ helm/charts/09-management/values.yaml | 22 ++++++++++ helm/helmfile.yaml | 6 +++ http/management/actuator.http | 5 +++ http/management/http-client.env.json-dev | 11 +++++ 9 files changed, 135 insertions(+) create mode 100644 helm/charts/09-management/Chart.yaml create mode 100644 helm/charts/09-management/templates/01-secret.yaml create mode 100644 helm/charts/09-management/templates/02-configmap.yaml create mode 100644 helm/charts/09-management/templates/03-deployment.yaml create mode 100644 helm/charts/09-management/templates/03-service.yaml create mode 100644 helm/charts/09-management/values.yaml create mode 100644 http/management/actuator.http create mode 100644 http/management/http-client.env.json-dev diff --git a/helm/charts/09-management/Chart.yaml b/helm/charts/09-management/Chart.yaml new file mode 100644 index 0000000..0e31ddc --- /dev/null +++ b/helm/charts/09-management/Chart.yaml @@ -0,0 +1,4 @@ +apiVersion: v2 +name: hlaeja-management +description: A Helm chart for the hlaeja management +version: 0.1.0 diff --git a/helm/charts/09-management/templates/01-secret.yaml b/helm/charts/09-management/templates/01-secret.yaml new file mode 100644 index 0000000..ce34d57 --- /dev/null +++ b/helm/charts/09-management/templates/01-secret.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Secret +metadata: + name: management-environment + labels: + app: management + environment: {{ .Values.environment }} + tier: frontend +type: Opaque +data: + SPRING_DATA_REDIS_PASSWORD: {{ .Values.secrets.redisPassword | b64enc | quote }} diff --git a/helm/charts/09-management/templates/02-configmap.yaml b/helm/charts/09-management/templates/02-configmap.yaml new file mode 100644 index 0000000..9da194e --- /dev/null +++ b/helm/charts/09-management/templates/02-configmap.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: management-environment + labels: + app: management + environment: {{ .Values.environment }} + tier: frontend +data: + SPRING_PROFILES_ACTIVE: {{ .Values.config.profiles | quote }} + SPRING_DATA_REDIS_DATABASE: {{ .Values.config.redis.database | quote }} + SPRING_DATA_REDIS_HOST: {{ .Values.config.redis.host | quote }} + ACCOUNT_REGISTRY_URL: {{ .Values.config.accountRegistryUrl | quote }} + DEVICE_REGISTRY_URL: {{ .Values.config.deviceRegistryUrl | quote }} diff --git a/helm/charts/09-management/templates/03-deployment.yaml b/helm/charts/09-management/templates/03-deployment.yaml new file mode 100644 index 0000000..cf3563a --- /dev/null +++ b/helm/charts/09-management/templates/03-deployment.yaml @@ -0,0 +1,43 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: management + labels: + app: management + environment: {{ .Values.environment }} + tier: frontend +spec: + replicas: {{ .Values.replicas }} + selector: + matchLabels: + app: management + template: + metadata: + labels: + app: management + spec: + imagePullSecrets: + - name: {{ .Values.docker.registry }} + containers: + - name: management-app + image: {{ .Values.docker.image }} + imagePullPolicy: IfNotPresent + envFrom: + - configMapRef: + name: management-environment + - secretRef: + name: management-environment + ports: + - containerPort: 8080 + volumeMounts: + - name: jwt-volume + mountPath: /app/resources/cert/{{ .Values.jwtPublicKey.filename }} + subPath: {{ .Values.jwtPublicKey.filename }} + readOnly: true + volumes: + - name: jwt-volume + secret: + secretName: {{ .Values.jwtPublicKey.name }} + items: + - key: {{ .Values.jwtPublicKey.filename }} + path: {{ .Values.jwtPublicKey.filename }} diff --git a/helm/charts/09-management/templates/03-service.yaml b/helm/charts/09-management/templates/03-service.yaml new file mode 100644 index 0000000..bf89fcc --- /dev/null +++ b/helm/charts/09-management/templates/03-service.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: Service +metadata: + name: management + labels: + app: management + environment: {{ .Values.environment }} + tier: frontend +spec: + {{- if and .Values.loadBalancerIP (ne .Values.loadBalancerIP "") }} + type: LoadBalancer + loadBalancerIP: {{ .Values.loadBalancerIP }} + {{- end }} + selector: + app: management + ports: + - protocol: TCP + port: 80 + targetPort: 8080 diff --git a/helm/charts/09-management/values.yaml b/helm/charts/09-management/values.yaml new file mode 100644 index 0000000..a2cdb46 --- /dev/null +++ b/helm/charts/09-management/values.yaml @@ -0,0 +1,22 @@ +environment: testing +replicas: 1 +#loadBalancerIP: 10.0.3.11 + +docker: + registry: dockerRegistry + image: lulz.ltd/hlaeja/hlaeja-management:0.1.0 + +secrets: + redisPassword: redisPassword + +config: + profiles: testing + redis: + database: 2 + host: database-redis-master + accountRegistryUrl: http://account-register + deviceRegistryUrl: http://device-register + +jwtPublicKey: + name: account-jwt-public-key + filename: public_key.pem diff --git a/helm/helmfile.yaml b/helm/helmfile.yaml index 42a7f88..6467a60 100644 --- a/helm/helmfile.yaml +++ b/helm/helmfile.yaml @@ -46,3 +46,9 @@ releases: chart: ./charts/08-registry-api values: [] historyMax: 3 + + - name: management + namespace: hlaeja-testing + chart: ./charts/09-management + values: [] + historyMax: 3 diff --git a/http/management/actuator.http b/http/management/actuator.http new file mode 100644 index 0000000..de4867d --- /dev/null +++ b/http/management/actuator.http @@ -0,0 +1,5 @@ +### get actuator +GET {{hostname}}/actuator + +### get actuator health +GET {{hostname}}/actuator/health diff --git a/http/management/http-client.env.json-dev b/http/management/http-client.env.json-dev new file mode 100644 index 0000000..438860b --- /dev/null +++ b/http/management/http-client.env.json-dev @@ -0,0 +1,11 @@ +{ + "development": { + "hostname": "http://localhost:8080" + }, + "docker": { + "hostname": "http://localhost:9060" + }, + "testing": { + "hostname": "http://10.0.x.x" + } +}