30 lines
667 B
Markdown
30 lines
667 B
Markdown
|
**vim auth-whitelist.yaml**
|
||
|
|
||
|
```
|
||
|
apiVersion: networking.k8s.io/v1
|
||
|
kind: Ingress
|
||
|
metadata:
|
||
|
annotations:
|
||
|
nginx.ingress.kubernetes.io/auth-realm: Please Input Your Username and Password
|
||
|
nginx.ingress.kubernetes.io/auth-secret: basic-auth
|
||
|
nginx.ingress.kubernetes.io/auth-type: basic
|
||
|
nginx.ingress.kubernetes.io/whitelist-source-range: 192.168.10.128
|
||
|
name: ingress-with-auth
|
||
|
namespace: study-ingress
|
||
|
spec:
|
||
|
ingressClassName: nginx
|
||
|
rules:
|
||
|
- host: auth.test.com
|
||
|
http:
|
||
|
paths:
|
||
|
- backend:
|
||
|
service:
|
||
|
name: nginx
|
||
|
port:
|
||
|
number: 80
|
||
|
path: /
|
||
|
pathType: ImplementationSpecific
|
||
|
|
||
|
```
|
||
|
|