Commit Graph
34 Commits
Author SHA1 Message Date
fullstackjam f635d96ae9 helm: add missing labels to RBAC resources to prevent ArgoCD drift
This PR addresses ArgoCD drift detection issues by adding consistent
metadata labels to RBAC resources in Rook Ceph Helm charts. The problem
occurs because many RBAC resources lack metadata labels, causing ArgoCD
to interpret them as 'labels: null' and report continuous drift.

Changes made:
- Added consistent labels to all RBAC templates in rook-ceph and library charts
- Created _recommended-labels.tpl template for standardized labeling
- Removed app.kubernetes.io/component label per consideRatio feedback to avoid scope creep
- Suppressed Helm-specific labels (version, instance, managed-by, created-by, chart) from static RBAC files
- Regenerated deploy/examples/common.yaml and deploy/examples/csi/nfs/rbac.yaml

Labels added to RBAC resources:
- operator: rook
- storage-backend: ceph
- app.kubernetes.io/name: rook-ceph
- app.kubernetes.io/part-of: rook-ceph-operator

Impact:
- Resolves ArgoCD 'OutOfSync' issues for Rook RBAC resources
- Improves resource identification and management
- Provides consistent labeling across all Rook Helm charts
- No functional changes to RBAC permissions
- Focuses on essential labels to avoid over-engineering

This addresses review feedback from travisn and consideRatio to maintain
scope and ensure static RBAC files only contain meaningful labels.

Signed-off-by: fullstackjam <fullstackjam@outlook.com>
2025-10-01 14:43:25 +08:00
Erik Sundell ee346bd951 helm: fix failure to cleanup psp fully
I failed to save a file before making the commit becomign PR #16558.
This small change should also have been part of it.

Signed-off-by: Erik Sundell <erik@sundellopensource.se>
2025-09-30 21:42:46 +02:00
Erik Sundell e7a704ccf1 helm: remove legacy PodSecurityPolicy resource
The helm charts allowed rendering a PodSecurityPolicy resource via the
configuration `pspEnable`. This option is removed and all references to
psp, PodSecurityPolicy, and Pod Security Policy have been cleaned up.

The PSP resource was only rendered if k8s version was lower than 1.25
when it was still supported. It has been deprecated since k8s 1.21.

Signed-off-by: Erik Sundell <erik@sundellopensource.se>
2025-09-30 18:25:35 +02:00
subhamkrai 506ac2a3ff csi: make csi-operator default deployment
this commits enable the csi-operator by default,
moving it from experimental to stable.

Also, disable the csi-operator chart from generating
rbac in common.yaml

Signed-off-by: subhamkrai <srai@redhat.com>
2025-08-14 22:33:07 +05:30
Allen Conlon fa2e499727 ci: publish helm charts to oci repos
Signed-off-by: Allen Conlon <software@conlon.dev>
2025-03-21 20:15:59 -04:00
Travis Nielsen 839920ff80 build: stop printing verbose rbac generation details
The rbac generation prints a lot of info that is not necessary
unless troubleshooting the rbac build, so we can comment it
out by default.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2022-09-13 11:26:51 -06:00
Deepika Upadhyay ccbff1be95 ci: add debug flag to identify any failing yaml origin
Signed-off-by: Deepika Upadhyay <deepika@koor.tech>
2022-09-09 23:30:51 +05:30
Blaine Gardner 6c8f2e414f build: remove psp from common.yaml generation
Due to an oversight, PSP resources were left in generation of
common.yaml from #10797. Resolve that by setting
pspEnable=false when generating common.yaml.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2022-08-29 10:41:41 -06:00
Blaine Gardner 1e9bbae583 docs: move PSPs from common.yaml to psp.yaml
Also update docs. Use `make gen-rbac` to generate psp.yaml.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2022-08-25 16:39:52 -06:00
Blaine Gardner 566585640b build: remove obsolete rbac.yaml file
build/rbac/rbac.yaml should have been removed when we started generating
common.yaml, but it was missed.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2022-07-08 09:59:05 -06:00
Blaine Gardner bca2f128ab build: generate a separate NFS CSI RBAC manifest
Because the NFS CSI driver is optional and rarely deployed, make RBAC
for this driver an optional example that is generated by the helm chart.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2022-04-12 16:57:11 -06:00
Rakshith R 34162c3dc5 csi: add nfs nodeplugin daemonset
This commit adds nfs nodeplugin daemonset.
This will allow rook to deploy nfs nodeplugin
which can mount/unmount nfs volumes.

refer:
- https://github.com/ceph/ceph-csi/blob/devel/docs/design/proposals/nfs.md
- https://github.com/kubernetes-csi/csi-driver-nfs

Signed-off-by: Rakshith R <rar@redhat.com>
2022-04-12 11:07:38 +05:30
subhamkrai f6f03d272b core: start admission controller without any script
finally, admission controller will be enabled default
without any script/manual step. But it still requires cert-manager
to be installed which I believe is already installed in clusters.

**Note**
Code doesn't return error it just logs the error since
we don't want to stop reconciling if the admission controller fails.
We can work on this once the admission controller is stable.

Signed-off-by: subhamkrai <srai@redhat.com>
2022-04-11 19:44:54 +05:30
Blaine Gardner 0e08aeedac monitoring: remove prometheusrules kind from RBAC
Minor update to remove prometheus rules from RBAC, which is no longer
managed by Rook.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2022-04-05 12:38:35 -06:00
Shinya Hayashi c82099c107 helm: fix csiAddons enabled flag
We should use csiAddons.enabled to check whether csiAddons is used.

Signed-off-by: Shinya Hayashi <shinya-hayashi@cybozu.co.jp>
2022-02-17 00:27:39 +00:00
yati1998 c559bbdf6b csi: restrict csiaddons to use only 1 port
This commit restrict csiaddons to open only 1 port
as per the requirement which is required for security.

Fixes: #9604

Signed-off-by: yati1998 <ypadia@redhat.com>
2022-01-19 12:07:46 +05:30
yati1998 2b92dc812c csi: implement csi-addons sidecar
This commit implements the csi-addons sidecar.

Signed-off-by: yati1998 <ypadia@redhat.com>
2022-01-18 21:52:01 +05:30
Sébastien Han 8512b6a0e1 build: set LC_ALL on the make target
Simply applying `LC_ALL=C` will work for the current shell only. For all
the shells and sub-shell to use it, we must set it globally.
Making it the first thing in the Make entrypoint now so the CRD and RBAC
sorting works on all the platforms.

Signed-off-by: Sébastien Han <seb@redhat.com>
2022-01-18 12:01:04 +01:00
Blaine Gardner 6f4a23694d build: make crd/rbac generation order deterministic
Linux doesn't guarantee file ordering, so when dealing with files in
order, we can use 'sort' to make sure the order is deterministic. For
yq's usage of files, we need to keep file names in an intermediate
variable, and this should be an array to support file paths with spaces.
'readarray' is not available on MacOS's built-in bash, so a longer
'while read' loop is needed for the array creation.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2022-01-13 09:24:07 -07:00
Yuichiro Ueno bae6351a39 osd: add CAP_MKNOD to PSP
This commit adds CAP_MKNOD to PodSecurityPolicy to allow OSD-prepare job
creating pods under PSP-enabled Kubernetes cluster.

Signed-off-by: Yuichiro Ueno <ueno@preferred.jp>
2021-12-16 12:36:27 +09:00
Blaine Gardner bcc7d3e541 build: generate common.yaml from helm charts
Generate deploy/examples/common.yaml from Helm charts. There were still
a few differences between common.yaml and the Helm charts. Where there
were differences we assume common.yaml was the most up-to-date.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2021-12-07 13:54:27 -07:00
Travis Nielsen c953032d09 Merge pull request #8678 from parth-gr/Recommended-labels
core: create rook resources with k8s recommended labels
2021-12-07 11:53:33 -07:00
Travis Nielsen 399eb17e84 Merge pull request #9332 from parth-gr/rbac-sort
build: updated locale for rbac generation
2021-12-07 09:24:02 -07:00
parth-grandBlaine Gardner blaine.gardner@redhat.com 3647dec90f build: updated locale for rbac generation
Currently there was an issue related to sorting
files in Rbac generation in different platforms
Updated the locale to LC_ALL=C so rbac generation
can done correctly

