Skip to content

gke: add resource quotas for Cilium Namespace - #13878

Merged
aanm merged 2 commits into
cilium:masterfrom
aanm:pr/switch-cilium-tokube-system
Nov 9, 2020
Merged

aanm merged 2 commits into
cilium:masterfrom
aanm:pr/switch-cilium-tokube-system

Conversation

@aanm

@aanm aanm commented Nov 3, 2020 •

Copy link
Copy Markdown
Member

When deploying Cilium in its own namespace, it's required to define
resource quotas. For now we will create a ResourceQuota for 10k pods
that are node-critical and 15 pods that are cluster-critical.

Also, add checkers in helm if users try to install Cilium in kube-system
namespace with the deprecated labels.

Fixes #13852

Add Resource Quotas in Cilium Namespace for GKE installations

@aanm aanm added release-note/minor This PR changes functionality that users may find relevant to operating Cilium. needs-backport/1.8 labels Nov 3, 2020
@aanm
aanm requested review from a team as code owners November 3, 2020 15:47
@aanm
aanm requested review from a team, errordeveloper and michi-covalent November 3, 2020 15:47
@aanm

aanm commented Nov 3, 2020

Copy link
Copy Markdown
Member Author

test-gke

@ti-mo

ti-mo commented Nov 3, 2020

Copy link
Copy Markdown
Contributor

Excellent, thanks! 🙌

Related #13806

@pchaigno pchaigno left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We still create the cilium namespace in test/gke/select-cluster.sh. Not sure if we can get rid of that yet.

Comment thread Documentation/gettingstarted/k8s-install-gke.rst Outdated
Comment thread test/helpers/cons.go Outdated
@aanm
aanm marked this pull request as draft November 3, 2020 16:26
@varunmar

varunmar commented Nov 4, 2020

Copy link
Copy Markdown

FYI; for context:
GKE runs the addon-manager from here - https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/addon-manager
Addons that have been added by the GKE control plane will have a label of the form addonmanager.kuberntes.io/mode=Reconcile and almost always in the kube-system namespace.

The addon manager has an additional behavior that is unexpected - it also reads the kubernetes.io/cluster-service label, and if true, it behaves exactly as though the deployment had a label of addonmanager.kuberntes.io/mode=Reconcile

To avoid this behavior, there are a couple of label combinations the resource can have -

  1. kubernetes.io/cluster-service is not set, or not set to true
  2. The addonmanager.kubernetes.io/mode label is set to "EnsureExists"
  3. Neither label is set

This behavior of addonmanager has been slated for deprecation and removal, but it has not happened yet -
Some recent discussion at kubernetes/kubernetes#72757

In GKE environments, if Cilium is deployed in 'kube-system' namespace
with the 'kubernetes.io/cluster-service: "true"' labels, GKE will delete
the DaemonSet within 1 minutes [1]. To avoid this problem these labels
are no longer installed for new installations, however, if the user
tries to install this combination of options, we should fail the
installation and warn the user about the correct usage.

[1] kubernetes/kubernetes#51376
Signed-off-by: André Martins <andre@cilium.io>
@aanm
aanm force-pushed the pr/switch-cilium-tokube-system branch from d615c42 to 86addba Compare November 5, 2020 11:15
@aanm aanm changed the title gke: switch GKE guide to kube-system namespace gke: add resource quotas for Cilium Namespace Nov 5, 2020
@aanm

aanm commented Nov 5, 2020

Copy link
Copy Markdown
Member Author

test-gke

@aanm
aanm force-pushed the pr/switch-cilium-tokube-system branch from 86addba to 4885c2b Compare November 5, 2020 11:17
@aanm

aanm commented Nov 5, 2020

Copy link
Copy Markdown
Member Author

test-gke

@aanm
aanm marked this pull request as ready for review November 5, 2020 11:17
@aanm
aanm requested a review from pchaigno November 5, 2020 11:17
@aanm
aanm removed request for a team and michi-covalent November 5, 2020 11:17

@pchaigno pchaigno left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍 only for my codeowners (docs-structure) since I don't think I'm qualified to review the rest.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just out of curiosity, where can I find more details about this number - 5k nodes from scalability perspective?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Surely we should allow users to customize this via Helm?

@aanm aanm added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Nov 6, 2020
@jrfastab

jrfastab commented Nov 6, 2020

Copy link
Copy Markdown
Contributor

test-me-please

@joestringer joestringer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Minor followup item, I don't expect many users asking for this since the limits should suffice for most scenarios but it's always possible.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Surely we should allow users to customize this via Helm?

Comment thread install/kubernetes/cilium/templates/cilium-resource-quota.yaml Outdated
When deploying Cilium in its own namespace, it's required to define
resource quotas. For now we will create a ResourceQuota for 10k pods
that are node-critical and 15 pods that are cluster-critical.

Signed-off-by: André Martins <andre@cilium.io>
@aanm
aanm force-pushed the pr/switch-cilium-tokube-system branch from 09b71ee to f166217 Compare November 7, 2020 09:43
@aanm

aanm commented Nov 7, 2020

Copy link
Copy Markdown
Member Author

test-gke

@aanm
aanm requested a review from jrfastab November 7, 2020 09:44
@aanm
aanm merged commit 14ff743 into cilium:master Nov 9, 2020
@aanm aanm mentioned this pull request Dec 4, 2020
gandro added a commit that referenced this pull request Dec 7, 2020
Support for ResourceQuotas (specifically for GKE) was added in #13878.

Signed-off-by: Sebastian Wicki <sebastian@isovalent.com>
jrajahalme pushed a commit that referenced this pull request Dec 11, 2020
Support for ResourceQuotas (specifically for GKE) was added in #13878.

Signed-off-by: Sebastian Wicki <sebastian@isovalent.com>
joestringer pushed a commit that referenced this pull request Dec 15, 2020
[ upstream commit 26f318d ]

Support for ResourceQuotas (specifically for GKE) was added in #13878.

Signed-off-by: Sebastian Wicki <sebastian@isovalent.com>
Signed-off-by: Joe Stringer <joe@cilium.io>
joestringer pushed a commit that referenced this pull request Dec 15, 2020
[ upstream commit 26f318d ]

Support for ResourceQuotas (specifically for GKE) was added in #13878.

Signed-off-by: Sebastian Wicki <sebastian@isovalent.com>
Signed-off-by: Joe Stringer <joe@cilium.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/minor This PR changes functionality that users may find relevant to operating Cilium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

insufficient quota to match these scopes