Commit Graph
44 Commits
Author SHA1 Message Date
parth-gr 9e18ae5cfa security: make cephfs_filesystem_name flag optional
cephfs_filesystem_name flag isn't mandatory if restricted_auth_permission
is on.

Signed-off-by: parth-gr <paarora@redhat.com>
(cherry picked from commit 4a3088c580)
2022-01-10 15:13:40 +00:00
parth-gr a6e56a640f security: update auth permissions for external cluster
Added a clusterName, poolName , filesystemName, radosNamespace
as a suffix on ceph auth principals for external cluster so
every csi authentication would be unique if
restricted_auth_permission flag is specified.

Closes: https://github.com/rook/rook/issues/9192
Signed-off-by: parth-gr <paarora@redhat.com>
(cherry picked from commit 6ed7423bac)
2022-01-10 15:13:39 +00:00
Blaine Gardner 0fef8b043f core: limit use of wildcards in cluster-scoped rbac
Rook needs to be able to watch all `ceph.rook.io` resources to reconcile
them; however, it does not need blanket verb privileges. Reduce the
privileges as much as possible.

Ideally, Rook would only have update permissions to status and
finalizers of resources; however, finalizers are not a full-fledged
subresource at this time, and "update" permissions must be maintained
for `ceph.rook.io` resources.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
(cherry picked from commit 684fe30126)
2022-01-06 20:14:13 +00:00
Travis Nielsen ecb91628e2 build: update release version to v1.8.2
With the patch release the examples and docs are updated to v1.8.2

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2022-01-06 10:15:13 -07:00
Blaine Gardner 86c2301cfc core: rgw: allow specifying daemon startup probes
Allow specifying daemon startup probes where we also allow configuring
liveness probes. Startup probes allow Rook to tolerate when Ceph daemons
occasionally take a long time to start up while not also making
Kubernetes liveness probes slower to detect runtime failures of daemons.

Startup probes are beta in Kubernetes 1.18, so we should not enable
probes by default for earlier Kubernetes versions.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
(cherry picked from commit c07d89d9ea)
2022-01-04 18:04:06 +00:00
Sébastien Han 7c5d0ed3ee build: use the same csv name for all platforms
Recently with the directory renaming to "deploy/olm" the CSV name
changed from "ceph" to "olm". Now we are using the same "rook-ceph" name
regardless of the platform.

Signed-off-by: Sébastien Han <seb@redhat.com>
(cherry picked from commit 7cf9285501)
2022-01-04 16:41:13 +00:00
Sébastien Han 21c6a89541 subvolumegroup: add new crd
This introduces a new CRD to add the ability to create subvolumegroup
for a given ceph filesystem volume. Typically the name of the volume is
the name of the filesystem created by rook.

Closes: https://github.com/rook/rook/issues/7036
Signed-off-by: Sébastien Han <seb@redhat.com>
(cherry picked from commit 6e9eb33782)
2021-12-21 17:24:36 +00:00
Daniel Ruiz Capilla be085276db rgw: fix blockOwnerDeletion error
This restores the missing permissions to allow the object controller to
update the finalizers section in the spec. See https://sdk.operatorframework.io/docs/faqs/

Signed-off-by: Daniel Ruiz Capilla <crd1985@gmail.com>
(cherry picked from commit 66cc46220f)
2021-12-17 16:22:54 +00:00
subhamkrai 714bd30272 security: add dry run mode for external cluster script
Adding dry run mode for external cluster script.
This will add cli argument `--dry-run`. By default
`dry-run` option will be `False`
which means it will only print something like below.

```
Execute: 'ceph fs ls'
Execute: 'ceph fsid'
Execute: 'ceph quorum_status'
Execute: 'ceph auth get-or-create client.healthchecker mon allow r, allow command quorum_status,
	allow command version mgr allow command config osd allow rwx pool=default.rgw.meta, allow r pool=
	.rgw.root, allow rw pool=default.rgw.control, allow rx pool=default.rgw.log, allow x
	pool=default.rgw.buckets.index'
Execute: 'ceph mgr services'
Execute: 'ceph auth get-or-create client.csi-rbd-node mon profile rbd osd profile rbd'
Execute: 'ceph auth get-or-create client.csi-rbd-provisioner mon profile rbd mgr allow rw osd
	profile rbd'
Execute: 'ceph status'

```

Signed-off-by: subhamkrai <srai@redhat.com>
(cherry picked from commit c891ddb57d)
2021-12-17 08:46:20 +00:00
Blaine Gardner d27303a074 build: update examples and manifests for v1.8.1
Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2021-12-16 13:41:52 -07:00
Yuichiro Ueno 0d3462b163 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>
(cherry picked from commit bae6351a39)
2021-12-16 17:57:53 +00:00
Travis Nielsen d9fc61c3f2 pool: allow configuration of built-in pools with non-k8s names
The built-in pools device_health_metrics and .nfs created by ceph
need to be configured for replicas, failure domain, etc.
To support this, we allow the pool to be created as a CR.
Since K8s does not support underscores in the resource names
the operator must translate this special pool name into
the name expected by ceph.

