Skip to content

fix: add custom clusterrole for ccm helm chart#1042

Merged
lukasmetzner merged 4 commits into
hetznercloud:mainfrom
hegerdes:feat/custom-rbac-role
Oct 20, 2025
Merged

fix: add custom clusterrole for ccm helm chart#1042
lukasmetzner merged 4 commits into
hetznercloud:mainfrom
hegerdes:feat/custom-rbac-role

Conversation

@hegerdes

@hegerdes hegerdes commented Oct 2, 2025

Copy link
Copy Markdown
Contributor

This adds a new ClusterRole to the ccm helm chart and implements the least privilege principle for ccm rbac permissions.

The values are mostly taken from the aws ccm and k8s docs but I added ConfigMap permissions since hcloud ccm needs them.

The following SA permissions are not strictly needed, but can be nesessary if you want to run the ccm in an none default config where each controller gets its own SA.

  - apiGroups:
      - ""
    resources:
      - serviceaccounts
    verbs:
      - create

Fixes #1004

feat(helm): use custom ClusterRole

Least privlage rbac permissions. Fixes hetznercloud#1004

Signed-off-by: Henrik Gerdes <hegerdes@outlook.de>
@hegerdes
hegerdes requested a review from a team as a code owner October 2, 2025 07:55
@codecov

codecov Bot commented Oct 2, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.80%. Comparing base (f5345d1) to head (e295a72).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1042      +/-   ##
==========================================
- Coverage   67.52%   63.80%   -3.73%     
==========================================
  Files          23       23              
  Lines        3249     3249              
==========================================
- Hits         2194     2073     -121     
- Misses        885     1011     +126     
+ Partials      170      165       -5     
Flag Coverage Δ
e2e ?
unit 63.80% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Henrik Gerdes <hegerdes@outlook.de>

@lukasmetzner lukasmetzner left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey @hegerdes, I have removed a few things, which are in the AWS CCM, but I don't see a reason to have them here.

Here are the officially required rules by the Kubernetes docs: https://kubernetes.io/docs/concepts/architecture/cloud-controller/#authorization-miscellaneous

In addition with the ConfigMaps, I don't see anything we would need otherwise.

Comment thread chart/templates/clusterrole.yml
Comment thread chart/templates/clusterrole.yml Outdated
Comment thread chart/templates/clusterrole.yml Outdated
@hegerdes

Copy link
Copy Markdown
Contributor Author

Thx. Will test the suggestions again within the next days and update the PR.

You use the tools in scripts to generate the .snapshot files right?

@lukasmetzner

Copy link
Copy Markdown
Contributor

Thx. Will test the suggestions again within the next days and update the PR.

You use the tools in scripts to generate the .snapshot files right?

Yes. We use scripts/update-helm-snapshots.sh and scripts/update-deployment-yamls.sh.

Signed-off-by: Henrik Gerdes <hegerdes@outlook.de>
@hegerdes

hegerdes commented Oct 13, 2025

Copy link
Copy Markdown
Contributor Author

Everything updated. My own test with ccm in hcloud deployment succeeded

@lukasmetzner
lukasmetzner merged commit 82785b8 into hetznercloud:main Oct 20, 2025
4 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stop binding to cluster-admin for clusterrole

2 participants