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

Dockerhub creds for image pulls #6883

Closed
jferr opened this issue Nov 2, 2020 · 11 comments
Closed

Dockerhub creds for image pulls #6883

jferr opened this issue Nov 2, 2020 · 11 comments
Labels
kind/support Categorizes issue or PR as a support question. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.

Comments

@jferr
Copy link

jferr commented Nov 2, 2020

In light of the recent dockerhub pull limits https://www.docker.com/increase-rate-limits?utm_source=docker&utm_medium=web%20referral&utm_campaign=pull%20limits%20home%20page&utm_budget= how would I pass dockerhub creds to kubespray for it to use when pulling images to our nodes when creating a cluster?

@jferr jferr added the kind/support Categorizes issue or PR as a support question. label Nov 2, 2020
@jseguillon
Copy link
Contributor

I think best way would be to add some custom playbook to render a /root/.docker/config.json, before running cluster.yaml, with something like this :

{
	"auths": {
		"https://index.docker.io/v1/": {
			"auth": "BASE64_ENCODE_USER_AND_PASS"
		}
}

Since containers are download via plain docker pull command lines via user root, this should work.

@Miouge1
Copy link
Contributor

Miouge1 commented Nov 25, 2020

Adding API credentials bumps the rate limiting from 100 to 200. Possibly more if Docker hub adds an exception for open source projects (conditions might apply).

Another option that someone (@EppO I think?) mentioned in Slack could be to add a caching proxy registry in the CI cluster.

A number of projects have been publishing images to several repos (gcr, docker hub, quay, ...). I suppose we should continue efforts to avoid docker hub images whenever possible.

At the moment I do not have bandwidth to work on the topic, but thanks to the open source nature of the project anyone can contribute.

@Miouge1 Miouge1 added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Nov 25, 2020
@hafe
Copy link
Contributor

hafe commented Dec 1, 2020

Kubespray is not only docker

@LuckySB
Copy link
Contributor

LuckySB commented Dec 3, 2020

you may use free dockerhub proxy mirror on https://mirror.gcr.io
docker_registry_mirrors:

@LuckySB
Copy link
Contributor

LuckySB commented Dec 3, 2020

containerd

containerd_config:
  grpc:
    max_recv_message_size: 16777216
    max_send_message_size: 16777216
  registries:
    "docker.io":
      - "https://mirror.gcr.io"
      - "https://registry-1.docker.io"

@LuckySB
Copy link
Contributor

LuckySB commented Dec 3, 2020

crio #6977 coming soon )

@soakes
Copy link

soakes commented Dec 22, 2020

This wasn't working for me using containerd as I was still hitting API limits due to most of my infrastuctre is NATTED so I have to provide dockerhub user/pass.

Also using the mirror.gcr.io solution was not working with 2.14.2 tag, probbaly the images are removed, idk.

However, I managed to add a mini patch which does allow for this support, im sure it can be done better but it does work and may give an idea how to do this.

modified: roles/container-engine/containerd/templates/config.toml.j2

{% if 'dockerhub' in containerd_config %}
[plugins.cri.registry.mirrors]
  [plugins.cri.registry.mirrors."docker.io"]
    endpoint = ["https://index.docker.io/v2"]
[plugins.cri.registry.auths]
  [plugins.cri.registry.auths."docker.io"]
{% for param, value in containerd_config.dockerhub.items() %}
    {{ param }} = "{{ value }}"
{% endfor %}
{% endif %}

inventory/sample/group_vars/all/containerd.yml

containerd_config:
  grpc:
    max_recv_message_size: 16777216
    max_send_message_size: 16777216
  debug:
    level: ""
  dockerhub:
    username: "myuser"
    password: "mypass"
  max_container_log_line_size: -1

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 22, 2021
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Apr 21, 2021
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-contributor-experience at kubernetes/community.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-contributor-experience at kubernetes/community.
/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/support Categorizes issue or PR as a support question. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Projects
None yet
Development

No branches or pull requests

8 participants