thanos-io / kube-thanos

Kubernetes specific configuration for deploying Thanos.
Apache License 2.0
520 stars 177 forks source link

Add annotation support for serviceaccount #271

Closed dreampuf closed 2 years ago

dreampuf commented 2 years ago

Changes

In EKS, It's necessary to have an IAM role to associate with a service account. (details in link). I added the ability to customize it.

Verification

You can test it via a common config:

local commonConfig = {
  local cfg = self,
  ...
  serviceAccountAnnotations: {
    "eks.amazonaws.com/role-arn": "arn:aws:iam::AWS_ACCOUNT_ID:role/IAM_ROLE_NAME",
  },
}

The generated config would be like:

./manifests//thanos-bucket-serviceAccount.yaml:kind: ServiceAccount
./manifests//thanos-bucket-serviceAccount.yaml-metadata:
./manifests//thanos-bucket-serviceAccount.yaml-  annotations:
./manifests//thanos-bucket-serviceAccount.yaml-    arn:aws:iam::AWS_ACCOUNT_ID:role/IAM_ROLE_NAME
dreampuf commented 2 years ago

@kakkoyun Re-generated doc and example code.