EFKLK日志收集工具栈
作者:互联网
kubectl create namespace kube-log
# 下载es镜像
docker pull elasticsearch:7.13.1
# 运行容器生成证书
$ docker run --name elastic-certs -i elasticsearch:7.13.1 /bin/sh -c \
"elasticsearch-certutil ca --out /tmp/elastic-stack-ca.p12 --pass '' && \
elasticsearch-certutil cert --name security-master --dns \
security-master --ca /tmp/elastic-stack-ca.p12 --pass '' --ca-pass '' \
--out /tmp/elastic-certificates.p12"
# 从容器中将生成的证书拷贝出来
$ docker cp elastic-certs:/tmp/elastic-certificates.p12 .
# 删除容器
$ docker rm -f elastic-certs
# 将 pcks12 中的信息分离出来,写入文件
$ openssl pkcs12 -nodes -passin pass:'' -in elastic-certificates.p12 -out elastic-certificate.pem
# 添加证书
$ kubectl create secret -n kube-log generic elastic-certs --from-file=elastic-certificates.p12
# 设置集群用户名密码
$ kubectl create secret -n kube-log generic elastic-auth --from-literal=username=elastic --from-literal=password=elastic123
helm repo add elastic https://helm.elastic.co
helm repo update
helm pull elastic/elasticsearch --untar --version 7.13.1
cd elasticsearch/
标签:收集,elastic,--,ca,p12,elasticsearch,helm,EFKLK,日志 来源: https://www.cnblogs.com/mycloudedu/p/14881838.html