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

[master] Fixed default DNS min replica for single node clusters #8112

Merged

Conversation

smasset
Copy link
Contributor

@smasset smasset commented Oct 22, 2021

What type of PR is this?
/kind bug

What this PR does / why we need it:
Single node cluster don't need 2 coreDNS pods.
This PR compares 2 (current absolute default value) and the length of the k8s_cluster inventory group and uses the minimum as the default value for dns_min_replicas

Which issue(s) this PR fixes:
N/A

Special notes for your reviewer:
N/A

Does this PR introduce a user-facing change?:

Default DNS replica count is now set to the minimum value between 2 and the length of k8s_cluster inventory group.

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 22, 2021
@k8s-ci-robot
Copy link
Contributor

Hi @smasset. 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 size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Oct 22, 2021
@smasset
Copy link
Contributor Author

smasset commented Oct 22, 2021

/sig cluster-lifecycle

@k8s-ci-robot k8s-ci-robot added the sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. label Oct 22, 2021
@k8s-ci-robot
Copy link
Contributor

@smasset-orange: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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.

@oomichi
Copy link
Contributor

oomichi commented Oct 22, 2021

Thanks for your pull request.
I have the similar trick outside of Kubespray for a single node k8s.
It is really nice to have it inside of Kubespray.

/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 22, 2021
@@ -3,7 +3,7 @@
dns_memory_limit: 170Mi
dns_cpu_requests: 100m
dns_memory_requests: 70Mi
dns_min_replicas: 2
dns_min_replicas: "{{ [ 2, groups['all'] | length ] | min }}"
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: all group contains etcd, and if dedicated etcd node exists on all 2 nodes 1 could be better for the case.
For such case, kube_node or k8s_cluster is better instead of all. That is a corner case, maybe not so important.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed using kube_control_plane (used by role task anyway) with latest pushed commit

Copy link
Contributor

Choose a reason for hiding this comment

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

It is still possible to have a cluster with one controller (groups['kube_control_pane']|length = 1) and more workers in which case there would be room enough to deploy more coredns replicas. In this case I would suggest to stick with the recomandation of using either kube_node or k8s_cluster as the group reference.

Copy link
Contributor

Choose a reason for hiding this comment

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

For respecting @cristicalin comment, it is better to get more feedback before merging.

/lgtm cancel

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed using k8s_cluster group

Copy link
Contributor

Choose a reason for hiding this comment

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

confirmed the point has been applied on the latest pull request.

@smasset smasset force-pushed the bugfix/dns-single-node-master branch from 4c609c5 to 9872850 Compare October 22, 2021 16:57
@oomichi
Copy link
Contributor

oomichi commented Oct 22, 2021

Thanks for updating.

/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 22, 2021
@smasset
Copy link
Contributor Author

smasset commented Oct 23, 2021

/assign @Miouge1

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 24, 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.

@smasset Thanks for the PR

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: floryut, smasset

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 25, 2021
@floryut
Copy link
Member

floryut commented Oct 25, 2021

@smasset Thanks for the PR

oops sorry @cristicalin @oomichi ; didn't see your discussion.
/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 25, 2021
@smasset smasset force-pushed the bugfix/dns-single-node-master branch from 9872850 to 6ede98c Compare October 25, 2021 17:38
@oomichi
Copy link
Contributor

oomichi commented Oct 26, 2021

Thanks for updating.

/hold cancel
/lgtm

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Oct 26, 2021
@k8s-ci-robot k8s-ci-robot merged commit 7c3369e into kubernetes-sigs:master Oct 26, 2021
@floryut floryut added kind/feature Categorizes issue or PR as related to a new feature. and removed kind/bug Categorizes issue or PR as related to a bug. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. labels Oct 27, 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
@smasset smasset deleted the bugfix/dns-single-node-master branch June 1, 2022 10:08
LuckySB pushed a commit to southbridgeio/kubespray that referenced this pull request Jun 27, 2023
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/feature Categorizes issue or PR as related to a new feature. 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/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants