diff --git a/helm/charts/01-secrets/values.yaml b/helm/charts/01-secrets/values.yaml index f3243ff..e972fe3 100644 --- a/helm/charts/01-secrets/values.yaml +++ b/helm/charts/01-secrets/values.yaml @@ -10,11 +10,16 @@ secrets: # Look at /doc/rsa_key.md to make these values (we use rsa so and need a public and privet key) jwt: -# - name: jwt-key -# app: jwt-service +# - name: account-jwt-private-key +# app: account-register # tier: backend -# jwtFilename: jwt_key.pem -# jwtFile: JwtKeyFileBase64== +# jwtFilename: private_key.pem +# jwtFile: AccountJwtPrivateKeyFileBase64== +# - name: account-jwt-public-key +# app: account-register +# tier: frontend +# jwtFilename: private_key.pem +# jwtFile: AccountJwtPublicKeyFileBase64== # Look at /doc/keystore.md to make these values keystore: diff --git a/helm/charts/03-account-registry/Chart.yaml b/helm/charts/03-account-registry/Chart.yaml new file mode 100644 index 0000000..00f97dd --- /dev/null +++ b/helm/charts/03-account-registry/Chart.yaml @@ -0,0 +1,4 @@ +apiVersion: v2 +name: hlaeja-account-registry +description: A Helm chart for the hlaeja account registry +version: 0.1.0 diff --git a/helm/charts/03-account-registry/templates/01-secret.yaml b/helm/charts/03-account-registry/templates/01-secret.yaml new file mode 100644 index 0000000..3007477 --- /dev/null +++ b/helm/charts/03-account-registry/templates/01-secret.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Secret +metadata: + name: account-register-environment + labels: + app: account-register + environment: {{ .Values.environment }} + tier: backend +type: Opaque +data: + SPRING_R2DBC_PASSWORD: {{ .Values.secrets.r2dbcPassword | b64enc | quote }} diff --git a/helm/charts/03-account-registry/templates/02-configmap.yaml b/helm/charts/03-account-registry/templates/02-configmap.yaml new file mode 100644 index 0000000..abe8062 --- /dev/null +++ b/helm/charts/03-account-registry/templates/02-configmap.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: account-register-environment + labels: + app: account-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/03-account-registry/templates/03-deployment.yaml b/helm/charts/03-account-registry/templates/03-deployment.yaml new file mode 100644 index 0000000..6054e2b --- /dev/null +++ b/helm/charts/03-account-registry/templates/03-deployment.yaml @@ -0,0 +1,42 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: account-register + labels: + app: account-register + environment: {{ .Values.environment }} + tier: backend +spec: + replicas: {{ .Values.replicas }} + selector: + matchLabels: + app: account-register + template: + metadata: + labels: + app: account-register + spec: + imagePullSecrets: + - name: {{ .Values.docker.registry }} + containers: + - name: account-register-app + image: {{ .Values.docker.image }} + imagePullPolicy: IfNotPresent + envFrom: + - configMapRef: + name: account-register-environment + - secretRef: + name: account-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/03-account-registry/templates/04-service.yaml b/helm/charts/03-account-registry/templates/04-service.yaml new file mode 100644 index 0000000..6600f47 --- /dev/null +++ b/helm/charts/03-account-registry/templates/04-service.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: Service +metadata: + name: account-register + labels: + app: account-register + environment: {{ .Values.environment }} + tier: backend +spec: + {{- if and .Values.loadBalancerIP (ne .Values.loadBalancerIP "") }} + type: LoadBalancer + loadBalancerIP: {{ .Values.loadBalancerIP }} + {{- end }} + selector: + app: account-register + ports: + - protocol: TCP + port: 80 + targetPort: 8080 diff --git a/helm/charts/03-account-registry/values.yaml b/helm/charts/03-account-registry/values.yaml new file mode 100644 index 0000000..3321d01 --- /dev/null +++ b/helm/charts/03-account-registry/values.yaml @@ -0,0 +1,19 @@ +environment: testing +replicas: 1 +#loadBalancerIP: 10.0.3.21 + +docker: + registry: dockerRegistry + image: lulz.ltd/hlaeja/hlaeja-account-registry:0.1.0 + +secrets: + r2dbcPassword: "password" + +config: + profiles: testing + r2dbcUrl: r2dbc:postgresql://database-postgresql:5432/account_registry + r2dbcUsername: services + +jwtPrivetKey: + name: account-jwt-private-key + filename: private_key.pem diff --git a/helm/helmfile.yaml b/helm/helmfile.yaml index e1e548a..545abb7 100644 --- a/helm/helmfile.yaml +++ b/helm/helmfile.yaml @@ -10,3 +10,9 @@ releases: chart: ./charts/02-database values: [] historyMax: 3 + + - name: account-register + namespace: hlaeja-testing + chart: ./charts/03-account-registry + values: [] + historyMax: 3 diff --git a/http/account-registry/actuator.http b/http/account-registry/actuator.http index 4d03087..de4867d 100644 --- a/http/account-registry/actuator.http +++ b/http/account-registry/actuator.http @@ -1,2 +1,5 @@ ### get actuator GET {{hostname}}/actuator + +### get actuator health +GET {{hostname}}/actuator/health