terraform-provider-digitalocean icon indicating copy to clipboard operation
terraform-provider-digitalocean copied to clipboard

digitalocean_container_registry does not support kubernetes integration

Open Troush opened this issue 3 years ago • 1 comments

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

image

Troush avatar Jul 26 '21 11:07 Troush

Thanks for describing this; I'd been digging through the docs thinking I was missing something.

CalRobert avatar Jun 08 '22 08:06 CalRobert

I'd love this option as well!

jordibeen avatar Dec 31 '22 11:12 jordibeen

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.

jordibeen avatar Dec 31 '22 11:12 jordibeen

This would indeed be very useful

svenhuster avatar Feb 01 '23 13:02 svenhuster

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

mohsenSy avatar Mar 19 '23 18:03 mohsenSy

Closed via https://github.com/digitalocean/terraform-provider-digitalocean/pull/963 thanks to @mohsenSy!

andrewsomething avatar Apr 17 '23 15:04 andrewsomething