-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(patches): add compatibility patch for hubble ingress basic auth
Add compatibility patch for Hubble Ingress when using basic auth as auth provider on KFD versions 1.27.9, 1.28.4, and 1.29.4. Reference: sighupio/fury-distribution#277
- Loading branch information
Showing
3 changed files
with
198 additions
and
0 deletions.
There are no files selected for viewing
66 changes: 66 additions & 0 deletions
66
configs/patches/v1.27.9/templates/distribution/manifests/auth/secrets/basic-auth.yml.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Copyright (c) 2017-present SIGHUP s.r.l All rights reserved. | ||
# Use of this source code is governed by a BSD-style | ||
# license that can be found in the LICENSE file. | ||
|
||
{{- if eq .spec.distribution.modules.auth.provider.type "basicAuth" -}} | ||
{{- $username := .spec.distribution.modules.auth.provider.basicAuth.username -}} | ||
{{- $password := .spec.distribution.modules.auth.provider.basicAuth.password -}} | ||
|
||
{{- if eq .spec.distribution.modules.policy.type "gatekeeper" }} | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: basic-auth | ||
namespace: gatekeeper-system | ||
type: Opaque | ||
stringData: | ||
auth: {{ htpasswd $username $password }} | ||
{{- end }} | ||
{{- if ne .spec.distribution.modules.ingress.nginx.type "none" }} | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: basic-auth | ||
namespace: ingress-nginx | ||
type: Opaque | ||
stringData: | ||
auth: {{ htpasswd $username $password }} | ||
{{- end }} | ||
{{- if ne .spec.distribution.modules.logging.type "none" }} | ||
{{- if .checks.storageClassAvailable }} | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: basic-auth | ||
namespace: logging | ||
type: Opaque | ||
stringData: | ||
auth: {{ htpasswd $username $password }} | ||
{{- end }} | ||
{{- end }} | ||
{{- if ne .spec.distribution.modules.monitoring.type "none" }} | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: basic-auth | ||
namespace: monitoring | ||
type: Opaque | ||
stringData: | ||
auth: {{ htpasswd $username $password }} | ||
{{- end }} | ||
{{ if eq .spec.distribution.modules.networking.type "cilium" }} | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: basic-auth | ||
namespace: kube-system | ||
type: Opaque | ||
stringData: | ||
auth: {{ htpasswd $username $password }} | ||
{{- end }} | ||
{{- end -}} |
66 changes: 66 additions & 0 deletions
66
configs/patches/v1.28.4/templates/distribution/manifests/auth/secrets/basic-auth.yml.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Copyright (c) 2017-present SIGHUP s.r.l All rights reserved. | ||
# Use of this source code is governed by a BSD-style | ||
# license that can be found in the LICENSE file. | ||
|
||
{{- if eq .spec.distribution.modules.auth.provider.type "basicAuth" -}} | ||
{{- $username := .spec.distribution.modules.auth.provider.basicAuth.username -}} | ||
{{- $password := .spec.distribution.modules.auth.provider.basicAuth.password -}} | ||
|
||
{{- if eq .spec.distribution.modules.policy.type "gatekeeper" }} | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: basic-auth | ||
namespace: gatekeeper-system | ||
type: Opaque | ||
stringData: | ||
auth: {{ htpasswd $username $password }} | ||
{{- end }} | ||
{{- if ne .spec.distribution.modules.ingress.nginx.type "none" }} | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: basic-auth | ||
namespace: ingress-nginx | ||
type: Opaque | ||
stringData: | ||
auth: {{ htpasswd $username $password }} | ||
{{- end }} | ||
{{- if ne .spec.distribution.modules.logging.type "none" }} | ||
{{- if .checks.storageClassAvailable }} | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: basic-auth | ||
namespace: logging | ||
type: Opaque | ||
stringData: | ||
auth: {{ htpasswd $username $password }} | ||
{{- end }} | ||
{{- end }} | ||
{{- if ne .spec.distribution.modules.monitoring.type "none" }} | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: basic-auth | ||
namespace: monitoring | ||
type: Opaque | ||
stringData: | ||
auth: {{ htpasswd $username $password }} | ||
{{- end }} | ||
{{ if eq .spec.distribution.modules.networking.type "cilium" }} | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: basic-auth | ||
namespace: kube-system | ||
type: Opaque | ||
stringData: | ||
auth: {{ htpasswd $username $password }} | ||
{{- end }} | ||
{{- end -}} |
66 changes: 66 additions & 0 deletions
66
configs/patches/v1.29.4/templates/distribution/manifests/auth/secrets/basic-auth.yml.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Copyright (c) 2017-present SIGHUP s.r.l All rights reserved. | ||
# Use of this source code is governed by a BSD-style | ||
# license that can be found in the LICENSE file. | ||
|
||
{{- if eq .spec.distribution.modules.auth.provider.type "basicAuth" -}} | ||
{{- $username := .spec.distribution.modules.auth.provider.basicAuth.username -}} | ||
{{- $password := .spec.distribution.modules.auth.provider.basicAuth.password -}} | ||
|
||
{{- if eq .spec.distribution.modules.policy.type "gatekeeper" }} | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: basic-auth | ||
namespace: gatekeeper-system | ||
type: Opaque | ||
stringData: | ||
auth: {{ htpasswd $username $password }} | ||
{{- end }} | ||
{{- if ne .spec.distribution.modules.ingress.nginx.type "none" }} | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: basic-auth | ||
namespace: ingress-nginx | ||
type: Opaque | ||
stringData: | ||
auth: {{ htpasswd $username $password }} | ||
{{- end }} | ||
{{- if ne .spec.distribution.modules.logging.type "none" }} | ||
{{- if .checks.storageClassAvailable }} | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: basic-auth | ||
namespace: logging | ||
type: Opaque | ||
stringData: | ||
auth: {{ htpasswd $username $password }} | ||
{{- end }} | ||
{{- end }} | ||
{{- if ne .spec.distribution.modules.monitoring.type "none" }} | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: basic-auth | ||
namespace: monitoring | ||
type: Opaque | ||
stringData: | ||
auth: {{ htpasswd $username $password }} | ||
{{- end }} | ||
{{ if eq .spec.distribution.modules.networking.type "cilium" }} | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: basic-auth | ||
namespace: kube-system | ||
type: Opaque | ||
stringData: | ||
auth: {{ htpasswd $username $password }} | ||
{{- end }} | ||
{{- end -}} |