zabbix-community / helm-zabbix

Helm chart for Zabbix
https://artifacthub.io/packages/helm/zabbix-community/zabbix
Apache License 2.0
77 stars 45 forks source link

[Question] Kube Token #89

Open gogo199432 opened 1 month ago

gogo199432 commented 1 month ago

Quick question. I'm trying to use the Kubernetes Cluster State template and on every tutorial website, and also in the template itself it asks for a {$KUBE.API.TOKEN} which I'm supposed to retry from a secret. However this helm does not deploy a secret with a token in it. I see that the service account is assigned to the pod, but it is not obvious how I can assign the token of this account in the Zabbix UI to my macro.

aeciopires commented 1 month ago

Hello @gogo199432

I believe this issue is related to the issue https://github.com/zabbix-community/helm-zabbix/issues/49.

Unfortunately I don't have the knowledge to implement this, but if you do, I would really like to see a Pull Request about this and incorporate it into the helm chart.

jbee43 commented 1 month ago

@gogo199432 try this

apiVersion: v1
kind: Secret
metadata:
  name: some-name
  namespace: zabbix-namespace
  annotations:
    kubernetes.io/service-account.name: zabbix-service-account-name
type: kubernetes.io/service-account-token

kubectl apply -f this.yml

Check name kubectl get serviceaccount -A or kubectl get serviceaccount -n zabbix-namespace

Retrieve JWT kubectl get secret some-name -n zabbix-namespace -o jsonpath={.data.token} | base64 -d