我们需要为elasticsearch创建基本(用户名/密码)身份验证,并在我们的kubernetes集群中运行kibana oss(Apache许可证)。我们在AWS(EKS)中安装了多云,……
好吧,如果你正在使用 nginx ingress controller 你可以像这样添加基本身份验证:
nginx ingress controller
apiVersion: extensions/v1beta1 kind: Ingress metadata: name: kibana namespace: kibana annotations: kubernetes.io/ingress.class: "nginx" # type of authentication nginx.ingress.kubernetes.io/auth-type: basic # name of the secret that contains the user/password definitions nginx.ingress.kubernetes.io/auth-secret: my-secret-basic-auth # message to display with an appropriate context why the authentication is required nginx.ingress.kubernetes.io/auth-realm: 'Authentication Required - kibana-admin' ... ...
该 my-secret-basic-auth 必须创建 htpasswd :
my-secret-basic-auth
htpasswd
$ htpasswd -c auth foo New password: <bar> New password: Re-type new password: Adding password for user foo
然后你需要创建秘密:
$ kubectl create secret generic my-secret-basic-auth --from-file=auth secret "my-secret-basic-auth" created
这很简单,易于维护,但你会坚持 nginx ingress controller 永远。