terraform-provider-digitalocean
terraform-provider-digitalocean copied to clipboard
digitalocean_container_registry does not support kubernetes integration
Is your feature request related to a problem? Please describe.
Now you can integrate Registry with kubernetes, but this option is not provided by terraform provider. Only from cloud UI
Describe the solution you'd like
I would like to be able to set registry secrets integration with the kubernetes. By setting cluster name or all
to enable this integration inside the definition of digitalocean_container_registry
resource
Describe alternatives you've considered
Option described in this resource https://registry.terraform.io/providers/digitalocean/digitalocean/latest/docs/resources/container_registry_docker_credentials is limited in away that you can set docker secrets for specific kubernetes namespace. Not cluster wide
Additional context
Thanks for describing this; I'd been digging through the docs thinking I was missing something.
I'd love this option as well!
A workaround for this, is to patch the ImagePullSecrets for the default ServiceAccount to use the kubernetes.io/dockerconfigjson
secret, which can be created inside of your cluster by following the docs.
The default ServiceAccount is responsible for pulling the image, so when patching the ImagePullSecrets like so:
kubectl patch serviceaccount default -p '{"imagePullSecrets": [{"name": "docker-cfg"}]}'
your cluster will be able to pull from your DigitalOcean Docker Registry.
This would indeed be very useful
I think this must be added to the digitalocean_kubernetes_cluster
resource, according to here, this is done using the kubernetes API endpoint. I'll try to send a patch for this
Closed via https://github.com/digitalocean/terraform-provider-digitalocean/pull/963 thanks to @mohsenSy!