A utility to tag AWS EBS volumes based on the PVC's aws-ebs-tagger/tags
annotation
The k8s-aws-ebs-tagger
watches for new PersistentVolumeClaims and when new AWS EBS volumes are created it adds tags based on the PVC's aws-ebs-tagger/tags
annotation to the created EBS volume.
--default-tags
- A json encoded key/value map of the tags to set by default on EBS Volumes. Values can be overwritten by the aws-ebs-tagger/tags
annotation.
aws-ebs-tagger/ignore
- When this annotation is set (any value) it will ignore this PVC and not add any tags to it
aws-ebs-tagger/tags
- A json encoded key/value map of the tags to set on the EBS Volume (in addition to the --default-tags
). It can also be used to override the values set in the --default-tags
-
The cmdline arg
--default-tags={"me": "touge"}
and no annotation will set the tagme=touge
-
The cmdline arg
--default-tags={"me": "touge"}
and the annotationaws-ebs-tagger/tags: | {"me": "someone else", "another tag": "some value"}
will create the tagsme=someone else
andanother tag=some value
on the EBS Volume -
The cmdline arg
--default-tags={"me": "touge"}
and the annotationaws-ebs-tagger/ignore: ""
will not set any tags on the EBS Volume -
The cmdline arg
--default-tags={"me": "touge"}
and the annotationaws-ebs-tagger/tags: | {"cost-center": "abc", "environment": "prod"}
will create the tagsme=touge
,cost-center=abc
andenvironment=prod
on the EBS Volume
The following tags are ignored
kubernetes.io/*
KubernetesCluster
Name
You need to create an AWS IAM Role that can be used by k8s-aws-ebs-tagger
. I recommend using a tool like kube2iam instead of using an AWS access key/secret. An example policy is in examples/iam-role.json.
helm repo add mtougeron https://mtougeron.github.io/helm-charts/
helm repo update
helm install k8s-aws-ebs-tagger mtougeron/k8s-aws-ebs-tagger
Images are available on the GitHub Container Registry and DockerHub. Containers are published for linux/amd64
& linux/arm64
.
It is currently only possible (#9) to watch all namespaces or a single namespace. This will be addressed in a future version of the app.
This project is licensed under the Apache V2 License. See LICENSE for more information.