Skip to content

Conversation

@pweil-
Copy link

@pweil- pweil- commented Feb 24, 2016

Adds the ability to run the registry as a daemonset via the oadm command.

TODO:

  1. if this looks ok then we will add the output of this command as a template in contrib This command is pretty complicated now. I don't think a template is high priority. Edit: confirmed that template is not a high priority and not necessary for this PR.
  2. test-cmd tests to exercise the option

@aweiteka @legionus @miminar @soltysh

cmd.Flags().StringVar(&cfg.Credentials, "credentials", "", "Path to a .kubeconfig file that will contain the credentials the registry should use to contact the master.")
cmd.Flags().StringVar(&cfg.ServiceAccount, "service-account", cfg.ServiceAccount, "Name of the service account to use to run the registry pod.")
cmd.Flags().StringVar(&cfg.Selector, "selector", cfg.Selector, "Selector used to filter nodes on deployment. Used to run registries on a specific set of nodes.")
cmd.Flags().BoolVar(&cfg.DaemonSet, "daemonset", cfg.DaemonSet, "Use a daemonset instead of a deployment config.")
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not specific to this pull, but do we have a plan for rolling out updates to daemonsets like DC's allow?

Copy link
Author

Choose a reason for hiding this comment

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

Orchestration of daemonset updates are in progress upstream at:

kubernetes/kubernetes#18319
kubernetes/kubernetes#19627

@pweil- pweil- force-pushed the registry-daemonset branch from a16537a to 5654f67 Compare February 24, 2016 18:37
// which only supports DCs.
if cfg.DaemonSet {
daemonSet := generateDaemonSet(podTemplate, name, label)
objects = replaceDeploymentConfig(objects, daemonSet)
Copy link

Choose a reason for hiding this comment

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

Can't we just append desired object in both cases instead of replacing unwanted?

Copy link
Author

Choose a reason for hiding this comment

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

The referenced code for adding a service would need to change - it only supports DCs at this point. That isn't a huge deal in and of itself but I hesitated to make the change. I can look in to it though.

@soltysh
Copy link
Contributor

soltysh commented Feb 26, 2016

I'd really, really, really want all our commands follow upstream Complete-Validate-Run scheme. Since you're touching this command can you please refactor it appropriately? I just did that with image-import in #7581.

@pweil-
Copy link
Author

pweil- commented Feb 26, 2016

I'd really, really, really want all our commands follow upstream Complete-Validate-Run scheme. Since you're touching this command can you please refactor it appropriately? I just did that with image-import in #7581.

sure, I'll take a look since I'm already refactoring it.

@soltysh
Copy link
Contributor

soltysh commented Feb 26, 2016

🎉

@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 10, 2016
@pweil- pweil- force-pushed the registry-daemonset branch from 5654f67 to 63ef8d1 Compare April 6, 2016 18:54
@pweil-
Copy link
Author

pweil- commented Apr 6, 2016

given the changes to the command since this was created and the conflicts when rebasing I decided to limit this to just what is needed to run as a daemonset for now and take a second pass at refactoring. Issue for follow up: #8390

@miminar @soltysh PTAL again. Thanks

@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 6, 2016
@pweil- pweil- force-pushed the registry-daemonset branch 2 times, most recently from bb87e04 to c5ce23d Compare April 6, 2016 19:20
@pweil-
Copy link
Author

pweil- commented Apr 6, 2016

[test]

@miminar
Copy link

miminar commented Apr 7, 2016

LGTM. re-[test]

@soltysh
Copy link
Contributor

soltysh commented Apr 8, 2016

LGTM

@pweil-
Copy link
Author

pweil- commented Apr 8, 2016

[test]

2 similar comments
@soltysh
Copy link
Contributor

soltysh commented Apr 8, 2016

[test]

@soltysh
Copy link
Contributor

soltysh commented Apr 8, 2016

[test]

@openshift-bot openshift-bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Apr 22, 2016
@pweil- pweil- force-pushed the registry-daemonset branch from c5ce23d to 8291d9e Compare May 2, 2016 12:27
@pweil-
Copy link
Author

pweil- commented May 2, 2016

rebased and re[test]

@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 2, 2016
@pweil-
Copy link
Author

pweil- commented May 2, 2016

any other comments here? @deads2k would you mind taking a glance at the e2e additions?

}

// if we're using a daemon set we'll add it here and remove the DC.
// We allow the dc to be created above to get the goodness of app.AddServices
Copy link
Contributor

