Adding an explanation how to use htpasswd
for k8s secret
This commit is contained in:
parent
db28ee1ff7
commit
8d467ddd61
1 changed files with 5 additions and 1 deletions
|
@ -90,7 +90,7 @@ The `users` option is an array of authorized users. Each user will be declared u
|
||||||
# Declaring the user list
|
# Declaring the user list
|
||||||
#
|
#
|
||||||
# Note: all dollar signs in the hash need to be doubled for escaping.
|
# Note: all dollar signs in the hash need to be doubled for escaping.
|
||||||
# To create user:password pair, it's possible to use this command:
|
# To create a user:password pair, the following command can be used:
|
||||||
# echo $(htpasswd -nb user password) | sed -e s/\\$/\\$\\$/g
|
# echo $(htpasswd -nb user password) | sed -e s/\\$/\\$\\$/g
|
||||||
labels:
|
labels:
|
||||||
- "traefik.http.middlewares.test-auth.basicauth.users=test:$$apr1$$H6uskkkW$$IgXLP6ewTrSuBkTrqE8wj/,test2:$$apr1$$d9hr9HBB$$4HxwgUir3HP4EsggP/QNo0"
|
- "traefik.http.middlewares.test-auth.basicauth.users=test:$$apr1$$H6uskkkW$$IgXLP6ewTrSuBkTrqE8wj/,test2:$$apr1$$d9hr9HBB$$4HxwgUir3HP4EsggP/QNo0"
|
||||||
|
@ -107,6 +107,10 @@ spec:
|
||||||
secret: authsecret
|
secret: authsecret
|
||||||
|
|
||||||
---
|
---
|
||||||
|
# Note: in a kubernetes secret the string (e.g. generated by htpasswd) must be base64-encoded first.
|
||||||
|
# To create an encoded user:password pair, the following command can be used:
|
||||||
|
# htpasswd -nb user password | openssl base64
|
||||||
|
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
metadata:
|
metadata:
|
||||||
|
|
Loading…
Reference in a new issue