-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Only deploy container engine if needed on etcd nodes #7532
Conversation
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
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. |
Welcome @VannTen! |
Hi @VannTen. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
cluster.yml
Outdated
- deploy_container_engine|default(true) | ||
- etcd_deployment_type != "host" or "k8s-cluster" in group_names |
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.
I think you should define deploy_container_engine
in roles/kubespray-defaults/defaults/main.yaml
, because deploy_container_engine
is used at multiple locations
something like
deploy_container_engine: etcd_deployment_type != "host" or inventory_hostname in groups['kube-cluster']
With the current state (of this PR), it's impossible to override it for
external etcd nodes using the host method.
If I'm correct, using the default would make it possible. (Correct me
if I'm mistaken).
Should it be ? (possible, I mean). I don't see a case where kubespray
should do it, but I may have missed some use cases.
I'll defer to your opinion on that.
By the way, regardless of the path which will be chosen, I realized I'll
need to update the other location where the role is imported with that
check.
|
My point is don't update all the locations at all and just define |
I modified the pr according to this. I got your point, but mine was that the behavior is slighly different. Regarding the CLA, I need a CCLA (I'm doing this on company time), and I've |
@@ -230,6 +230,9 @@ kube_api_aggregator_routing: false | |||
# Profiling | |||
kube_profiling: false | |||
|
|||
# Whether to deploy the container engine | |||
deploy_container_engine: inventory_hostname in groups['k8s-cluster'] or etcd_deployment_type != 'host' |
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.
now that I see it I have a doubt ...
deploy_container_engine: inventory_hostname in groups['k8s-cluster'] or etcd_deployment_type != 'host' | |
deploy_container_engine: {{ inventory_hostname in groups['k8s-cluster'] or etcd_deployment_type != 'host' }} |
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.
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.
Is it fine to skip this @champtar point?
Boolean can be evaluated directly can't they (in yaml ansible I mean) ?
I'll update with the new group name
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.
I have a problem while upgrading the etcd in #8381 so I trying to debug by printing out the value of deploy_container_engine
ansible.builtin.debug:
msg: "deploy_container_engine={{ deploy_container_engine }} host={{ inventory_hostname }}, etcd={{ etcd_deployment_type }}
TASK [deploy_container_engine]
ok: [callisto-e3] => {
"msg": "deploy_container_engine=inventory_hostname in groups['k8s_cluster'] or etcd_deployment_type != 'host' host=callisto-e3, etcd=host"
}
It's turn out that the variable is literally a string from kubespray/roles/kubespray-defaults/defaults/main.yaml
so it evaluated as True
in { role: container-engine, tags: "container-engine", when: deploy_container_engine }
and cause the container-engine role to run
After I apply a fix in #8386 the value is now boolean as expected and the problem solved.
TASK [deploy_container_engine]
ok: [callisto-e1] => {
"msg": "deploy_container_engine=False host=callisto-e1, etcd=host"
}
now that I see it I have a doubt ...
```suggestion
deploy_container_engine: {{ inventory_hostname in groups['k8s-cluster'] or etcd_deployment_type != 'host' }}
```
Well, that would need quotes around the brackets. But I don't think we
need to interpolate here ?
|
@VannTen any progress on the CLA signing ? |
That answers the CLA signing question, still need rebase |
I'll do that. |
Is there anything missing from my side to proceed ? |
I've restarted tests as there was a temp issue with the CI on your PR |
/cc @champtar |
If the etcd cluster is separate and the etcd_deployment_type is "host", there is no need for a container engine on the etcd nodes Do not rely on a 'default(true)' filter, but define a proper default in kubespray-defaults depending on etcd deployment method and if internal or external etcd is used
I've updated the PR to use the new naming scheme. The failing job does not seem related to me (certificate problem). Is there anything missing from my side ? |
Yes the CI issue is linked to something else, that'll be soon fixed on master branch. |
/lgtm |
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.
/ok-to-test
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: floryut, VannTen The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
If the etcd cluster is separate and the etcd_deployment_type is "host", there is no need for a container engine on the etcd nodes Do not rely on a 'default(true)' filter, but define a proper default in kubespray-defaults depending on etcd deployment method and if internal or external etcd is used
If the etcd cluster is separate and the etcd_deployment_type is "host", there is no need for a container engine on the etcd nodes Do not rely on a 'default(true)' filter, but define a proper default in kubespray-defaults depending on etcd deployment method and if internal or external etcd is used
What type of PR is this?
/kind bug
What this PR does / why we need it:
If the etcd cluster is separate and the etcd_deployment_type is "host",
there is no need for a container engine on the etcd nodes
Which issue(s) this PR fixes:
Fixes #7314
The issue was closed by its author, but it is not solved
Special notes for your reviewer:
Does this PR introduce a user-facing change?: