Terraform-provider-kubernetes: ClusterRole resource metadata name does not allow capital letters

Created on 20 Feb 2019  ·  6Comments  ·  Source: hashicorp/terraform-provider-kubernetes

Terraform Version

Terraform v0.11.11
+ provider.kubernetes v1.5.1

Affected Resource(s)

  • kubernetes_cluster_role

Terraform Configuration Files

resource "kubernetes_cluster_role" "logs" {
  metadata {
    name = "containerHealth-log-reader"
  }
  rule {
    api_groups = [""]
    resources  = ["pods/log"]
    verbs      = ["get"]
  }
}

Expected Behavior

The provider should create the resource. Currently I use kubectl apply to create the cluster role.

Actual Behavior

Terraform gives an error "a DNS-1123 subdomain must consist of lower case alphanumeric characters". The provider does not like metadata.0.name containing a capital H.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform plan

References

Below is the documation for Azure Monitor container live logs. It provides the exact Kubernetes RBAC authorization needed for the feature.

https://docs.microsoft.com/en-us/azure/azure-monitor/insights/container-insights-live-logs

My issue is similar to issue #214

stale

Most helpful comment

I have seen the same error with the ":" character and i have compared with kubectl apply command and no errors are thrown.
The DNS-1123 subdomain validation should not be apply to the entry schema.
It think is only needed for ServiceAccount, Namespace, and Service.

All 6 comments

I've just discovered the Cluster Role Bindings resource has the same issue.

I have seen the same error with the ":" character and i have compared with kubectl apply command and no errors are thrown.
The DNS-1123 subdomain validation should not be apply to the entry schema.
It think is only needed for ServiceAccount, Namespace, and Service.

Related: #214 and #439

This might be resolved as of 1.8.1.

EDIT: Actually, I spoke too soon - it appears to have been fixed for ClusterRole and Role, but not ClusterRoleBinding and RoleBinding.

This issue has been open 180 days with no activity. If this issue is reproducible with the latest version of the provider and with Terraform 0.12, please comment. Otherwise this issue will be closed in 30 days.

I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

Was this page helpful?
0 / 5 - 0 ratings