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

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

Closed
kingsleyck opened this issue Jun 9, 2023 · 1 comment
Assignees

Comments

@kingsleyck
Copy link

Nutanix Cluster Information

Terraform Version

Terraform 1.3.7
on windows_amd64

  • provider registry.terraform.io/nutanix/nutanix v1.9.0

Affected Resource(s)

resource "nutanix_karbon_private_registry"

Terraform Configuration Files

resource "nutanix_karbon_private_registry" "privateregistry" {
  name = "myreg"
  url = "my.private.url"
  username = "username"
  password = "<insert>"
}

Expected Behavior

Given the inputs above are valid, the private registry should be created.

Actual Behavior

Error: Missing required argument
....
The argument "port" is required, but no definition was found.

Steps to Reproduce

  1. terraform apply

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 abhimutant self-assigned this Jun 14, 2023
@abhimutant
Copy link
Collaborator

PR: #607

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants