Following are the steps to create In-cluster registry and to execute build, push and pull operations in registry-pod
- Login to IBM Cloud and cluster via CLI
- Clone this REPO in local machine
- Run
kubectl apply -f registry-pod.yaml
to create registry pod and service - Run
kubectl get ep | grep ^re
and copy the ENDPOINTURL - Run following command to debug your node
kubectl debug node/<NODEIP> -it --image=ubuntu:latest
- Export REGISTRYPATH by
export REGISTRYPATH="<ENDPOINTURL>"
- Make directory with name of registry url
mkdir host/etc/containerd/certs.d/${REGISTRYPATH} && cd host/etc/containerd/certs.d/${REGISTRYPATH}
- Create
hosts.toml
and add regsitry URL by executing the following command
cat >hosts.toml<<EOL
server = "http://${REGISTRYPATH}"
[host."http://${REGISTRYPATH}"]
skip_verify = true
EOL
- Exit from node debugger by cmd
exit
- In builder-pod.yaml file update your ENDPOINT URL in this line
- Run
kubectl apply -f builder-pod.yaml
- This will build the dockerfile and push to the registry
- In peer-pod.yaml file update your ENDPOINT URL in this line
- Run
kubectl apply -f peer-pod.yaml
- This will create a pod with image from in-cluster registry