When you operate Kubernetes cluster, you will sooner or later create some additional resources like volumes or load balancers. You might need to attach some tags to these resources. This repository contains installation of AWS Lambda function which will go through all your resources, identify them based on tag KubernetesCluster
tag which should contain the name of your Kubernetes cluster. For every resource it find it will make sure that the desiredßß tags are attached.
## Prerequisites and dependencies
- The Lambda deployment is written using Terraform
- Generating of the lambda function from the template and packing it into ZIP archive expects
bash
andzip
being available. - This deployment might not work on Windows machine. Tested only on Linux and macOS
The configuration is done through Terraform variables. Example tfvars file is part of this repo and is named example.tfvars
. Change the variables to match your environment / requirements before running terraform apply ...
.
Option | Explanation | Example |
---|---|---|
aws_region |
AWS region which should be used | eu-central-1 |
cluster_name |
Name of the Kubernetes cluster (used to find the resources for tagging but also to name resources created by this configuration) | my-minikube |
tags |
Tags which should be applied to all resources | { Hello = "World" } |
To deploy the tagging lambda,
- Export AWS credentials into environment variables
AWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
- Apply Terraform configuration with tagging lambda:
terraform apply --var-file example.tfvars
To delete tagging lambda,
- Export AWS credentials into environment variables
AWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
- Destroy Terraform configuration:
terraform destroy --var-file example.tfvars
- EC2 instances
- Network interfaces
- EBS Volumes
- Security Groups
- Internet Gateways (not applicable in ProductDev)
- DHCP Option sets (not applicable in ProductDev)
- Subnets (not applicable in ProductDev)
- Route tables (not applicable in ProductDev)
- VPCs (not applicable in ProductDev)
- Network ACLs (not applicable in ProductDev)
- Autoscaling Groups
- Elastic Loadbalancers