Skip to content

Commit

Permalink
Basic authentication在k8s v1.19被移除了, 所以改用证书登录
Browse files Browse the repository at this point in the history
  • Loading branch information
heyanyanchina123 authored and gjmzj committed Aug 23, 2023
1 parent 70dd0ef commit 6dd5267
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions docs/guide/efk.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6dd5267

Please sign in to comment.