Code Monkey home page Code Monkey logo

k8s-aws-ebs-tagger's Introduction

k8s-aws-ebs-tagger

A utility to tag AWS EBS volumes based on the PVC's aws-ebs-tagger/tags annotation

Go Gosec ContainerScan GitHub tag

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.

How to set tags

cmdline args

--default-tags - A json or csv 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.

--tag-format - Either json or csv for the format the aws-ebs-tagger/tags and --default-tags are in.

Annotations

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

Examples

  1. The cmdline arg --default-tags={"me": "touge"} and no annotation will set the tag me=touge

  2. The cmdline arg --default-tags={"me": "touge"} and the annotation aws-ebs-tagger/tags: | {"me": "someone else", "another tag": "some value"} will create the tags me=someone else and another tag=some value on the EBS Volume

  3. The cmdline arg --default-tags={"me": "touge"} and the annotation aws-ebs-tagger/ignore: "" will not set any tags on the EBS Volume

  4. The cmdline arg --default-tags={"me": "touge"} and the annotation aws-ebs-tagger/tags: | {"cost-center": "abc", "environment": "prod"} will create the tags me=touge, cost-center=abc and environment=prod on the EBS Volume

ignored tags

The following tags are ignored

  • kubernetes.io/*
  • KubernetesCluster
  • Name

Installation

AWS IAM Role

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.

Install via helm

helm repo add mtougeron https://mtougeron.github.io/helm-charts/
helm repo update
helm install k8s-aws-ebs-tagger mtougeron/k8s-aws-ebs-tagger

Container Image

Images are available on the GitHub Container Registry and DockerHub. Containers are published for linux/amd64 & linux/arm64.

Licensing

This project is licensed under the Apache V2 License. See LICENSE for more information.

k8s-aws-ebs-tagger's People

Contributors

dol3y avatar khartahk avatar mtougeron avatar yurrriq avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.