Choose a reason for hiding this comment

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

That doesn't look too bad to fix. Why wouldn't we make the update in that function?

os::cmd::expect_success_and_text "oadm registry --daemonset -o yaml --credentials=${KUBECONFIG}" 'DaemonSet'
os::cmd::expect_success "oadm registry --daemonset --credentials=${KUBECONFIG} --images='${USE_IMAGES}'"
os::cmd::expect_success_and_text 'oadm registry --daemonset' 'service exists'
os::cmd::expect_success_and_text 'oc describe ds/docker-registry' 'Desired Number of Nodes Scheduled:\s*1'
Copy link
Contributor

Choose a reason for hiding this comment

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

oc get ds/docker-registry with a template will be more stable.

@deads2k
Copy link
Contributor

deads2k commented May 2, 2016

Minor comments. lgtm otherwise.

@0xmichalis
Copy link
Contributor

0xmichalis commented May 2, 2016

We should document the fact that there is no automatic rolling update functionality currently. Even the initial implementation discussed upstream will be in the client. Oh, and we don't even use kubectl rolling-update (only the underlying rolling updater in our dc strategy)

@0xmichalis
Copy link
Contributor

@smarterclayton do we have any plans for having process-based deployments for DaemonSets?

@deads2k
Copy link
Contributor

deads2k commented May 2, 2016

@smarterclayton do we have any plans for having process-based deployments for DaemonSets?

Rolling update is in the graduation list: kubernetes/kubernetes#15310

@smarterclayton
Copy link
Contributor

We need a "generic trigger" controller for image streams

On Mon, May 2, 2016 at 11:07 AM, David Eads notifications@github.com
wrote:

@smarterclayton https://github.com/smarterclayton do we have any plans
for having process-based deployments for DaemonSets?

Rolling update is in the graduation list: kubernetes/kubernetes#15310
kubernetes/kubernetes#15310


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#7596 (comment)

@pweil-
Copy link
Author

pweil- commented May 18, 2016

@deads2k updates for your comments in commit two. If that looks good I'll squash an merge. Thanks!

// the labels on the pod template
selector := t.Spec.Template.Labels
if t.Spec.Selector != nil {
selector = t.Spec.Selector.MatchLabels
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we default in this direction though. The daemonset node selector can be destroyed via defaulting, but the pod template spec (the one that the service has to match) is never defaulted, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

Right, (in deployments/deploymentconfigs and I imagine it's the same for daemonsets) you can have a nil selector and it will be defaulted to the podtemplate labels.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we default in this direction though. The daemonset node selector can be destroyed via defaulting, but the pod template spec (the one that the service has to match) is never defaulted, right?

Seen the error of my ways regarding node selection, but I still think we should base our service selector on the podtemplatespec labels, not the ds labels.

Copy link
Author

Choose a reason for hiding this comment

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

Still seems weird to me that your service selector would not be the exact same selector that the DS uses to determine what pods it is managing. If we create it based on pod labels the only weirdness that could happen is that a DS is still managing the pod but it no longer appears in the service. I don't think we can run into a scenario where a pod not managed by the DS shows up in the service without some deliberate updates to the service.

Will change.

Copy link
Author

Choose a reason for hiding this comment

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

updated

@pweil- pweil- force-pushed the registry-daemonset branch 2 times, most recently from 2be1972 to d19a633 Compare May 18, 2016 19:21
@pweil-
Copy link
Author

pweil- commented May 18, 2016

squashed. Will merge on green unless there are any other comments

@pweil-
Copy link
Author

pweil- commented May 18, 2016

We should document the fact that there is no automatic rolling update functionality currently

doc'd in openshift/openshift-docs#2118

@deads2k
Copy link
Contributor

deads2k commented May 18, 2016

lgtm

@soltysh
Copy link
Contributor

soltysh commented May 18, 2016

Still LGTM.

@pweil-
Copy link
Author

pweil- commented May 18, 2016

re[test]

@pweil-
Copy link
Author

pweil- commented May 18, 2016

[merge]

@openshift-bot
Copy link
Contributor

openshift-bot commented May 18, 2016

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_requests_origin/5944/) (Image: devenv-rhel7_4236)

@pweil- pweil- force-pushed the registry-daemonset branch from d19a633 to 899062e Compare May 19, 2016 12:07
@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to 899062e

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to 899062e

@openshift-bot openshift-bot merged commit 27e2696 into openshift:master May 19, 2016
@openshift-bot
Copy link
Contributor

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

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.

7 participants