Skip to content

make dockercfg secrets handle multiple urls including service DNS #9306

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

Merged

Conversation

deads2k
Copy link
Contributor

@deads2k deads2k commented Jun 13, 2016

Replacement for #6385, builds on #9209

Let's see what the [test]s do.

This has watches on services (maybe routes later) and secrets. No work is done until the caches are up to date.

After the service (and future routes) queue up work using a single key. That workqueue consumer checks the cache for the current value of the docker registry URLs. If it has changed, it lists all dockercfg secrets and puts them into a the secretQueue.

The secretQueue holds references to dockercfg secrets. An item is dequeued, checked if it needs to be updated to the new docker registry URLs, and if so, it updates.

@deads2k
Copy link
Contributor Author

deads2k commented Jun 13, 2016

@liggitt You had the original, want this one too?

@liggitt
Copy link
Contributor

liggitt commented Jun 13, 2016

@liggitt You had the original, want this one too?

sure, if no one gets to it first

@liggitt liggitt self-assigned this Jun 13, 2016
@deads2k deads2k force-pushed the convert-docker-registry-service branch 4 times, most recently from 55856ae to 269d586 Compare June 15, 2016 17:45
@deads2k
Copy link
Contributor Author

deads2k commented Jun 15, 2016

yum re[test]

@deads2k
Copy link
Contributor Author

deads2k commented Jun 29, 2016

@Kargakis take a look at another controller?

@@ -37,14 +41,16 @@ type DockercfgControllerOptions struct {
// If zero, re-list will be delayed as long as possible
Resync time.Duration

DefaultDockerURL string
// DockerURLsIntialized is used to send a signal to this controller that it has the correct set of docker urls
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add the source of the signal (DockerRegistryServiceController) to the doc?

@0xmichalis
Copy link
Contributor

First pass looks good, but I want to give it another eye later

cc: @miminar @legionus this may interest you

return
}

go e.serviceAccountController.Run(stopCh)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you move this out of the wait function?

Copy link
Contributor Author

@deads2k deads2k Jul 1, 2016

Choose a reason for hiding this comment

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

Can you move this out of the wait function?

Sure, I hadn't fully sorted out the waiting mechanism when I wrote this.

@deads2k deads2k force-pushed the convert-docker-registry-service branch from 26ca796 to 7711762 Compare July 1, 2016 13:20
@deads2k
Copy link
Contributor Author

deads2k commented Jul 1, 2016

comments addressed.

@deads2k deads2k force-pushed the convert-docker-registry-service branch from 7711762 to f1b4f46 Compare July 1, 2016 17:22
@deads2k
Copy link
Contributor Author

deads2k commented Jul 1, 2016

#9444 re[test]

dockerCredentials = dockercfgMap[existingDockercfgSecretLocations.List()[0]].Password
}
if len(dockerCredentials) == 0 {
tokenSecret, err := e.client.Secrets(dockercfgSecret.Namespace).Get(dockercfgSecret.Annotations[ServiceAccountTokenSecretNameKey])
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't you pull this from the cache? Is there any reason for the live call?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can't you pull this from the cache? Is there any reason for the live call?

No reason I can think of. Nice catch.

@0xmichalis
Copy link
Contributor

One more question, LGTM otherwise

@deads2k deads2k force-pushed the convert-docker-registry-service branch from f1b4f46 to 834622c Compare July 5, 2016 12:00
@deads2k
Copy link
Contributor Author

deads2k commented Jul 5, 2016

[merge]

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to 834622c

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/5775/)

@openshift-bot
Copy link
Contributor

openshift-bot commented Jul 5, 2016

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/5775/) (Image: devenv-rhel7_4527)

@deads2k
Copy link
Contributor Author

deads2k commented Jul 5, 2016

#9512 re[merge]

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to 834622c

@openshift-bot openshift-bot merged commit eec443b into openshift:master Jul 5, 2016
@smarterclayton
Copy link
Contributor

Why was this merged? This is obviated by migrate.

@smarterclayton
Copy link
Contributor

Or is this supposed to only handle the case where no docker registry has been installed?

@deads2k
Copy link
Contributor Author

deads2k commented Jul 11, 2016

Or is this supposed to only handle the case where no docker registry has been installed?

Written to handle one, happens to handle both. The code doesn't get simpler by eliminating it.

Also, why make someone run a command if they don't have to and this structure makes it possible and transparent to operate against routes if we choose to add it.

@smarterclayton
Copy link
Contributor

In person discussion:

  1. This (once the route watching part is added) removes the need for a
    config variable that lists all possible names for secrets, something
    liggitt and I discussed about migration that would be required
  2. It means end users and end administrators can just create the route and
    wait
  3. It does have the downside that secrets grow much larger

We still have to have some persistent config that identifies the string
value that the API server will use to write into storage. That value still
has to be migrated. We still have to be able to migrate arbitrary secrets
for external registries. We could potentially use an annotation on the
service (resolved once per process) to record that. We also have the need
to figure out how export can expose an external image URL without having
all images in the cluster go through the router. Not going through the
router is important - unless contentRedirect is on, we can't afford to
bottleneck the cluster on proxying through an edge router. We could have
the router name resolve to the internal name if DNS supported CNAMEs from
router names to service IPs.

On Mon, Jul 11, 2016 at 2:22 PM, David Eads [email protected]
wrote:

Or is this supposed to only handle the case where no docker registry has
been installed?

Written to handle one, happens to handle both. The code doesn't get
simpler by eliminating it.

Also, why make someone run a command if they don't have to and this
structure makes it possible and transparent to operate against routes if we
choose to add it.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#9306 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ABG_pxRWFWo0kvW2rbTj9kFEHSAnBrBYks5qUonLgaJpZM4I0oqG
.

@deads2k deads2k deleted the convert-docker-registry-service branch September 6, 2016 17:17
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.

5 participants