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
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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

ExecStart=/usr/bin/docker run --rm --privileged --net=host \
--name {{ openshift_service_type }}-master-kube-controllers \
--env-file=/etc/sysconfig/{{ openshift_service_type }}-master-kube-controllers \
-v {{ r_openshift_master_data_dir }}:{{ r_openshift_master_data_dir }} \
-v /var/run/docker.sock:/var/run/docker.sock \
-v {{ openshift.common.config_base }}:{{ openshift.common.config_base }} \
{% 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

--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.

--service-account-private-key-file=openshift.local.config/master/serviceaccounts.private.key \
--root-ca-file=openshift.local.config/master/ca-bundle.crt \
--kubeconfig=openshift.local.config/master/openshift-master.kubeconfig \
--pod-eviction-timeout=5m \
--enable-dynamic-provisioning=true \
--port=-1 \
--use-service-account-credentials=true \
--cluster-signing-cert-file="" \
--cluster-signing-key-file="" \
--leader-elect \
--leader-elect-retry-period=3s \
--leader-elect-resource-lock=configmaps \
--openshift-config=${CONFIG_FILE}
ExecStartPost=/usr/bin/sleep 10
ExecStop=/usr/bin/docker stop {{ openshift_service_type }}-master-controllers
ExecStop=/usr/bin/docker stop {{ openshift_service_type }}-master-kube-controllers
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.

Restart=always
RestartSec=5s

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

--root-ca-file=openshift.local.config/master/ca-bundle.crt \
--kubeconfig=openshift.local.config/master/openshift-master.kubeconfig \
--pod-eviction-timeout=5m \
--enable-dynamic-provisioning=true \
--port=-1 \
--use-service-account-credentials=true \
--cluster-signing-cert-file="" \
--cluster-signing-key-file="" \
--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)

LimitNOFILE=131072
LimitCORE=infinity
WorkingDirectory={{ r_openshift_master_data_dir }}
Expand All @@ -20,3 +35,5 @@ RestartSec=5s

[Install]
WantedBy=multi-user.target