Skip to content
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

Make image registry hostname more obvious in example #42446

Merged
merged 1 commit into from
Jan 7, 2024

Conversation

pacoxu
Copy link
Member

@pacoxu pacoxu commented Aug 8, 2023

Fixes kubernetes/kubernetes#119650

```shell
kubectl create secret docker-registry myregistrykey --docker-server=DUMMY_SERVER \
--docker-username=DUMMY_USERNAME --docker-password=DUMMY_DOCKER_PASSWORD \
--docker-email=DUMMY_DOCKER_EMAIL
```

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 8, 2023
@k8s-ci-robot k8s-ci-robot requested review from liggitt and thockin August 8, 2023 08:13
@k8s-ci-robot k8s-ci-robot added language/en Issues or PRs related to English language sig/docs Categorizes an issue or PR as relevant to SIG Docs. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 8, 2023
@netlify
Copy link

netlify bot commented Aug 8, 2023

Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit 9e09739
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-io-main-staging/deploys/6584f512fc4c8f0008fe5136
😎 Deploy Preview https://deploy-preview-42446--kubernetes-io-main-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@divya-mohan0209 divya-mohan0209 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of making this change, it'd be valuable to spell it out like you've done in the linked issue.

Something on the lines of the below?

There is no global registry prefix configuration for Kubernetes. Without any prefix appended to the image name, the image will be pulled from docker.io/library.

Copy link
Contributor

@sftim sftim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm afraid I think we need a bigger change here.

@@ -341,7 +341,7 @@ Now, when a new Pod is created in the current namespace and using the default
ServiceAccount, the new Pod has its `spec.imagePullSecrets` field set automatically:

```shell
kubectl run nginx --image=nginx --restart=Never
kubectl run nginx --image=DUMMY_SERVER/nginx --restart=Never
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_ isn't common in hostnames. Can we swap DUMMY_SERVER with image-registry.some.example or something like that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

@sftim
Copy link
Contributor

sftim commented Oct 5, 2023

There is no global registry prefix configuration for Kubernetes. Without any prefix appended to the image name, the image will be pulled from docker.io/library.

We should document that somewhere; also, we should document where the defaulting happens (is it within the API server, the kubelet, or the thing at the other end of the CRI socket?)

@pacoxu
Copy link
Member Author

pacoxu commented Oct 7, 2023

There is no global registry prefix configuration for Kubernetes. Without any prefix appended to the image name, the image will be pulled from docker.io/library.

We should document that somewhere; also, we should document where the defaulting happens (is it within the API server, the kubelet, or the thing at the other end of the CRI socket?)

This is more likely a logic in container runtime. Docker is the initial runtime and it uses it as the default one.

  • This can be configured using the registry-mirror in docker.

Some other references:

@@ -341,7 +341,7 @@ Now, when a new Pod is created in the current namespace and using the default
ServiceAccount, the new Pod has its `spec.imagePullSecrets` field set automatically:

```shell
kubectl run nginx --image=nginx --restart=Never
kubectl run nginx --image=image-registry.some.example/nginx --restart=Never
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about this? I mean, making it "fail" explicitly.

Suggested change
kubectl run nginx --image=image-registry.some.example/nginx --restart=Never
kubectl run nginx --image=<registry name>/nginx --restart=Never

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whatever we pick, we should change this:

kubectl create secret docker-registry myregistrykey --docker-server=DUMMY_SERVER \
        --docker-username=DUMMY_USERNAME --docker-password=DUMMY_DOCKER_PASSWORD \
        --docker-email=DUMMY_DOCKER_EMAIL

to match.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using <registry name> is more clear.

@kbhawkey
Copy link
Contributor

Hello, @pacoxu .
Do you have more changes to add to your pull request? Can you send a commit to restart the preview build?
Thanks

@pacoxu
Copy link
Member Author

pacoxu commented Dec 22, 2023

Do you have more changes to add to your pull request? Can you send a commit to restart the preview build?

rebased with latest main branch and force pushed.

Copy link
Contributor

@sftim sftim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 1, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: adc9fa459e1be0921bf3fa8052c16134d09d23b2

@sftim
Copy link
Contributor

sftim commented Jan 7, 2024

/retitle Make image registry hostname more obvious in example
/approve

@k8s-ci-robot k8s-ci-robot changed the title use image from DUMMY_SERVER in the example Make image registry hostname more obvious in example Jan 7, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sftim

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 7, 2024
@k8s-ci-robot k8s-ci-robot merged commit a416215 into kubernetes:main Jan 7, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. language/en Issues or PRs related to English language lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/docs Categorizes an issue or PR as relevant to SIG Docs. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

imagePullSecrets (in Service Account) not used for public images (still using DockerHub)
6 participants