kubernetes-sigs / hierarchical-namespaces

Home of the Hierarchical Namespace Controller (HNC). Adds hierarchical policies and delegated creation to Kubernetes namespaces for improved in-cluster multitenancy.
Apache License 2.0
620 stars 105 forks source link

convert manifest to tf using tfk8s #392

Open williamohara opened 1 month ago

williamohara commented 1 month ago

I like to use terraform by converting my k8 manifests to terraform using https://github.com/jrhouston/tfk8s. This is what terraform recommends here - https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/manifest#importing-existing-kubernetes-resources-as-kubernetes_manifest

I download the manifest file from https://github.com/kubernetes-sigs/hierarchical-namespaces/releases/download/v1.1.0/default.yaml then I convert it. There are some status sections that are causing an error because TF will not allow the presence of status blocks in resource definitions,

Specifically, the status blocks in the Custom Resource Definitions for hierarchicalresourcequotas.hnc.x-k8s.io hierarchyconfigurations.hnc.x-k8s.io hncconfigurations.hnc.x-k8s.io subnamespaceanchors.hnc.x-k8s.io

Is there any special reason the high-level status blocks are there (the "status" section in the properties section of the openAPIV3Schema are not causing any issue - just the ones at the top level) ?