This also sets the basis for allowing filesystem data
pools to specify the desired pool name instead of requiring
a generated name.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
(cherry picked from commit 7ee9cc9d56)
2021-12-15 23:04:34 +00:00
Blaine Gardner 5ca0e752ef helm: add optional monitoring RBAC to operator chart
An older version of the Helm chart always installed RBAC permissions for
enabling monitoring. In an effort to reduce the privileges Rook uses by
default, they were removed. We need to still include the monitoring RBAC
optionally since the change could break some users.

Co-authored-by: Mathieu Parent <mathieu.parent@insee.fr>
Co-authored-by: Blaine Gardner <blaine.gardner@redhat.com>

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
(cherry picked from commit e3be7a30ba)
2021-12-14 22:36:31 +00:00
mergify[bot] df6167d792 Merge pull request #9421 from rook/mergify/bp/release-1.8/pr-9276
pool: add rbd ec pool support in external cluster (backport #9276)
2021-12-14 21:22:08 +00:00
mergify[bot] 74bd6f0712 Merge pull request #9426 from rook/mergify/bp/release-1.8/pr-9296
file: allow to create CephFS dataPools with predefined names (backport #9296)
2021-12-14 18:29:49 +00:00
Denis Egorenko 07fb393fca file: allow to create CephFS data pools with predefined names
Add an ability to create data pools for CephFS with predefined
names.

Related-Issue: rook#9295
Signed-off-by: Denis Egorenko <degorenko@mirantis.com>
(cherry picked from commit 3ff681e81d)
2021-12-14 18:05:19 +00:00
parth-gr 2a891a8eef build: update the securityContext of direct mount container
update securityContext to runAsUser: 0
so container can run as a root user

Signed-off-by: parth-gr <paarora@redhat.com>
(cherry picked from commit bc355c695e)
2021-12-14 10:57:50 -07:00
parth-gr dbe0346294 build: updating tini init command in direct mount toolbox
the tini have been removed but was still present at direct mount
used the bin/bash shell in place of tini

Closes: https://github.com/rook/rook/issues/9382
Signed-off-by: parth-gr <paarora@redhat.com>
(cherry picked from commit bd3e558c24)

# Conflicts:
#	deploy/examples/direct-mount.yaml
2021-12-14 17:54:44 +00:00
subhamkrai 881c0b6db3 pool: update the failure domain of pool-ec file to host
Updating the failure domain of pool-ec file from
osd to host.

Signed-off-by: subhamkrai <srai@redhat.com>
(cherry picked from commit fc88e4ff8e)
2021-12-14 08:51:18 +00:00
subhamkrai 5fa5a01c9f pool: add rbd ec pool support in external cluster
Adding cli agrument `--rbd-metadata-ec-pool-name` to read
rbd ec pool name to support ec pool in external cluster
and also updating the json blob.

Signed-off-by: subhamkrai <srai@redhat.com>
(cherry picked from commit 22865815cf)
2021-12-14 08:51:18 +00:00
Lennart Hagemann 7ea4e1dc45 security: use correct osd tags for restricted caps
The create-external-cluster-resources.py with
--create-external-cluster-resources set to true
sets a wrong osd application tag. It should use
the fs name and not the fs pools.

Closes: https://github.com/rook/rook/issues/9227
Signed-off-by: Lennart Hagemann <lennart.hagemann@continum.net>
(cherry picked from commit 7507790375)
2021-12-13 14:44:57 +00:00
Travis Nielsen d757c6bf13 build: update the release version to v1.8.0
The minor release v1.8.0 is ready to go! This updates the
example manifests and documents to point to the latest
release.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-12-09 12:52:49 -07:00
Omar Pakker fbe102d5ef helm: rook-ceph chart: Set up webhook cert volume
The 1.8 (beta) relies on a volume when using the admission controller,
which is missing from the Helm chart.
This change sets up the volume so the operators starts properly
when set up to run the admission controller.

Closes: https://github.com/rook/rook/issues/9349
Signed-off-by: Omar Pakker <Omar007@users.noreply.github.com>
(cherry picked from commit 5841077549)
2021-12-09 13:41:11 +00:00
Blaine Gardner bbcc1f2a5f nfs: make rados.namespace optional
Fix the CephNFS spec.rados API specifiation to be clear that spec.rados
is optional for all Ceph v16 versions, including that
spec.rados.namespace is optional.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
(cherry picked from commit 0bbab6dfc9)
2021-12-09 00:00:24 +00:00
Blaine Gardner 400e39e994 nfs: remove poolConfig
Remove the poolConfig in CephNFS to prevent different CephNFS CRs from
contending to change the replication spec of the default NFS pool.

Resolves #9355

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
(cherry picked from commit aaecc93315)
2021-12-08 22:35:47 +00:00
mergify[bot] 3ceaaaaff0 Merge pull request #9352 from rook/mergify/bp/release-1.8/pr-9343
core: bump to ceph 16.2.7 (backport #9343)
2021-12-08 17:31:44 +00:00
Sébastien Han 87cca6f63c core: bump to ceph 16.2.7
ceph 16.2.7 is out so let's use it in our manifests.

Signed-off-by: Sébastien Han <seb@redhat.com>
(cherry picked from commit 0a918814ea)
2021-12-08 17:04:20 +00:00
Blaine Gardner 1894d9afd7 docs: update NFS docs
NFS docs need to be updated to reflect changes between Octopus and
Pacific, how users are affected, how NFS is configured differently
between the Ceph versions, and how to upgrade from one Ceph version to
the other.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
(cherry picked from commit e98959cce0)
2021-12-08 17:01:10 +00:00
Sébastien Han 5d39b55d8e Merge pull request #9338 from rook/mergify/bp/release-1.8/pr-9316
build: generate common.yaml from helm charts (backport #9316)
2021-12-08 11:56:36 +01:00
subhamkrai 81df284a6d mds: create EC pool as secondary pool
When creating EC fs, create replicated pool as primary
pool and ec pool as secondary pool, creating ec pool
as primary is not encouraged and it will lead to failure.

Also, changing the pool name in storageclass-ec file.

Closes: https://github.com/rook/rook/issues/8210
Signed-off-by: subhamkrai <srai@redhat.com>
(cherry picked from commit 5bb29f1a21)
2021-12-07 22:47:23 +00:00
Blaine Gardner 757960ba28 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>
(cherry picked from commit bcc7d3e541)
2021-12-07 22:07:09 +00:00
parth-gr f8a7c5bcb4 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>
(cherry picked from commit 0a86d26b2e)
2021-12-07 18:54:28 +00:00
Boris Ranto dfe97b3d2f build: run mv outside the OLM_CATALOG_DIR
The command needs to be run outside the OLM_CATALOG_DIR as it already
contains that directory in its paths.

Signed-off-by: Boris Ranto <branto@redhat.com>
(cherry picked from commit 4cb8bb3bec)
2021-12-06 15:53:12 -07:00
Blaine Gardner ee02199292 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-03 13:45:29 -07:00
Blaine Gardner 863e830e8f 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>
(cherry picked from commit 2c4b66957c)
2021-12-03 16:40:20 +00:00
Tom Hellier ca32fd16a8 helm: use a more explicit value for ingress
The networking.k8s.io/v1 api defines the backend differently
to networking.k8s.io/v1beta1 and extensions/v1beta1

Signed-off-by: Tom Hellier <me@tomhellier.com>
(cherry picked from commit 2ca93e547c)
2021-12-02 21:32:07 +00:00
Travis Nielsen 7b9b30a7d9 build: set release version to v1.8.0-beta.0
For the new 1.8 branch we create the new v1.8.0-beta.0 manifests
and doc updates.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-12-01 15:23:28 -07:00
Travis Nielsen baa67c8d5a Merge pull request #9287 from TomHellier/9286-add-mount-options-to-helm-chart
helm: addition of mountOptions into storage class configuration
2021-12-01 10:19:35 -07:00
Sébastien Han 70fab7c042 Merge pull request #9288 from leseb/add-missing-crds
build: add missing topic and notification crd to csv
2021-12-01 18:08:21 +01:00
Sébastien Han b4a8b01c0e build: add missing topic and notification crd to csv
Add the missing CRDs as well as a check to prevent missing CRDs from the
CSV file.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-12-01 16:48:42 +01:00
Tom Hellier caa2c8323b helm: addition of mountOptions into storage class configuration
It should be possible to configure the storage classs mount options, this follows
the helm code used by the ceph-csi project for their ceph-csi-rbd and ceph-csi-cephfs
helm charts.

Signed-off-by: Tom Hellier <me@tomhellier.com>
2021-12-01 10:50:42 +00:00
Humble Chirammal e5f5d9be9f csi: mount host's /etc/selinux in node plugins
This commit introduces a new configuration option for
ceph csi driver to enable hostpath mounting of /etc/selinux
directory from the cluster node where csi plugin pods are
running, which inturn help the csi driver to specify
selinux-related mount options like context.

Ref# https://github.com/ceph/ceph-csi/issues/2295

The default value for this configuration is true and if cluster
nodes are running without selinux enabled, an admin can deploy
csi pods by specifying this option to `false` which skip the
host path mounting for the csi pods.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2021-12-01 11:13:26 +05:30
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