Skip to content
This repository was archived by the owner on Aug 19, 2022. It is now read-only.
/ kube-tagger Public archive
forked from sergiorua/kube-tagger

Watches for PVC and tags the EBS volume according to annotations

License

Notifications You must be signed in to change notification settings

gdisdevops/kube-tagger

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kubernetes Volume Tagger

Forked from https://github.com/sergiorua/kube-tagger!

What?

It's a simple pod that checks if AWS EBS volumes created by K8s have the AWS tags required.

How?

On your volume claims add the tags into annotations like:

annotations:
  volume.beta.kubernetes.io/additional-resource-tags: Owner=Sergio,Environment=Dev

Multiple tags are , separated by default but you can override it with:

annotations:
  volume.beta.kubernetes.io/additional-resource-tags-separator: ";"

You may need to grant your EC2 instances permissions to tag volumes. This is the minimal config expected:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "ec2:DescribeVolumes",
      "Resource": "*"
     },
     {
       "Effect": "Allow",
       "Action": [
         "ec2:CreateTags"
       ],
       "Resource": "arn:aws:ec2:*:*:volume/*",
       "Condition": {
         "StringEquals": {
             "ec2:CreateAction" : "CreateTags"
        }
      }
    }
  ]
}

Deploy

See kube-tagger.yaml for an example deployment.

kubectl apply -f https://raw.githubusercontent.com/sergiorua/kube-tagger/master/kube-tagger.yaml

About

Watches for PVC and tags the EBS volume according to annotations

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 93.7%
  • Dockerfile 4.2%
  • Shell 2.1%