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

Launch a cluster-local registry. #12833

Merged
merged 5 commits into from
Aug 21, 2015
Merged

Conversation

uluyol
Copy link
Contributor

@uluyol uluyol commented Aug 17, 2015

This registry can be accessed through proxies that run on each node listening on port 5000. We send the proxy images to the nodes directly to avoid requests that hit the network during cluster launch. For now, we continue to pull the registry itself over the network, especially given its large size (we should be able to dramatically shrink the image). On GCE we create a PD and use that for storage, otherwise we use an emptyDir. The registry is not enabled outside of GCE. All communication is currently plain HTTP. In order to use SSL, we will need to be able to request a certificate/key from the apiserver signed by the apiserver's CA cert.

@thockin

@uluyol
Copy link
Contributor Author

uluyol commented Aug 17, 2015

Some discussion for the cert issue is in #11725.

@uluyol
Copy link
Contributor Author

uluyol commented Aug 17, 2015

A quick note from an earlier discussion with @thockin, this does not currently use PV/PVCs.

@k8s-bot
Copy link

k8s-bot commented Aug 17, 2015

GCE e2e build/test failed for commit 2b545583be7d06051f8c021542e1d2dd718b9459.

@uluyol uluyol force-pushed the insecure-reg branch 2 times, most recently from f535869 to b8b5b2c Compare August 18, 2015 00:01
@k8s-bot
Copy link

k8s-bot commented Aug 18, 2015

GCE e2e build/test passed for commit f53586977dfbf4cde60cda4e2008110ae2875fd3.

@k8s-bot
Copy link

k8s-bot commented Aug 18, 2015

GCE e2e build/test passed for commit b8b5b2c14ada082222a763635d336f2273004334.

@thockin
Copy link
Member

thockin commented Aug 18, 2015

Could use help on thsi review - Bueller? Bueller?

Firing randomly: @eparis @a-robinson @fgrzadkowski

@thockin
Copy link
Member

thockin commented Aug 18, 2015

Ohh, @zmerlynn

