Skip to content

Commit

Permalink
[vrt] remove auth proxy (#191)
Browse files Browse the repository at this point in the history
* remoe auth proxy

Signed-off-by: André Bauer <[email protected]>

* version

Signed-off-by: André Bauer <[email protected]>

* url

Signed-off-by: André Bauer <[email protected]>

* fix

Signed-off-by: André Bauer <[email protected]>

* ingress

Signed-off-by: André Bauer <[email protected]>

* fix secret

Signed-off-by: André Bauer <[email protected]>

---------

Signed-off-by: André Bauer <[email protected]>
  • Loading branch information
monotek authored Jul 4, 2024
1 parent 194fbe8 commit 2123564
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 320 deletions.
2 changes: 1 addition & 1 deletion charts/visual-regression-tracker/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sources:
- https://github.com/Visual-Regression-Tracker/Visual-Regression-Tracker
- https://github.com/kokuwaio/helm-charts/tree/main/charts/visual-regression-tracker
type: application
version: 4.2.0
version: 5.0.0
appVersion: "5.0.4"
maintainers:
- name: monotek
Expand Down
6 changes: 6 additions & 0 deletions charts/visual-regression-tracker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ helm upgrade vrt kokuwa/visual-regression-tracker

_See [`helm upgrade`](https://helm.sh/docs/helm/helm_upgrade/) for command documentation._

### From 4.0.x to 5.0.0

Auth proxy was removed as it does nto work as expected.

The `reactAppApi.protocol` & `reactAppApi.url` have been removed and `reactAppApiUrl` is used again.

### From 3.0.x to 4.0.0

This version adds a proxy in fornt of the API server which protects it via basic auth. The configuration can be done via `authProxy.basicAuth.username`, `authProxy.basicAuth.password`. The password can also be populated by predefined secret via `secrets.authProxy`.
Expand Down
2 changes: 1 addition & 1 deletion charts/visual-regression-tracker/files/env-config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
window._env_ = {
REACT_APP_API_URL: "{{ .Values.vrtConfig.reactAppApi.protocol }}://{{ .Values.authProxy.basicAuth.username }}:{{ .Values.authProxy.basicAuth.password }}@{{ .Values.vrtConfig.reactAppApi.url }}",
REACT_APP_API_URL: "{{ .Values.vrtConfig.reactAppApiUrl }}",
PORT: "{{ .Values.vrtComponents.ui.service.port }}",
VRT_VERSION: "{{ .Chart.AppVersion }}",
}
11 changes: 0 additions & 11 deletions charts/visual-regression-tracker/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,6 @@ vrt secret name
{{- end -}}
{{- end -}}

{{/*
vrt auth proxy secret name
*/}}
{{- define "visual-regression-tracker.authProxySecretName" -}}
{{- if .Values.secrets.authProxy.useExisting -}}
{{ .Values.secrets.authProxy.secretName }}
{{- else -}}
{{ template "visual-regression-tracker.fullname" . }}-{{ .Values.secrets.authProxy.secretName }}
{{- end -}}
{{- end -}}

{{/*
vrt env secret name
*/}}
Expand Down

This file was deleted.

110 changes: 0 additions & 110 deletions charts/visual-regression-tracker/templates/auth-proxy-deployment.yaml

This file was deleted.

14 changes: 0 additions & 14 deletions charts/visual-regression-tracker/templates/auth-proxy-pdb.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions charts/visual-regression-tracker/templates/auth-proxy-secret.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions charts/visual-regression-tracker/templates/auth-proxy-service.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{{- if .Values.authProxy.ingress.enabled -}}
{{- if .Values.vrtComponents.api.ingress.enabled -}}
{{- $fullName := include "visual-regression-tracker.fullname" . -}}
{{- $svcPort := .Values.authProxy.service.port -}}
{{- if and .Values.authProxy.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.authProxy.ingress.annotations "kubernetes.io/ingress.class") }}
{{- $_ := set .Values.authProxy.ingress.annotations "kubernetes.io/ingress.class" .Values.authProxy.ingress.className}}
{{- $svcPort := .Values.vrtComponents.api.service.port -}}
{{- if and .Values.vrtComponents.api.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.vrtComponents.api.ingress.annotations "kubernetes.io/ingress.class") }}
{{- $_ := set .Values.vrtComponents.api.ingress.annotations "kubernetes.io/ingress.class" .Values.vrtComponents.api.ingress.className}}
{{- end }}
{{- end }}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
Expand All @@ -15,20 +15,20 @@ apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: "{{ $fullName }}-auth"
name: "{{ $fullName }}-ui"
labels:
{{- include "visual-regression-tracker.labels" . | nindent 4 }}
{{- with .Values.authProxy.ingress.annotations }}
{{- with .Values.vrtComponents.api.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and .Values.authProxy.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
ingressClassName: {{ .Values.authProxy.ingress.className }}
{{- if and .Values.vrtComponents.api.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
ingressClassName: {{ .Values.vrtComponents.api.ingress.className }}
{{- end }}
{{- if .Values.authProxy.ingress.tls }}
{{- if .Values.vrtComponents.api.ingress.tls }}
tls:
{{- range .Values.authProxy.ingress.tls }}
{{- range .Values.vrtComponents.api.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
Expand All @@ -37,7 +37,7 @@ spec:
{{- end }}
{{- end }}
rules:
{{- range .Values.authProxy.ingress.hosts }}
{{- range .Values.vrtComponents.api.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
Expand Down
2 changes: 1 addition & 1 deletion charts/visual-regression-tracker/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type: Opaque
data:
{{ .Values.secrets.defaults.secretKey }}: {{ tpl (.Files.Get "files/seed.ts") $ | b64enc }}
{{ end }}
{{ if and (or .Values.authProxy.basicAuth.username .Values.authProxy.basicAuth.password) (not .Values.secrets.envConfig.useExisting) }}
{{ if not .Values.secrets.envConfig.useExisting }}
---
apiVersion: v1
kind: Secret
Expand Down
7 changes: 1 addition & 6 deletions charts/visual-regression-tracker/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,8 @@ spec:
mountPath: /imageUploads
- name: {{ .Chart.Name }}-ui
env:
- name: BASIC_AUTH_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "visual-regression-tracker.authProxySecretName" . }}
key: {{ .Values.secrets.authProxy.secretKey }}
- name: REACT_APP_API_URL
value: "{{ .Values.vrtConfig.reactAppApi.protocol }}://{{ .Values.authProxy.basicAuth.username }}:$(BASIC_AUTH_PASSWORD)@{{ .Values.vrtConfig.reactAppApi.url }}"
value: "{{ .Values.vrtConfig.reactAppApiUrl }}"
- name: VRT_VERSION
value: "{{ .Chart.AppVersion }}"
image: "{{ .Values.vrtComponents.ui.image.repository }}:{{ .Values.vrtComponents.ui.image.tag }}"
Expand Down
Loading

0 comments on commit 2123564

Please sign in to comment.