Closes: https://github.com/rook/rook/issues/9331
Co-authored-by: Blaine Gardner blaine.gardner@redhat.com
Signed-off-by: parth-gr <paarora@redhat.com>
2021-12-07 20:32:27 +05:30
parth-gr 0a86d26b2e core: create rook resources with k8s recommended labels
Adding Recommended Labels on the resources created by rook
    and using Recommended Labels in the helm chart,
    for better visuals and management of k8s object

Closes: https://github.com/rook/rook/issues/8400
Signed-off-by: parth-gr <paarora@redhat.com>
2021-12-07 18:16:44 +05:30
Sébastien Han e0fd2a7cb3 build: check for the existence of helm
Let's fail nicely if the helm command is not available.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-12-07 09:52:31 +01:00
Blaine Gardner aba199fc4c docs: sort common.yaml example
In anticipation of generating common.yaml from the Helm charts, sort
common.yaml using the same script used to sort the output from Helm
charts.

This was done using the flow here:
```
cat build/rbac/common.yaml.header > new-common.yaml
cat deploy/examples/common.yaml | build/rbac/keep-rbac-yaml.sh >> new-common.yaml
mv new-common.yaml deploy/examples/common.yaml
```

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2021-12-02 14:24:14 -07:00
Blaine Gardner 2c4b66957c build: generate CSV from helm charts
In order to generate common.yaml from Helm charts, we have to have a
different way of generating CSV than from meta-comments in common.yaml.
This implementation changes what appears in the CSV's RBAC somewhat, but
these changes could be considered bugs fixed by using the new Helm
generation method.
- a few PSP related resources are removed from CSV
- resources related to 'rook-ceph-purge-osd' Job are added to CSV
- ClusterRoleBinding 'rook-ceph-object-bucket' is added to CSV

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2021-11-30 08:35:54 -07:00
Blaine Gardner 113e2f849d build: use yq for RBAC yaml parsing
Use yq instead of Python for parsing RBAC from the Helm chart. We need
to use yq v4.14.1 or higher to fix yq's handling of the yaml header
markers ('---'). Update the Makefile's yq version to v4, which also
requires updating the script to update the CRDs. This was quite easy.

It is very difficult, however, to change the version of yq used by the
CSV generating/parsing scripts, which already used their own yq
download. Continue using yq v3 for this.

In order to make sure the scripts are using the right version of yq, add
basic validation to them to verify they are running v3 or v4 as required
for their operation.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2021-11-30 08:08:08 -07:00
Sébastien Han c890710b63 core: change directory layout
As per discussion, proposing a new layout for the charts/yaml/olm files.

./deploy
├── charts
│   ├── rook-ceph
│   │   └── templates
│   └── rook-ceph-cluster
│       └── templates
├── examples
│   ├── csi
│   │   ├── cephfs
│   │   └── rbd
│   ├── flex
│   ├── monitoring
│   ├── pre-k8s-1.16
└── olm
    └── assemble

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-11-30 09:12:53 +01:00
PixelJonas 8733bf6272 ceph: use normal quotation marks for comment
replaces all occurences of lduo/rduo quotation marks to make
sure that using the snippets in a k8s manifest will work

This fixes an issue with ArgoCD not being able
to apply `common.yaml` because of an encoding issue

Signed-off-by: PixelJonas <jonas@janz.digital>
2021-10-20 10:09:22 +02:00
Blaine Gardner d9146f6f95 helm: create shared library chart
Create a Helm library chart to share content between the Operator Helm
chart (rook-ceph) and the CephCluster (etc.) Helm chart
(rook-ceph-cluster).

This will ensure that when resources related to the CephCluster change,
notably RBAC resources, they will change for both charts.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2021-10-18 12:33:47 -06:00
Blaine Gardner 507dfe11f6 helm: remove chart content not in common.yaml
Assume common.yaml is the right source of truth, and remove major
content from helm charts that does not exist in common.yaml.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2021-10-06 09:18:02 +00:00
Blaine Gardner e2ba16f710 build: start tracking rbac generated from helm chart
This is a starting step to be able to generate common.yaml from Helm
charts. For right now, we merely want to be able to determine when the
rendered output of the Helm chart changes.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2021-09-30 12:20:24 -06:00