@zhangyy
2021-09-06T19:32:28.000000Z
字数 1377
阅读 160
kubernetes系列
系统: CentOS7.9x64
k8s 的版本: k8s 1.18.20
# helm3 下载地址
https://github.com/helm/helm/releases
# 下载后解压获取二进制文件即可使用
tar -zxvf helm-v3.4.2-linux-amd64.tar.gz
cd linux-amd64/
mv helm /usr/bin/
chmod +x /usr/bin/helm
helm version
helm repo add aliyuncs https://apphub.aliyuncs.com
helm repo list
建一个namespaces:
kubectl create ns monitoring
helm install prometheus aliyuncs/prometheus-operator \
--set prometheus.service.type=NodePort \
--set prometheus.service.nodePort=30090 \
--namespace monitoring
kubectl get pod -n monitoring
kubectl get svc -n monitoring
打开web
http://192.168.100.11:30090
kubectl get pod -n monitoring
kubeclt get deploy -n monitoring
kubectl edit deploy prometheus-grafana -n monitoring
---
grafana的镜像调整为最新版本:
image: grafana/grafana:6.5.2
改为 image: grafana/grafana
---
会从新初始化grafana 的pod
关于grafana svc 的端口暴露
kubectl get svc -n monitoring
kubectl edit svc prometheus-grafana -n monitoring
kubectl edit svc prometheus-grafana -n monitoring
type: ClusterIP 改为:
type: NodePort
kubectl get svc -n monitoring
这个地方的用户名密码:
kubectl get secret -n monitoring
kubectl edit secret prometheus-grafana -n monitoring
---
admin-password: cHJvbS1vcGVyYXRvcg==
admin-user: YWRtaW4=
---
base64 位的转码:
echo -n YWRtaW4= | base64 --decode
echo -n cHJvbS1vcGVyYXRvcg== | base64 --decode
用户名:admin
密码: prom-operator