From 6dd5267204a8bbeeb7e3daf7754afe166d8e5474 Mon Sep 17 00:00:00 2001 From: heyanyanchina Date: Tue, 22 Aug 2023 09:13:48 +0800 Subject: [PATCH] =?UTF-8?q?Basic=20authentication=E5=9C=A8k8s=20v1.19?= =?UTF-8?q?=E8=A2=AB=E7=A7=BB=E9=99=A4=E4=BA=86=EF=BC=8C=20=E6=89=80?= =?UTF-8?q?=E4=BB=A5=E6=94=B9=E7=94=A8=E8=AF=81=E4=B9=A6=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/guide/efk.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/guide/efk.md b/docs/guide/efk.md index 20d3c44..4a24791 100644 --- a/docs/guide/efk.md +++ b/docs/guide/efk.md @@ -41,9 +41,14 @@ $ kubectl logs -n kube-system kibana-logging-d5cffd7c6-9lz2p -f ### 访问 Kibana -推荐使用`kube-apiserver`方式访问(可以使用basic-auth、证书和rbac等方式进行认证授权),获取访问 URL +推荐使用`kube-apiserver`方式访问(可以使用证书和rbac等方式进行认证授权),获取访问 URL -- 开启 apiserver basic-auth(用户名/密码认证):`ezctl basic-auth -s -u admin -p test1234` +- 使用证书登录(生成kubecfg.p12,并将证书下载到本地安装): +```bash +grep 'client-certificate-data' ~/.kube/config | head -n 1 | awk '{print $2}' | base64 -d > kubecfg.crt +grep 'client-key-data' ~/.kube/config | head -n 1 | awk '{print $2}' | base64 -d > kubecfg.key +openssl pkcs12 -export -clcerts -inkey kubecfg.key -in kubecfg.crt -out kubecfg.p12 -name "kubernetes-client" +``` ``` bash $ kubectl cluster-info | grep Kibana