# The set of addons images that should be prepopulated
readonly KUBE_ADDON_PATHS=(
gcr.io/google_containers/pause:0.8.0
uluyol/kube-registry-proxy:0.2.3
Copy link
Member

Choose a reason for hiding this comment

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

we'll have to make this a gcr.io image

Copy link
Member

Choose a reason for hiding this comment

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

Is this going to get addressed before you leave?

Copy link
Member

Choose a reason for hiding this comment

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

(Or before we merge.)

@thockin
Copy link
Member

thockin commented Aug 19, 2015

I like the feature. I am concerned about adding more salt (to an open wound). Looking to @zmerlynn for a reality check. Other than general distaste with salt/jinja I did not find much to pick at.

LGTM, pending consult

@zmerlynn
Copy link
Member

I'll take a look today.

@uluyol
Copy link
Contributor Author

uluyol commented Aug 19, 2015

Ref #1319

@uluyol
Copy link
Contributor Author

uluyol commented Aug 19, 2015

Pushed a new commit that uses a PV for storage.

@k8s-bot
Copy link

k8s-bot commented Aug 19, 2015

GCE e2e build/test failed for commit 406d7503459e5479c2225456c67ce25b79a148c7.

@k8s-bot
Copy link

k8s-bot commented Aug 20, 2015

GCE e2e build/test passed for commit 0a9d6f85ecb29eed0b2ed77502460d5132082f43.

-e "s/%PORT%/$REGISTRY_PORT/g" \
-e "s/%FWDPORT%/$FORWARD_PORT/g" \
-e "s|%CA_FILE%|$REGISTRY_CA|g" \
</proxy.conf.in >/proxy.conf
Copy link
Member

Choose a reason for hiding this comment

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

Should proxy.conf be in the commit then - seems like it is auto-generated here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We generate it inside of the docker container at runtime.

Copy link
Member

Choose a reason for hiding this comment

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

Right - my point is that it is in this PR, but I think we're agreed that it should not be.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, thanks. Removed.

@justinsb
Copy link
Member

Cool, though I don't understand the purpose of the proxy? I've done something similar in the past, though I set it up using a service. I set it up using a known IP, and then just used that IP to access the registry, though our DNS has improved so much since then that pure DNS might work now.

(I also set it up using S3 as the backing store; not sure which is better. My guess is that a persistent volume is more portable and doesn't require embedding credentials, so I like this approach.)

From an AWS implementation point of view, I agree that there should be a persistent backend for it too. I suggest that once this merges we open an issue to do the same thing for AWS & I will perform the equivalent changes for AWS.

@thockin
Copy link
Member

thockin commented Aug 20, 2015

Using anything but localhost requires extra flags to docker or requires TLS
certs. We were trying to get a dead-simple case working. It's a place to
build from.

On Thu, Aug 20, 2015 at 9:06 AM, Justin Santa Barbara <
notifications@github.com> wrote:

Cool, though I don't understand the purpose of the proxy? I've done
something similar in the past, though I set it up using a service. I set it
up using a known IP, and then just used that IP to access the registry,
though our DNS has improved so much since then that pure DNS might work now.

(I also set it up using S3 as the backing store; not sure which is better.
My guess is that a persistent volume is more portable and doesn't require
embedding credentials, so I like this approach.)

From an AWS implementation point of view, I agree that there should be a
persistent backend for it too. I suggest that once this merges we open an
issue to do the same thing for AWS & I will perform the equivalent changes
for AWS.


Reply to this email directly or view it on GitHub
#12833 (comment)
.

@justinsb
Copy link
Member

Ah, I didn't realize there was an exception for localhost. That is great then!

@thockin
Copy link
Member

thockin commented Aug 20, 2015

Well, we WANT to use TLS, but it was easier to start without it :)

On Thu, Aug 20, 2015 at 10:57 AM, Justin Santa Barbara <
notifications@github.com> wrote:

Ah, I didn't realize there was an exception for localhost. That is great
then!


Reply to this email directly or view it on GitHub
#12833 (comment)
.

@zmerlynn
Copy link
Member

Okay, I'm just now getting around to reviewing due to ${STUFF} getting in the way, sorry. :/

labels:
kubernetes.io/cluster-service: "true"
spec:
{% if pillar.get('cluster_registry_disk_type', '') == 'gce' %}
Copy link
Member

Choose a reason for hiding this comment

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

So if cluster_registry_disk_type isn't gce, this yaml blob just trails off at spec:?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wasn't sure what the best way to do this is. This template should only be evaluated if the cluster registry is enabled which should only be permitted if one of the branches here is taken (for non-gce, they'd need to have their own config branch). If somehow this is evaluated otherwise, that's a bug and we should see a failure.

Copy link
Member

Choose a reason for hiding this comment

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

There's a pattern to do this e.g. http://stackoverflow.com/questions/21778252/how-to-raise-an-exception-in-a-jinja2-macro, but I'm not sure we have any of the pieces elsewhere in our Salt. This looks fine for now, though, it'll error in a different way, I think.

@zmerlynn
Copy link
Member

In general looks good, I like the approach. It's salty, but meh, that's the system we have. :/

@uluyol uluyol force-pushed the insecure-reg branch 2 times, most recently from eef53a0 to 957b3f6 Compare August 20, 2015 23:22
@uluyol
Copy link
Contributor Author

uluyol commented Aug 20, 2015

Pushed new version and rebased. Nits should have been addressed.

@k8s-bot
Copy link

k8s-bot commented Aug 20, 2015

GCE e2e build/test failed for commit eef53a0de7cf01370b4f87056034e18e9ffae5e0.

@k8s-bot
Copy link

k8s-bot commented Aug 20, 2015

GCE e2e build/test passed for commit 957b3f68eb23a000f3191a6efecaa0a1dcbda5b4.

for image in "$1/"*; do
timeout 30 docker load -i "${image}" &>/dev/null
rc=$?
if [[ $rc == 124 ]]; then
Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I didn't notice the minor style nits in this file. Can you "${rc}", ${success}, ${restart_docker}, and quote "true"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, though it really isn't necessary with the double brackets.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@zmerlynn
Copy link
Member

LGTM except one minor other nit and a question. @thockin for final buyoff. I'll be oncall tomorrow morning to merge, so if it LGTY, we can see how it does with Jenkins.

Oh, and I forgot to add before: Great work!

@thockin
Copy link
Member

thockin commented Aug 21, 2015

I'm good with it all, but we'll switch the image to a gcr.io image tomorrow

On Thu, Aug 20, 2015 at 5:03 PM, Zach Loafman notifications@github.com
wrote:

LGTM except one minor other nit and a question. @thockin
https://github.com/thockin for final buyoff. I'll be oncall tomorrow
morning to merge, so if it LGTY, we can see how it does with Jenkins.

Oh, and I forgot to add before: Great work!


Reply to this email directly or view it on GitHub
#12833 (comment)
.

This registry can be accessed through proxies that run on each node
listening on port 5000. We send the proxy images to the nodes directly
to avoid requests that hit the network during cluster launch. For now,
we continue to pull the registry itself over the network, especially
given its large size (we should be able to dramatically shrink the
image). On GCE we create a PD and use that for storage, otherwise we
use an emptyDir. The registry is not enabled outside of GCE. All
communication is currently plain HTTP. In order to use SSL, we will
need to be able to request a certificate/key from the apiserver signed
by the apiserver's CA cert.
@uluyol
Copy link
Contributor Author

uluyol commented Aug 21, 2015

Fixed remaining nits and removed extraneous file.

@k8s-bot
Copy link

k8s-bot commented Aug 21, 2015

GCE e2e build/test passed for commit 2fb4e7b.

@k8s-bot
Copy link

k8s-bot commented Aug 21, 2015

GCE e2e build/test failed for commit 55825b3f78fb24a15e3b33f89cea2dd3a5931cd4.

@zmerlynn
Copy link
Member

@uluyol: Happy to merge on green, but that @k8s-bot complaint looks real. (Also we're having a rough ride on the Jenkins side this morning, but I think the seas will be calmer by lunch.)

@thockin
Copy link
Member

thockin commented Aug 21, 2015

The image for this is pushed to gcr now.

On Fri, Aug 21, 2015 at 11:48 AM, Zach Loafman notifications@github.com
wrote:

@uluyol https://github.com/uluyol: Happy to merge on green, but that
@k8s-bot https://github.com/k8s-bot complaint looks real. (Also we're
having a rough ride on the Jenkins side this morning, but I think the seas
will be calmer by lunch.)


Reply to this email directly or view it on GitHub
#12833 (comment)
.

@k8s-bot
Copy link

k8s-bot commented Aug 21, 2015

GCE e2e build/test passed for commit 3dc10a2.

@zmerlynn
Copy link
Member

Now I'm waiting for even a vaguely yellowing e2e-gce run. :(

@thockin thockin added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 21, 2015
@zmerlynn
Copy link
Member

Supergreen, I'll watch Jenkins.

zmerlynn added a commit that referenced this pull request Aug 21, 2015
Launch a cluster-local registry.
@zmerlynn zmerlynn merged commit 185b5af into kubernetes:master Aug 21, 2015
@uluyol uluyol mentioned this pull request Aug 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants