Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Remove app.kubernetes.io/managed-by label #591

Merged
merged 2 commits into from
Jun 17, 2022
Merged

Conversation

bryantbiggs
Copy link
Contributor

What does this PR do?

  • Removes the app.kubernetes.io/managed-by label from Terraform created resources

Motivation

More

  • Yes, I have tested the PR using my local account setup (Provide any test evidence report under Additional Notes)
  • Yes, I have added a new example under examples to support my PR
  • Yes, I have created another PR for add-ons under add-ons repo (if applicable)
  • Yes, I have updated the docs for this feature
  • Yes, I ran pre-commit run -a with this PR

Note: Not all the PRs required examples and docs except a new pattern or add-on added.

For Moderators

  • E2E Test successfully complete before merge?

Additional Notes

@bryantbiggs bryantbiggs temporarily deployed to EKS Blueprints Test June 1, 2022 19:57 Inactive
Copy link
Contributor

@vara-bonthu vara-bonthu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

app.kubernetes.io/managed-by is a recommended label used by Helm Chart so we can avoid using this with Terraform replace this with terraform.io/module. This will help both situations where customers either using Terraform or migrating to ArgoCD once deployed with Terraform.

@@ -5,8 +5,7 @@ resource "kubernetes_namespace" "spark" {
}

labels = {
job-type = "spark"
"app.kubernetes.io/managed-by" = "terraform-aws-eks-blueprints"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can keep this label and also add additional label

app.kubernetes.io/created-by = terraform-aws-eks-blueprints

@@ -2,10 +2,6 @@ resource "kubernetes_namespace_v1" "irsa" {
count = var.create_kubernetes_namespace && var.kubernetes_namespace != "kube-system" ? 1 : 0
metadata {
name = var.kubernetes_namespace

labels = {
"app.kubernetes.io/managed-by" = "terraform-aws-eks-blueprints"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be renamed the key with app.kubernetes.io/created-by. We can ignore managed-by here as ArgoCD may takeover the management once we enable ArgoCD.

The same applies to all the Helm Charts add-ons and IRSA K8s resources

@vara-bonthu vara-bonthu temporarily deployed to EKS Blueprints Test June 3, 2022 11:31 Inactive
labels = merge(
{
"app.kubernetes.io/managed-by" = "Terraform"
"terraform.io/module" = "terraform-aws-eks-blueprints"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Let's keep this label app.kubernetes.io/managed-by for aws-auth as its only managed by Terraformabut replace the value with terraform-aws-eks-blueprints
  • We also need to add another label here app.kubernetes.io/created-by = terraform-aws-eks-blueprints

This will ensure who created and who is currently managing the resource. managed-by can be taken over by other sources like Helm when ArgoCD is enabled.

Copy link
Contributor

@Zvikan Zvikan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming there's no request and need by customers to have label such as "created-by" of eks-blueprints, I agree that we can remove it.

Later on, we can have a "labels" variable that can be passed instead of hard-coding this.
LGTM

@bryantbiggs bryantbiggs merged commit 1012915 into main Jun 17, 2022
@bryantbiggs bryantbiggs deleted the fix/managed-by-tags branch June 17, 2022 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants