kubernetes_labels

This resource allows Terraform to manage the labels for a resource that already exists. This resource uses field management and server-side apply to manage only the labels that are defined in the Terraform configuration. Existing labels not specified in the configuration will be ignored. If a label specified in the config and is already managed by another client it will cause a conflict which can be overridden by setting force to true.

Example Usage

resource "kubernetes_labels" "example" {
  api_version = "v1"
  kind        = "ConfigMap"
  metadata {
    name = "my-config"
  }
  labels = {
    "owner" = "myteam"
  }
}

Argument Reference

The following arguments are supported:

Nested Blocks

metadata

Arguments

Import

This resource does not support the import command. As this resource operates on Kubernetes resources that already exist, creating the resource is equivalent to importing it.