prometheus sa权限问题
来源:1-18 【性能监控Demo】rometheus时间序列监控,知其然
uareRight
2021-01-21 22:33:13
老师咱们peomethues granfana是通过helm安装到monitoring 命名空间 ,我先在想创建一个serviceAccount :mon 我如何把这个mon账户关联到我monitoring 命名空间的granfana,上一节是通过pod指定的sa,这个我应该如何指定
1回答
通常service account和应用关联的方法有以下一些:
直接在应用部署的Controller(比如Deployment、StatefulSet等)的YAML里面指定,如Dashboard:
https://github.com/kubernetes/dashboard/blob/master/aio/deploy/recommended.yaml
serviceAccountName: kubernetes-dashboard
通过Helm部署的Chart里设置,然后通过Values方式来传递,比如Prometheus的Service Account YAML:
https://github.com/helm/charts/blob/master/stable/prometheus-operator/templates/prometheus/serviceaccount.yaml
Values传参说明:https://github.com/helm/charts/tree/master/stable/prometheus-operator
prometheus.serviceAccount.name: Name for prometheus serviceaccount
对于Grafana这种应用不需要额外的访问角色所以一般不定义SA。如果需要可以下载官方Chart,手工创建对应的SA和权限绑定和Value传参等。
相似问题