nutanix / terraform-provider-nutanix

Terraform Nutanix Provider
https://www.terraform.io/docs/providers/nutanix/
Mozilla Public License 2.0
95 stars 111 forks source link

Resource "nutanix_karbon_private_registry" expects port and integer >0 while REST API does not #605

Closed kingsleyck closed 1 year ago

kingsleyck commented 1 year ago

Nutanix Cluster Information

Terraform Version

Terraform 1.3.7 on windows_amd64

Note: No registry need exist to perform this test

Important Factors

​Being able to create the private registry without a port is important for an HTTPS registry. The Docker daemon uses port 443 by default unless overridden. When the registry is added to the underlying K8s cluster(s) on NKE, the certificates for HTTPS are deployed to the worker nodes' Docker cert.d folder in the format <url>:<port>. If a port is not provided by karbonctl or API, the cert is stored in the format <url>. Adding port = 443 to the declaration allows the registry to be created, but requires kubernetes deployments to reference images by my.private.url:443/myimage instead of my.private.url/myimage or certificate validation will fail. Both the karbonctl and POST to /karbon/v1-alpha.1/registries allow creating a registry without providing a port.

References

Nutanix API for /karbon/v1-alpha.1/registries endpoint:

https://www.nutanix.dev/api_references/nke/#/c4ae13464965f-create-the-private-registry-entry-in-nke-with-the-provided-configuration-api-format-https-server-nutanix-com-9440-karbon-v1-alpha-1-registries

abhimutant commented 1 year ago

PR: #607