I'm using AWS EKS with Auto Scaler for the worker nodes. I've private Artifactory docker registry.
Now in order to download docker images from private registry, I've read many documents including kubernetes docs for - how to pull docker image from private docker registry.
There are three steps in the solution:
- Create
kubectl secret
which contains docker registry credentials - Add
"insecure-registries":["privateRegistryAddress:port"]
in/etc/docker/daemon.json
- Restart docker service
I've manually SSH into worker nodes and ran 2nd and 3rd step which works for temporary but as EKS Auto Scaler finds if that worker nodes is not in use then kill it and create new one as needed, where in this new worker node "insecure-registries":["privateRegistryAddress:port"]
in /etc/docker/daemon.json
is not added, and due to which pod scheduling fails.
There are two solutions I can think of here -
- Configure AWS EC2 AMI which contains
"insecure-registries":["privateRegistryAddress:port"]
in/etc/docker/daemon.json
default and use that image in auto scaler configuration - Create pod which has node level permission to edit the mentioned file and restart docker service - but I doubt if docker service restarted then that pod itself would go down and if that works or not
Please advise. Thanks.
["privateRegistryAddress:port"]
in/etc/docker/daemon.json
and restart docker service, which I don't want to do everytime because my worker nodes would keep changes. I'm looking for how we can automate that. – Jaydeep Soni