kubebuilder init --domain junaidk.io --repo github.com/junaidk/image-backup-controller
make manifests
make docker-build
make deploy
make undeploy
make test
https://github.com/containers/image
This library is used to copy image from source to destination.
Build the image using make docker-build IMG=<some-registry>/<project-name>:tag
Push the image to the registry using make docker-push IMG=<some-registry>/<project-name>:tag
Create secret with registry username and password.
kubectl create secret generic registry-creds \
--from-literal=username=devuser \
--from-literal=password='S!B\*d$zDsb='
Update environment variables in config/manager/manager.yaml according to your destination registry.
And update the secret name in config/manager/manager.yaml
Additional namespaces can be added to env IGNORE_NAMESPACES in config/manager/manager.yaml. These will be ignored by controller in addtion to kube-system
Deploy the controller to the cluster using make deploy IMG=<some-registry>/<project-name>:tag
- Include Init container in image update process.
- Make image copy concurrent in case of multiple images in one deployment.