-
Notifications
You must be signed in to change notification settings - Fork 408
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
Yurtctl modify kube-controllersetting to close the nodelifecycle-controller #399
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -184,7 +184,7 @@ spec: | |
containers: | ||
- name: yurtctl-servant | ||
image: {{.yurtctl_servant_image}} | ||
imagePullPolicy: Always | ||
imagePullPolicy: IfNotPresent | ||
command: | ||
- /bin/sh | ||
- -c | ||
|
@@ -229,7 +229,7 @@ spec: | |
containers: | ||
- name: yurtctl-servant | ||
image: {{.yurtctl_servant_image}} | ||
imagePullPolicy: Always | ||
imagePullPolicy: IfNotPresent | ||
command: | ||
- /bin/sh | ||
- -c | ||
|
@@ -251,5 +251,57 @@ spec: | |
- name: KUBELET_SVC | ||
value: {{.kubeadm_conf_path}} | ||
{{end}} | ||
` | ||
// DisableNodeControllerJobTemplate defines the node-controller disable job in yaml format | ||
DisableNodeControllerJobTemplate = ` | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: {{.jobName}} | ||
namespace: kube-system | ||
spec: | ||
template: | ||
spec: | ||
hostPID: true | ||
hostNetwork: true | ||
restartPolicy: OnFailure | ||
nodeName: {{.nodeName}} | ||
containers: | ||
- name: yurtctl-disable-node-controller | ||
image: {{.yurtctl_servant_image}} | ||
imagePullPolicy: IfNotPresent | ||
command: | ||
- /bin/sh | ||
- -c | ||
args: | ||
- "nsenter -t 1 -m -u -n -i -- sed -i 's/--controllers=/--controllers=-nodelifecycle,/g' {{.pod_manifest_path}}/kube-controller-manager.yaml" | ||
securityContext: | ||
privileged: true | ||
` | ||
// EnableNodeControllerJobTemplate defines the node-controller enable job in yaml format | ||
EnableNodeControllerJobTemplate = ` | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: {{.jobName}} | ||
namespace: kube-system | ||
spec: | ||
template: | ||
spec: | ||
hostPID: true | ||
hostNetwork: true | ||
restartPolicy: OnFailure | ||
nodeName: {{.nodeName}} | ||
containers: | ||
- name: yurtctl-enable-node-controller | ||
image: {{.yurtctl_servant_image}} | ||
imagePullPolicy: IfNotPresent | ||
command: | ||
- /bin/sh | ||
- -c | ||
args: | ||
- "nsenter -t 1 -m -u -n -i -- sed -i 's/--controllers=-nodelifecycle,/--controllers=/g' {{.pod_manifest_path}}/kube-controller-manager.yaml" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if no There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, yes. In the cluster installed by kubeadm, the static file of kube-controller-manager contains this parameter |
||
securityContext: | ||
privileged: true | ||
` | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why use
ro.YurtctlServantImage
to enable or disable nodelifecycle controller?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the system architecture may be amd64, arm64, arm, using a unified basic image may cause problems. So the parameter of yurtctl convert --yurtctl-servant-image is reused here.
The yurtctl-servant image may be separated from yurtctl in the future for more elegant use.