Skip to content

Instantly share code, notes, and snippets.

@burakince
Forked from nezed/ingress.yaml
Last active March 16, 2022 13:20
Show Gist options
  • Save burakince/b9e759d52ccf9bf6ec7d6eccd644c9fd to your computer and use it in GitHub Desktop.
Save burakince/b9e759d52ccf9bf6ec7d6eccd644c9fd 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 | toString)) | 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