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

run kube controllers in a separate process #6735

Closed
wants to merge 1 commit into from

Conversation

deads2k
Copy link
Contributor

@deads2k deads2k commented Jan 15, 2018

This adds a new exec start for our master-controllers service to launch the kube-controller-manager in the same unit. This is a compromise between the desired static pods and the current (and unmaintainable) two processes in a single process using separate leases. This keeps from requiring re-education on how to restart controllers for 3.9, while still allowing separate controller PIDs to go with the separate leases. We'll also get separate health and metrics, but we don't have those yet.

@smarterclayton @derekwaynecarr @eparis @liggitt as we've discussed separately. Also, are we ready for openshift start master to become "best effort" and spawn the kube controller managers for 3.9 or will we go for broke and remove it?
@sdodson This gives us something to talk about. How can I improve it?

Can't merge until openshift/origin#18100

@openshift-ci-robot openshift-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jan 15, 2018
{% if openshift_cloudprovider_kind | default('') != '' -%} -v {{ openshift.common.config_base }}/cloudprovider:{{ openshift.common.config_base}}/cloudprovider {% endif -%} \
-v /etc/pki:/etc/pki:ro \
{% if l_bind_docker_reg_auth | default(False) %} -v {{ oreg_auth_credentials_path }}:/root/.docker:ro{% endif %}\
{{ osm_image }}:${IMAGE_VERSION} start master controllers \
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo?

Copy link
Member

Choose a reason for hiding this comment

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

Which part? {{ osm_image }} is part of the jinja template ${IMAGE_VERSION} is an environment variable set in EnvironmentFile

--leader-elect \
--leader-elect-retry-period=3s \
--leader-elect-resource-lock=configmaps \
--openshift-config=${CONFIG_FILE}
Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting - I would have thought the other settings would come from openshift-config as well. Is that not the case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Interesting - I would have thought the other settings would come from openshift-config as well. Is that not the case?

This file is needed for

  1. recycler template which should be passed as a fully formed template file reference (flag available)
  2. command line flag args which should be passed as options

I added comments here: https://github.com/openshift/origin/pull/18100/files#r161594020

I think we should try to follow kube when kube moves to its config, not double down on our own for those two settings. Then its a feature flag and we're only two patches away from running just like upstream (for good or for ill)

@eparis
Copy link
Member

eparis commented Jan 15, 2018

I assume this is
/hold
because we are past 3.9 feature freeze?

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 15, 2018
@@ -22,12 +22,39 @@ ExecStart=/usr/bin/docker run --rm --privileged --net=host \
{% if l_bind_docker_reg_auth | default(False) %} -v {{ oreg_auth_credentials_path }}:/root/.docker:ro{% endif %}\
{{ osm_image }}:${IMAGE_VERSION} start master controllers \
--config=${CONFIG_FILE} $OPTIONS
ExecStartPre=-/usr/bin/docker rm -f {{ openshift_service_type}}-master-kube-controllers
Copy link
Member

Choose a reason for hiding this comment

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

@mrunalp @runcom doesn't docker get really angry when you use rm -f ? Or is docker ok with this?

Copy link
Member

Choose a reason for hiding this comment

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

That was usually related to some devmapper stuff, I doubt we have that issue anymore but yeah, Docker at least had an issue with rm -f

@@ -11,6 +11,21 @@ Type=notify
EnvironmentFile=/etc/sysconfig/{{ openshift_service_type }}-master-controllers
Environment=GOTRACEBACK=crash
ExecStart=/usr/bin/openshift start master controllers --config=${CONFIG_FILE} $OPTIONS
ExecStart=/usr/bin/hyperkube kube-controller-manager \
--controllers="*" --controllers=-ttl --controllers=-bootstrapsigner --controllers=-tokencleaner --controllers=-horizontalpodautoscaling --controllers=-serviceaccount-token \
--service-account-private-key-file=openshift.local.config/master/serviceaccounts.private.key \
Copy link
Member

Choose a reason for hiding this comment

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

Do things like openshift.local.config not need to be {{ openshift.local.config }} ? Throughout?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do things like openshift.local.config not need to be {{ openshift.local.config }} ? Throughout?

I don't know. @sdodson ?

Copy link
Member

Choose a reason for hiding this comment

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

It should be --service-account-private-key-file={{ openshift_master_config_dir }}/serviceaccounts.private.key which would evaluate to /etc/origin/master/serviceaccounts.private.key

@openshift-ci-robot
Copy link

openshift-ci-robot commented Jan 15, 2018

@deads2k: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
ci/openshift-jenkins/tox 4ea7a9a link /test tox
ci/openshift-jenkins/logging 4ea7a9a link /test logging
ci/openshift-jenkins/install 4ea7a9a link /test install
ci/openshift-jenkins/containerized 4ea7a9a link /test containerized
ci/openshift-jenkins/extended_conformance_install_crio 4ea7a9a link /test crio

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

-v /etc/pki:/etc/pki:ro \
{% if l_bind_docker_reg_auth | default(False) %} -v {{ oreg_auth_credentials_path }}:/root/.docker:ro{% endif %}\
{{ osm_image }}:${IMAGE_VERSION} start master controllers \
--controllers="*" --controllers=-ttl --controllers=-bootstrapsigner --controllers=-tokencleaner --controllers=-horizontalpodautoscaling --controllers=-serviceaccount-token \
Copy link
Member

Choose a reason for hiding this comment

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

If an admin would ever want to modify this we should use an environment variable to define these so they can just edit /etc/sysconfig/origin-master and restart the service.

LimitNOFILE=131072
LimitCORE=infinity
WorkingDirectory={{ r_openshift_master_data_dir }}
SyslogIdentifier={{ openshift_service_type }}-master-controllers
SyslogIdentifier={{ openshift_service_type }}-master-kube-controllers
Copy link
Member

Choose a reason for hiding this comment

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

This will either blast both syslog identifiers with logs from both processes or it just won't work, need to check the docs.

@sdodson
Copy link
Member

sdodson commented Jan 16, 2018

@smarterclayton @eparis how do you feel about multiple execs in one unit versus composing dependencies in multiple unit files? Will we ever wish to restart one of these processes independently we can't do that with only one unit file.

@deads2k
Copy link
Contributor Author

deads2k commented Jan 16, 2018

@smarterclayton @eparis how do you feel about multiple execs in one unit versus composing dependencies in multiple unit files? Will we ever wish to restart one of these processes independently we can't do that with only one unit file.

I don't think we need independent restart capability and since this won't last for very long (probably just one release), I'd rather avoid re-education costs associated with multiple units.

@sdodson
Copy link
Member

sdodson commented Jan 16, 2018

Right, I don't want to change the UX except for debugging scenarios where they'd want to restart a specific set of controllers. I'm fine with this approach as is if this is short lived and of course works. Unless someone says this is a 3.9 blocker I don't think CL team will have time to test this.

@deads2k
Copy link
Contributor Author

deads2k commented Jan 16, 2018

For 3.9, we will deal with the "which controllers are running in this process" problem instead of trying to use this to run in separate processes.

@deads2k deads2k closed this Jan 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants