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

Only deploy container engine if needed on etcd nodes #7532

Merged
merged 1 commit into from
Oct 12, 2021

Conversation

VannTen
Copy link
Contributor

@VannTen VannTen commented Apr 20, 2021

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?:

Container engine is no longer installed on separate etcd nodes when using
`etcd_deployment_type: host`

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Apr 20, 2021
@k8s-ci-robot
Copy link
Contributor

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.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Apr 20, 2021
@k8s-ci-robot
Copy link
Contributor

Welcome @VannTen!

It looks like this is your first PR to kubernetes-sigs/kubespray 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/kubespray has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Apr 20, 2021
@k8s-ci-robot k8s-ci-robot requested review from bozzo and EppO April 20, 2021 10:34
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Apr 20, 2021
cluster.yml Outdated
Comment on lines 44 to 45
- deploy_container_engine|default(true)
- etcd_deployment_type != "host" or "k8s-cluster" in group_names
Copy link
Contributor

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']

@VannTen
Copy link
Contributor Author

VannTen commented Apr 22, 2021 via email

@champtar
Copy link
Contributor

My point is don't update all the locations at all and just define deploy_container_engine in roles/kubespray-defaults/defaults/main.yaml
Also you need to sign the CLA ;)

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 23, 2021
@VannTen
Copy link
Contributor Author

VannTen commented Apr 23, 2021

I modified the pr according to this.
I updated the (not that many) location which were using the 'default(true)',
since it does not make sense to have it if we define the default in
kubespray-defaults.

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
asked my management if we already have one or need to do the sign up.

@@ -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'
Copy link
Contributor

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

Suggested change
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' }}

Copy link
Contributor

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?

Anyways we need to replace k8s-cluster with k8s_cluster because of the commit 360aff4

Copy link
Contributor Author

@VannTen VannTen Oct 7, 2021

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

Copy link
Member

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"
}

@VannTen
Copy link
Contributor Author

VannTen commented Apr 23, 2021 via email

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 28, 2021
@champtar
Copy link
Contributor

@VannTen any progress on the CLA signing ?

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Aug 11, 2021
@champtar
Copy link
Contributor

That answers the CLA signing question, still need rebase

@VannTen
Copy link
Contributor Author

VannTen commented Aug 23, 2021

I'll do that.

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 23, 2021
@VannTen VannTen requested a review from champtar August 23, 2021 13:40
@VannTen
Copy link
Contributor Author

VannTen commented Sep 8, 2021

Is there anything missing from my side to proceed ?

@floryut
Copy link
Member

floryut commented Sep 8, 2021

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

@floryut
Copy link
Member

floryut commented Sep 9, 2021

/cc @champtar
All good for you ?

@floryut
Copy link
Member

floryut commented Sep 24, 2021

/cc @champtar @oomichi

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
@VannTen
Copy link
Contributor Author

VannTen commented Oct 11, 2021

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 ?

@floryut
Copy link
Member

floryut commented Oct 12, 2021

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.
And regarding your PR, nothing, only time from reviewers to drop a lgtm on it 😄

@champtar
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 12, 2021
@floryut floryut added kind/container-managers Containers section in the release note and removed kind/bug Categorizes issue or PR as related to a bug. labels Oct 12, 2021
Copy link
Member

@floryut floryut left a comment

Choose a reason for hiding this comment

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

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 12, 2021
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 12, 2021
@k8s-ci-robot k8s-ci-robot merged commit e4c8c71 into kubernetes-sigs:master Oct 12, 2021
@floryut floryut mentioned this pull request Dec 21, 2021
sakuraiyuta pushed a commit to sakuraiyuta/kubespray that referenced this pull request Apr 16, 2022
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
LuckySB pushed a commit to southbridgeio/kubespray that referenced this pull request Jun 27, 2023
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/container-managers Containers section in the release note lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do not install containerd on dedicated etcd with etcd_deployment_type=host
6 participants