[CI SKIP] Use ingress v1 for nginx-ingress basic auth demo

This commit is contained in:
niusmallnan 2023-04-10 17:18:15 +08:00
parent ea49f9d3b4
commit 10e5323c95
2 changed files with 8 additions and 6 deletions

View File

@ -13,9 +13,9 @@ htpasswd -nb username password | base64
To install this mode, just run this script:
```
kubectl apply -f ./secret.yaml
kubectl create -f ./secret.yaml
export MY_IP=$(curl -sL ipinfo.io/ip)
envsubst < ./ingress.yaml.tpl | kubectl apply -f -
envsubst < ./ingress.yaml.tpl | kubectl create -f -
```
For more infos: https://kubernetes.github.io/ingress-nginx/examples/auth/basic/

View File

@ -2,7 +2,7 @@
# To use sslip.io: https://sslip.io/
# To get your public IP: curl ipinfo.io/ip
apiVersion: networking.k8s.io/v1beta1
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: kube-explorer
@ -10,7 +10,6 @@ metadata:
labels:
app: kube-explorer
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/auth-type: basic
nginx.ingress.kubernetes.io/auth-secret: kube-explorer
nginx.ingress.kubernetes.io/auth-realm: 'Authentication Required - kube-explorer'
@ -20,6 +19,9 @@ spec:
http:
paths:
- path: /
pathType: Prefix
backend:
serviceName: kube-explorer
servicePort: 8989
service:
name: kube-explorer
port:
number: 8989