From 7c469e88effc82380fda2d3867479d726ce574f1 Mon Sep 17 00:00:00 2001 From: Calcagiara Date: Wed, 18 Dec 2024 15:26:06 +0100 Subject: [PATCH] refactor(oauth2-proxy): removed oauth2-proxy from the platform --- .../templates/oauth2-proxy/configmap.yaml | 24 ---------- .../templates/oauth2-proxy/deployment.yaml | 46 ------------------- .../templates/oauth2-proxy/ingress.yaml | 39 ---------------- .../templates/oauth2-proxy/service.yaml | 18 -------- 4 files changed, 127 deletions(-) delete mode 100644 charts/digitalhub/templates/oauth2-proxy/configmap.yaml delete mode 100644 charts/digitalhub/templates/oauth2-proxy/deployment.yaml delete mode 100644 charts/digitalhub/templates/oauth2-proxy/ingress.yaml delete mode 100644 charts/digitalhub/templates/oauth2-proxy/service.yaml diff --git a/charts/digitalhub/templates/oauth2-proxy/configmap.yaml b/charts/digitalhub/templates/oauth2-proxy/configmap.yaml deleted file mode 100644 index f71e1ac3..00000000 --- a/charts/digitalhub/templates/oauth2-proxy/configmap.yaml +++ /dev/null @@ -1,24 +0,0 @@ -{{- if (index .Values "oauth2-proxy" "enabled") }} -{{- range $key, $value := (index .Values "oauth2-proxy" "apps") }} -apiVersion: v1 -kind: ConfigMap -metadata: - name: oauth2-proxy-{{ $value.name }} - # annotations: - # "helm.sh/hook": pre-install - # "helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation,hook-failed - # "helm.sh/hook-weight": "1" -data: - OAUTH2_PROXY_HTTP_ADDRESS: 0.0.0.0:4180 - OAUTH2_PROXY_EMAIL_DOMAINS: "*" - OAUTH2_PROXY_COOKIE_SECURE: "true" - OAUTH2_PROXY_COOKIE_SECRET: {{ randAlphaNum 32 | quote }} - OAUTH2_PROXY_UPSTREAMS: "http://{{ $value.service.name }}:{{ $value.service.port }}" - OAUTH2_PROXY_REDIRECT_URL: {{ $value.redirectUrl }} - OAUTH2_PROXY_OIDC_ISSUER_URL: {{ $value.oidcIssuerUrl }} - OAUTH2_PROXY_PROVIDER: oidc - OAUTH2_PROXY_SKIP_PROVIDER_BUTTON: "true" - OAUTH2_PROXY_REVERSE_PROXY: "true" ---- -{{- end }} -{{- end }} diff --git a/charts/digitalhub/templates/oauth2-proxy/deployment.yaml b/charts/digitalhub/templates/oauth2-proxy/deployment.yaml deleted file mode 100644 index 422d50dd..00000000 --- a/charts/digitalhub/templates/oauth2-proxy/deployment.yaml +++ /dev/null @@ -1,46 +0,0 @@ -{{- if (index .Values "oauth2-proxy" "enabled") }} -{{- range $key, $value := (index .Values "oauth2-proxy" "apps") }} -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app: oauth-proxy-{{ $value.name }} - name: oauth-proxy-{{ $value.name }} -spec: - replicas: 1 - selector: - matchLabels: - app: oauth-proxy-{{ $value.name }} - template: - metadata: - annotations: - checksum/config: {{ include (print $.Template.BasePath "/oauth2-proxy/configmap.yaml") $ | sha256sum }} - labels: - app: oauth-proxy-{{ $value.name }} - spec: - containers: - - name: oauth-proxy - image: "quay.io/oauth2-proxy/oauth2-proxy:latest" - ports: - - containerPort: 4180 - envFrom: - - configMapRef: - name: oauth2-proxy-{{ $value.name }} - env: - - name: OAUTH2_PROXY_CLIENT_ID - valueFrom: - secretKeyRef: - name: {{ $value.existingSecret.name }} - key: {{ $value.existingSecret.clientId }} - - name: OAUTH2_PROXY_CLIENT_SECRET - valueFrom: - secretKeyRef: - name: {{ $value.existingSecret.name }} - key: {{ $value.existingSecret.secretKey }} - {{- if $value.resources }} - resources: - {{- toYaml $value.resources | nindent 12 }} - {{- end }} ---- -{{- end }} -{{- end }} diff --git a/charts/digitalhub/templates/oauth2-proxy/ingress.yaml b/charts/digitalhub/templates/oauth2-proxy/ingress.yaml deleted file mode 100644 index 736a6556..00000000 --- a/charts/digitalhub/templates/oauth2-proxy/ingress.yaml +++ /dev/null @@ -1,39 +0,0 @@ -{{- if (index .Values "oauth2-proxy" "enabled") }} -{{- range $key, $value := (index .Values "oauth2-proxy" "apps") }} -{{- if $value.ingress.enabled }} -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: oauth-proxy-{{ $value.name }} - labels: - app: oauth-proxy-{{ $value.name }} - annotations: - {{- toYaml $value.ingress.annotations | nindent 4 }} -spec: - {{- if $value.ingress.ingressClassName }} - {{/* If this is set to an empty string it fails validation on K8s */}} - ingressClassName: {{ $value.ingress.ingressClassName | quote }} - {{- end }} - rules: - {{- if $value.ingress.hosts }} - {{- range $value.ingress.hosts }} - - host: {{ tpl . $ | quote }} - http: - paths: - - path: {{ $value.ingress.path }} - pathType: Prefix - backend: - service: - name: oauth-proxy-{{ $value.name }} - port: - number: 4180 - {{- end }} - {{- end }} - {{- with $value.ingress.tls }} - tls: - {{- tpl (toYaml .) $ | nindent 4 }} - {{- end }} -{{- end }} ---- -{{- end }} -{{- end }} \ No newline at end of file diff --git a/charts/digitalhub/templates/oauth2-proxy/service.yaml b/charts/digitalhub/templates/oauth2-proxy/service.yaml deleted file mode 100644 index 66d2e9ce..00000000 --- a/charts/digitalhub/templates/oauth2-proxy/service.yaml +++ /dev/null @@ -1,18 +0,0 @@ -{{- if (index .Values "oauth2-proxy" "enabled") }} -{{- range $key, $value := (index .Values "oauth2-proxy" "apps") }} -apiVersion: v1 -kind: Service -metadata: - labels: - app: oauth-proxy-{{ $value.name }} - name: oauth-proxy-{{ $value.name }} -spec: - type: ClusterIP - selector: - app: oauth-proxy-{{ $value.name }} - ports: - - name: http-oauthproxy - port: 4180 ---- -{{- end }} -{{- end }} \ No newline at end of file