From 2bff7331344cc06e0c341b2c320f1b8a1ab20e3b Mon Sep 17 00:00:00 2001 From: william Date: Fri, 18 Apr 2025 00:01:03 +0800 Subject: [PATCH] 1 --- base/secret/http-basic-auth.yaml | 9 +++++++++ base/secret/kustomization.yaml | 3 ++- gp2504/ingress.yaml | 3 +++ gp2504/kustomization.yaml | 1 + 4 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 base/secret/http-basic-auth.yaml diff --git a/base/secret/http-basic-auth.yaml b/base/secret/http-basic-auth.yaml new file mode 100644 index 0000000..aaf972d --- /dev/null +++ b/base/secret/http-basic-auth.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: Secret +metadata: + name: basic-auth +type: Opaque +data: + auth: dXNlcjokYXByMSRPU0JHSXpFbCRFemNTTGk1QkJWVGFBQlhMODlNaXkvCg== +# This is a base64 encoded string of the format "user:$apr1$OSBGIzEl$EzcSLi5BBVTaABXL89Miy/". +# password: FVhxOBuqXK800gdmIq \ No newline at end of file diff --git a/base/secret/kustomization.yaml b/base/secret/kustomization.yaml index f2f90e9..6eadc2b 100644 --- a/base/secret/kustomization.yaml +++ b/base/secret/kustomization.yaml @@ -1,3 +1,4 @@ resources: - juyoutech-docker-hub-secret.yaml - - juyou-docker-tcr-secret.yaml \ No newline at end of file + - juyou-docker-tcr-secret.yaml + - http-basic-auth.yaml \ No newline at end of file diff --git a/gp2504/ingress.yaml b/gp2504/ingress.yaml index e39e708..dfa77c2 100644 --- a/gp2504/ingress.yaml +++ b/gp2504/ingress.yaml @@ -13,6 +13,9 @@ metadata: nginx.ingress.kubernetes.io/auth-tls-pass-certificate-to-upstream: "true" nginx.ingress.kubernetes.io/ssl-redirect: "true" nginx.ingress.kubernetes.io/force-ssl-redirect: "true" + nginx.ingress.kubernetes.io/auth-type: "basic" + nginx.ingress.kubernetes.io/auth-secret: "http-basic-auth" + nginx.ingress.kubernetes.io/auth-realm: "Authentication Required" spec: tls: - hosts: diff --git a/gp2504/kustomization.yaml b/gp2504/kustomization.yaml index 2927613..bb51ecc 100644 --- a/gp2504/kustomization.yaml +++ b/gp2504/kustomization.yaml @@ -11,6 +11,7 @@ resources: - ../base/redis - ../base/redis-nodeport - ../base/tls + - ../base/secret - ingress.yaml configMapGenerator: