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

[v1.10] Trim clusterrole permissions of Cilium #19674

Merged
merged 7 commits into from
May 4, 2022

Conversation

aanm
Copy link
Member

@aanm aanm commented May 3, 2022

Manual backport of #19074 and #19590

The main differences between the upstream changes and this PR is that "annotateK8sNodes" does not change its default to "false" but instead it keeps it to "true" to avoid breaking existing clusters.

$ for pr in 19074 19590; do contrib/backporting/set-labels.py $pr done 1.10; done

@maintainer-s-little-helper maintainer-s-little-helper bot added the kind/backports This PR provides functionality previously merged into master. label May 3, 2022
@aanm aanm force-pushed the pr/trim-rbac-1.10 branch 2 times, most recently from 820edfb to e6fd9bc Compare May 3, 2022 03:00
@aanm
Copy link
Member Author

aanm commented May 3, 2022

/test

@aanm aanm marked this pull request as ready for review May 3, 2022 03:00
@aanm aanm requested review from a team as code owners May 3, 2022 03:00
@aanm aanm requested a review from nathanjsweet May 3, 2022 03:00
@aanm
Copy link
Member Author

aanm commented May 3, 2022

/test

@aanm
Copy link
Member Author

aanm commented May 3, 2022

/test-backport-1.10

@aanm
Copy link
Member Author

aanm commented May 3, 2022

/test-backport-1.10

@aanm
Copy link
Member Author

aanm commented May 3, 2022

/test-gke

@aanm
Copy link
Member Author

aanm commented May 3, 2022

The conformance tests are failing because of the helm changes. This needs to be merged into the stable branch and then verify if the CI started failing because of these changes.

@sayboras sayboras self-requested a review May 4, 2022 07:01
aanm added 7 commits May 4, 2022 13:18
[ upstream commit 900f668 ]

Since Cilium does not set any finalizer in the owner of the CEP, a Pod,
it does not make sense to set "BlockOwnerDeletion: true". Regardless of
this option being `true` or `false`, the Pod dependent, in this case the
CEP, is always* Garbage Collected by Kubernetes. *Only if the user
specifies the pod deletion with the "orphan" deletion cascading strategy
that the CEP will be kept. However, Cilium Operator will garbage collect
orphaned Cilium Endpoints every 5 minutes by default.

Signed-off-by: André Martins <andre@cilium.io>
[ upstream commit 2d63c9b ]

Cilium does not need to perform any Pod update thus this permission can
be removed from Cilium's Cluster Role.

Signed-off-by: André Martins <andre@cilium.io>
[ upstream commit d028338 ]

Follow up of 0f4d3a7 ("helm: Remove Unnecessary RBAC Permissions for Agent")

Signed-off-by: André Martins <andre@cilium.io>
Trimmed down clustermesh-apiserver's ClusterRole to the exact
permissions that clustermesh-apiserver requires.

Signed-off-by: André Martins <andre@cilium.io>
[ upstream commit 73d6cae ]

Since this option only existed to set up annotations in Kubernetes Nodes
before the introduction of CiliumNodes, contrary to the upstream commit
this option will be kept to 'true' with the possibility for users to
change it to 'false'.

Signed-off-by: André Martins <andre@cilium.io>
[ upstream commit f612c97 ]

To decrease the amount of permissions Cilium's requires to operate in a
cluster, the node taint removal and the setup of the node condition
NetworkUnavailable can be set through cilium-operator.

Cilium-operator will remove, if set, the Cilium's specific node taints from
the Kubernetes nodes as well as setting up the NetworkUnavailable node
condition to 'false' once it detects there is a "Ready" Cilium pod in
that node.

Signed-off-by: André Martins <andre@cilium.io>
[ upstream commit 9014253 ]

We can use the "status" subresource to update node annotations which
also allow us to reduce the clusterrole's permissions of the cilium
DaemonSet even further.

Signed-off-by: André Martins <andre@cilium.io>
@aanm
Copy link
Member Author

aanm commented May 4, 2022

/test-backport-1.10

1 similar comment
@aanm
Copy link
Member Author

aanm commented May 4, 2022

/test-backport-1.10

@aanm aanm merged commit 922b949 into cilium:v1.10 May 4, 2022
@aanm aanm deleted the pr/trim-rbac-1.10 branch May 4, 2022 20:20
michi-covalent added a commit to cilium/cilium-cli that referenced this pull request May 19, 2022
Ref: cilium/cilium#19674

Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
michi-covalent added a commit to cilium/cilium-cli that referenced this pull request May 19, 2022
Ref: cilium/cilium#19674

Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
michi-covalent added a commit to cilium/cilium-cli that referenced this pull request May 20, 2022
- Set remove-cilium-node-taints to true
- Limit nodes write access from cilium-agent to nodes/status field.
- Add node write access to cilium-operator.

Ref: cilium/cilium#19674

Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
michi-covalent added a commit to cilium/cilium-cli that referenced this pull request May 20, 2022
- Set remove-cilium-node-taints to true
- Limit nodes write access from cilium-agent to nodes/status field.
- Add node write access to cilium-operator.
- Add 'unix://' prefix for hubble-relay peer-service config.

Ref: cilium/cilium#19674

Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
michi-covalent added a commit to cilium/cilium-cli that referenced this pull request May 20, 2022
- Set remove-cilium-node-taints to true
- Limit nodes write access from cilium-agent to nodes/status field.
- Add node write access to cilium-operator.
- Add 'unix://' prefix for hubble-relay peer-service config.
- Run 'sudo cilium' for external workload.

Ref: cilium/cilium#19674

Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
tklauser pushed a commit to cilium/cilium-cli that referenced this pull request May 20, 2022
- Set remove-cilium-node-taints to true
- Limit nodes write access from cilium-agent to nodes/status field.
- Add node write access to cilium-operator.
- Add 'unix://' prefix for hubble-relay peer-service config.

Ref: cilium/cilium#19674

Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
tklauser pushed a commit to cilium/cilium-cli that referenced this pull request May 20, 2022
- Set remove-cilium-node-taints to true
- Limit nodes write access from cilium-agent to nodes/status field.
- Add node write access to cilium-operator.
- Add 'unix://' prefix for hubble-relay peer-service config.

Ref: cilium/cilium#19674

Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/backports This PR provides functionality previously merged into master.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants