New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dind: Added support for local registry to push and pull images #20048
dind: Added support for local registry to push and pull images #20048
Conversation
It looks good so far |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve |
- This will be useful for dev testing router, egress router features. - This will also help if we plan to switch dind to use newer openshift deployment(kubelet with openshift flags, sdn/ovs/config daemonsets)
b63ffa8
to
bb42240
Compare
Fixed all the pending issues and tested with both docker and crio runtimes. |
- Restarting docker/crio systemd services needs dbus service to be up and running otherwise will get this error in some cases: 'Failed to connect to bus: No such file or directory'
- docker.io/openshift/origin-nginx-router image no longer available
bb42240
to
1adebf7
Compare
@pravisankar: The following test failed, say
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
@@ -122,16 +122,6 @@ | |||
}, | |||
"files": {} | |||
}, | |||
"nginx-router": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rajatchopra do you have any opinion about this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we have no plan to test nginx then this is fine. We may have to have some way to build and host the nginx image for origin releases though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once we have nginx image for origin, we could add again to this script if needed.
Currently this change was done to unblock hack/build-local-images.py script, otherwise it tries to build nginx-router, since the image doesn't exists it fails and it won't proceed building other local images.
fi | ||
|
||
if [[ -n "${local_registry}" ]]; then | ||
add-registry-to-runtime "${registry_ip}:${REGISTRY_PORT}" "${container_runtime}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to detect if this has already been done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to detect if registry entries already exists if adding local registry was a separate dind call. In here, we added local registry as an optional param to dind start. So we are guaranteed that registry entries will not present beforehand.
dind nodes and master are freshly created just few lines above this call. So local registry entries will not be present.
${DOCKER_CMD} run -d -p ${REGISTRY_PORT}:5000 --restart=always --name ${REGISTRY_NAME} registry:2 > /dev/null | ||
echo "Created local registry '${REGISTRY_NAME}' at ${ip}:${REGISTRY_PORT}" | ||
|
||
# Build, tag and push local images |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should there be a way to do this again later? I think a separate command to add all images to the local registry would be handy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that will be useful.
I was thinking instead of a new command, piggybacking on 'refresh' command may be handy because most of the time we need updated openshift binary along with the image changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe a hack/local_registry.sh that performs the registry tasks could be useful
/retest |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: knobunc, pravisankar The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@knobunc @imcsk8 |
Based on suggestion from openshift#20048 (comment), I have simplified adding local registry to dind cluster and now it is a lot more flexible. Earlier '-l' flag enables local registry and '-m' flag indicates images to be pushed to local registry. Now, '-l' flag is removed and based on '-m' flag, local registry is created if needed. Usage: -m "none" or -m "" will not push any local images but will create local registry for the dind cluster. -m "all" will push all local images supported by hack/build-local-images.py script -m "<image1>,<image2>..." will push specified images to local registry '-m' flag can be used either with dind 'start' or 'refresh' command. Example: hack/dind-cluster.sh start -r -m "openshift/origin-haproxy-router,openshift/origin-cli" hack/dind-cluster.sh refresh -m "openshift/origin-haproxy-router,openshift/origin-cli"
Based on suggestion from openshift#20048 (comment), I have simplified adding local registry to dind cluster and now it is a lot more flexible. Earlier '-l' flag enables local registry and '-m' flag indicates images to be pushed to local registry. Now, '-l' flag is removed and based on '-m' flag, local registry is created if needed. Usage: -m "none" or -m "" will not push any local images but will create local registry for the dind cluster. -m "all" will push all local images supported by hack/build-local-images.py script -m "<image1>,<image2>..." will push specified images to local registry '-m' flag can be used either with dind 'start' or 'refresh' command. Example: hack/dind-cluster.sh start -r -m "openshift/origin-haproxy-router,openshift/origin-cli" hack/dind-cluster.sh refresh -m "openshift/origin-haproxy-router,openshift/origin-cli"
deployment(kubelet with openshift flags, sdn/ovs/config daemonsets)