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

Add template_labels support to kubernetes_labels #2310

Open
korjek opened this issue Oct 11, 2023 · 2 comments · May be fixed by #2473
Open

Add template_labels support to kubernetes_labels #2310

korjek opened this issue Oct 11, 2023 · 2 comments · May be fixed by #2473

Comments

@korjek
Copy link

korjek commented Oct 11, 2023

Description

kubernetes_labels resource doesn't allow to set labels for a template (for example, when there in an intention to set labels for pods managed by deployment or statefulset).

Potential Terraform Configuration

resource "kubernetes_labels" "coredns" {
  api_version = "apps/v1"
  kind        = "Deployment"
  metadata {
    name = "coredns"
    namespace = "kube-system"
  }
  # These labels will be applied to the Pods created by the Deployment
  template_labels = {
    "my_label" = "my_value"
  }

  force = true
}
@jrhouston
Copy link
Contributor

Thanks for opening this @korjek. This request makes sense, and we already do this in the kubernetes_annotations resource. The code for these resources are functionally almost identical so it would be easy just to take the code that does this for annotations and do it for labels.

@theloneexplorerquest
Copy link

I would like to work on this 😄

@theloneexplorerquest theloneexplorerquest linked a pull request Apr 20, 2024 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants