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

feat(k8s): allow pulling base images when building in cluster #1374

Merged
merged 4 commits into from
Dec 5, 2019

Conversation

edvald
Copy link
Collaborator

@edvald edvald commented Dec 2, 2019

What this PR does / why we need it:

We now use the configured imagePullSecrets on the kubernetes
provider to authenticate the cluster Docker daemon or Kaniko pods, so
that you can pull base images from private repositories.

This PR includes new integration tests and some helpers that were needed
to facilitate those.

Which issue(s) this PR fixes:

Closes #1236

@edvald edvald requested a review from eysi09 December 2, 2019 15:32
@edvald edvald force-pushed the private-registry-auth branch 10 times, most recently from 45ff2be to b7f0eb7 Compare December 3, 2019 08:21
@edvald
Copy link
Collaborator Author

edvald commented Dec 3, 2019

The current CI error appears related to #1373, so we should perhaps try and get that merged first.

@edvald edvald force-pushed the private-registry-auth branch from b7f0eb7 to 92bdeb0 Compare December 3, 2019 16:04
Flagging as a refactor because this is mainly intended for internal
usage for now, since changing the namespace might have some unintended
consequences.
@edvald edvald force-pushed the private-registry-auth branch from a87356f to 3cf6c35 Compare December 4, 2019 12:53
Copy link
Collaborator

@eysi09 eysi09 left a comment

Choose a reason for hiding this comment

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

Looks good! Noticed a typo but that's basically it. Want to try manually with gcr before approving.

@@ -143,16 +143,30 @@ your own cron jobs.

## Pulling base images from private registries

Currently, only the _Local Docker_ build mode supports pulling base images from private registries in Dockerfiles. If you see an `ImagePullBackOff` error when using the other build modes, it's likely that it's failing because the Dockerfile for the module contains an entry like this:
The in-cluster builder may need to be able to pull base images from a private registry, e.g. if your Dockerfile starts something like this:
Copy link
Collaborator

Choose a reason for hiding this comment

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

with missing in if your Dockerfile starts something...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

We now use the configured `imagePullSecrets` on the `kubernetes`
provider to authenticate the cluster Docker daemon or Kaniko pods, so
that you can pull base images from private repositories.

This PR includes new integration tests and some helpers that were needed
to facilitate those.

Closes #1236
@edvald edvald force-pushed the private-registry-auth branch from 3cf6c35 to e867903 Compare December 5, 2019 16:24
Copy link
Collaborator

@eysi09 eysi09 left a comment

Choose a reason for hiding this comment

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

Worked with a private image on GCR. Approved!

@eysi09 eysi09 merged commit b5c6e41 into master Dec 5, 2019
@eysi09 eysi09 deleted the private-registry-auth branch December 5, 2019 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow pulling images from private registries when using remote building
2 participants