Skip to content

Instantly share code, notes, and snippets.

@nezed
Created April 23, 2020 17:58
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nezed/c57eb6fad209df0508821f322b19e9b0 to your computer and use it in GitHub Desktop.
Save nezed/c57eb6fad209df0508821f322b19e9b0 to your computer and use it in GitHub Desktop.
Helm basic auth with Kubernetes Ingress
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
nginx.ingress.kubernetes.io/auth-type: basic
nginx.ingress.kubernetes.io/auth-secret: my-basic-auth
nginx.ingress.kubernetes.io/auth-realm: "Authentication Required - ok"
name: my-ingress
spec:
rules:
- host: my-host
http:
paths:
- path: /
backend:
serviceName: my-service
servicePort: http
apiVersion: v1
data:
{{/* htpasswd is available since helm@3.2.0 */}}
auth: {{ (htpasswd .Values.http_auth.user .Values.http_auth.password) | b64enc | quote }}
kind: Secret
metadata:
name: my-basic-auth
type: Opaque
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment