From c60e702e6d46553c596577fb22c0f99b2635bd3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Elnan?= Date: Sun, 12 Jan 2025 18:15:39 +0100 Subject: [PATCH] fix helms --- charts/ror-webapp/templates/configmap.yaml | 34 +-------- charts/ror-webapp/templates/deployment.yaml | 2 +- .../templates/ingress-helsenett.yaml | 76 +++++-------------- charts/ror-webapp/values.yaml | 9 ++- 4 files changed, 29 insertions(+), 92 deletions(-) diff --git a/charts/ror-webapp/templates/configmap.yaml b/charts/ror-webapp/templates/configmap.yaml index c81b787..ff40121 100644 --- a/charts/ror-webapp/templates/configmap.yaml +++ b/charts/ror-webapp/templates/configmap.yaml @@ -1,13 +1,13 @@ apiVersion: v1 kind: ConfigMap metadata: - name: ror-web-cm-config + name: {{ include "ror-webapp.fullname" . }}-cm-config data: config.json: | { "auth": { "issuer": "{{ .Values.web.authUrl }}", - "clientId": "ror.sky.test.nhn.no", + "clientId": "{{ .Values.web.authClientId}}", "redirectUri": "/auth/callback", "scope": "profile email groups", "response_type": "id_token token", @@ -26,33 +26,3 @@ data: "timeout": 30000 } } - ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: ror-web-cm-config2 -data: - config.json: | - { - "auth": { - "issuer": "{{ .Values.web.authUrl }}", - "clientId": "ror.nhn.no", - "redirectUri": "/auth/callback", - "scope": "profile email groups", - "response_type": "id_token token", - "requireHttps": true, - "strictDiscoveryDocumentValidation": true - }, - "regex": { - "forms": "^[@()\\/:?\\r\\n.,a-zA-Z æøåÆØÅ0-9_-]+$" - }, - "rowsPerPage": [10, 25, 50, 75, 100], - "rows": 25, - "rorApi": "{{ .Values.web.apiUrl2 }}", - "sse": { - "postfixUrl": "/v1/events/listen", - "method": "GET", - "timeout": 30000 - } - } diff --git a/charts/ror-webapp/templates/deployment.yaml b/charts/ror-webapp/templates/deployment.yaml index 4a2b005..898a834 100644 --- a/charts/ror-webapp/templates/deployment.yaml +++ b/charts/ror-webapp/templates/deployment.yaml @@ -69,6 +69,6 @@ spec: volumes: - name: json-configmap-volume configMap: - name: ror-web-cm-config2 + name: {{ include "ror-webapp.fullname" . }}-cm-config - name: tmp-volume emptyDir: {} diff --git a/charts/ror-webapp/templates/ingress-helsenett.yaml b/charts/ror-webapp/templates/ingress-helsenett.yaml index 2076756..61ffaa1 100644 --- a/charts/ror-webapp/templates/ingress-helsenett.yaml +++ b/charts/ror-webapp/templates/ingress-helsenett.yaml @@ -3,62 +3,28 @@ kind: Ingress metadata: annotations: cert-manager.io/cluster-issuer: letsencrypt-prod - name: {{ include "ror-webapp.fullname" . }}helm-ingress + name: {{ include "ror-webapp.fullname" . }}-ingress spec: ingressClassName: avi-ingress-class-helsenett rules: - - host: {{ .Values.web.host }} - http: - paths: - - backend: - service: - name: {{ include "ror-webapp.fullname" . }} - port: - number: {{ .Values.service.port }} - path: {{ .Values.ingress.path }} - pathType: {{ .Values.ingress.pathType }} - - host: {{ .Values.web.host2 }} - http: - paths: - - backend: - service: - name: {{ include "ror-webapp.fullname" . }} - port: - number: {{ .Values.service.port }} - path: {{ .Values.ingress.path }} - pathType: {{ .Values.ingress.pathType }} + {{- $outer := . -}} + {{- range $idx, $host := .Values.web.hosts }} + {{- with $outer }} + - host: {{ $host }} + http: + paths: + - backend: + service: + name: {{ include "ror-webapp.fullname" . }} + port: + number: {{ .Values.service.port }} + path: {{ .Values.ingress.path }} + pathType: {{ .Values.ingress.pathType }} + {{- end }} + {{- end }} tls: - - hosts: - - {{ .Values.web.host }} - secretName: nhn-ror-webapp-tls - - hosts: - - {{ .Values.web.host2 }} - secretName: nhn-ror-webapp-tls - ---- -apiVersion: ako.vmware.com/v1alpha1 -kind: HostRule -metadata: - name: admin-allow-dcn-paw - namespace: {{ .Release.namespace}} -spec: - virtualhost: - datascripts: - - expose-nhn-office-isp - - expose-nhn-office-client - - expose-nhn-office-devops - - expose-nsg-amk-paws - - expose-nhn-dc-any - - expose-nsg-cloud-paws - - expose-nsg-container-paws - - expose-nsg-soc-paws - - expose-nsg-mon-paws - - expose-nhn-office-devops - - expose-nsg-esm-paws - - bottom-deny-rule - fqdn: ror.sky.test.nhn.no - analyticsProfile: NHN-System-Analytics-Profile - analyticsPolicy: - fullClientLogs: - enabled: false - throttle: DISABLED + - hosts: + {{- range $idx, $host := .Values.web.hosts }} + - {{ $host }} + {{- end }} + secretName: {{ include "ror-webapp.fullname" . }}-tls diff --git a/charts/ror-webapp/values.yaml b/charts/ror-webapp/values.yaml index a16c371..9526397 100644 --- a/charts/ror-webapp/values.yaml +++ b/charts/ror-webapp/values.yaml @@ -3,11 +3,12 @@ # Declare variables to be passed into your templates. enabled: true web: - host: ror.sky.test.nhn.no - host2: ror.nhn.no - apiUrl: https://api.ror.sky.test.nhn.no - apiUrl2: https://api.ror.nhn.no + hosts: + - ror.sky.test.nhn.no + - ror.nhn.no + apiUrl: https://api.ror.nhn.no authUrl: https://auth.sky.nhn.no/dex + authClientId: ror.nhn.no replicaCount: 3 image: repository: ghcr.io/norskhelsenett/ror-webapp