Commit Graph
247 Commits
Author SHA1 Message Date
parth-gr 4f43f2d93e csi: make create and get process separate for csi users
Currently if we run external-script and user already exit,
it fails to create/run same user again if the caps are upgraded,
so we need to check first if user is already present.
And for upgrading user we can do upgrade after this
PR: https://github.com/rook/rook/pull/9609 will get merged.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2048458

Signed-off-by: parth-gr <paarora@redhat.com>
2022-02-04 20:08:31 +05:30
Sébastien Han d99290ee81 ci: fix daily encryption ibm kms test
The secret is called secrets.IBM_INSTANCE_ID instead of
secrets.IBM_KP_INSTANCE_ID. Now the daily test should pass.

Signed-off-by: Sébastien Han <seb@redhat.com>
2022-01-24 09:25:57 +01:00
Sébastien Han 802a86ccd5 ci: fix encryption test condition
For the "if" to work we need to bring the env in the step with the "env"
keyword. Otherwise, the env is never imported and the condition is
always false.

Signed-off-by: Sébastien Han <seb@redhat.com>
2022-01-21 10:23:21 +01:00
Sébastien Han 7cc6e23a0b osd: rename a few configuration flags
For better consistency with IBM_KP_SERVICE_API_KEY and use
"ibmkeyprotect" as a provider name for more clarity.

Signed-off-by: Sébastien Han <seb@redhat.com>
2022-01-20 16:01:26 +01:00
parth-gr 7e851f15c6 csi: add osd blocklist capabilities to the external cephcluster
The CSI users created by the external script(both for rbd and cephfs)
need the blocklist capability so the CSI pods can execute the
`osd blocklist` commands for metro DR
update the mon caps of csi users with `profile simple-rados-client-with-blocklist`
so they have privileges to run osd blocklist cmds

Closes: https://issues.redhat.com/browse/RHSTOR-2451

Signed-off-by: parth-gr <paarora@redhat.com>
2022-01-18 18:01:01 +05:30
Sébastien Han f014724288 ci: skip encryption test if env is not set
If the secret is not present in the run then let's skip it.

Signed-off-by: Sébastien Han <seb@redhat.com>
2022-01-17 15:50:40 +01:00
Sébastien Han cf5f68f378 Merge pull request #9545 from rook/kms-hpcs
osd: add ibm key protect kms
2022-01-13 18:11:15 +01:00
Sébastien Han a7acf490b6 osd: add ibm key protect kms
The cluster-wide encryption feature now has a new supported key
management system: IBM Key protect. More information about the backend
can be found in Rook documentation under the

Today's implementation stores OSD encryption keys has "Standard" keys.

Signed-off-by: Sébastien Han <seb@redhat.com>
2022-01-13 16:02:10 +01:00
Travis Nielsen 8fb758fee9 test: implement helm upgrade integration test
The helm tests were previously only for new installs, and did
not have an upgrade path. Now the upgrade path is tested
to give confidence in the helm upgrades.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2022-01-12 07:19:42 -07:00
Sébastien Han 511c250336 Merge pull request #9411 from parth-gr/external-cluster-permission-security
security: update auth permissions for external cluster
2022-01-10 16:12:42 +01:00
parth-gr 4a3088c580 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>
2022-01-07 20:27:05 +05:30
Travis Nielsen 7167de0601 build: replace local build tag with regex
The local build tag replacement in the CI should work the same
whether in master or release branches, so we use a regex to
match any rook/ceph tag to be renamed to the local-build tag.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2022-01-06 10:37:39 -07:00
parth-gr 6ed7423bac 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>
2022-01-05 13:51:41 +05:30
Blaine Gardner bb0d0d39f6 Merge pull request #9384 from leseb/fix-7036
subvolumegroup: add new crd
2021-12-21 10:24:23 -07:00
Sébastien Han 6e9eb33782 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>
2021-12-21 16:28:38 +01:00
Sébastien Han 05775b068d osd: handle removal of encrypted osd deployment
This is handling a tricky scenario where the OSD deployment is manually
removed and the OSD never reconvers. This is unlikely to happen, but
still OSD should be able to run after that action. Essentially after a
manual deletion, we need to run the prepare job again to re-hydrate the
OSD information so that the OSD deployment can be deployed.
On encryption, it is a little bit tricky since ceph-volume list again
the main block won't return anything, so we need to target the encrypted
block to list.
There is another case this PR does not handle, which is the removal of
the OSD deployment and then the node is restarted. This means that the
encrypted container is not opened anymore. However, opening it requires
more work like writing the key on the filesystem (if not coming from the
Kubernete secret, eg,. KMS vault) and then run luksOpen. This is an
extreme corner case probably not worth worrying about for now.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-12-21 10:51:09 +01:00
subhamkrai c891ddb57d 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>
2021-12-16 13:05:39 +05:30
Travis Nielsen 60cc67fed4 test: only create replicated pools in ci
Creating an EC pool is causing the CI to hang when the EC
pool is initialized since there aren't enough OSDs to
satisfy the EC parameters.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-12-15 15:32:03 -07:00
Sébastien Han ca7d7dd14f Merge pull request #9276 from subhamkrai/external-rbd-ec
pool: add rbd ec pool support in external cluster
2021-12-14 09:51:02 +01:00
subhamkrai 22865815cf 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>
2021-12-14 12:13:22 +05:30
Travis Nielsen ec7039e7f8 build: add k8s 1.23 to the ci tests
With the release of k8s 1.23 we update the CI to run PRs
against K8s 1.16 and K8s 1.23, the oldest and latest
releases that are supported. The master branch will
run against the latest v1.16, 1.18, 1.21, and 1.23.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-12-13 23:33:49 -07:00
parth-gr f7082c9efa mds: removing fs_name arg from daemon status cmd
If cephVersion>= 16.2.7, we run
ceph fs snapshot mirror daemon status
otherwise we run
ceph fs snapshot mirror daemon status <fs_name>

Updating the cmd so both the ceph version can run successfully

Closes: https://github.com/rook/rook/issues/8458
Signed-off-by: parth-gr <paarora@redhat.com>
2021-12-09 17:40:28 +05:30
Sébastien Han 0a918814ea 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>
2021-12-08 17:24:56 +01:00
Blaine Gardner 243a47bfc4 build: do not use cross build container for ceph
Do not use the cross build container when building, publishing, and
promoting rook/ceph images. It is no longer needed, and its complexity
can add flakiness.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2021-12-03 11:06:21 -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
Sébastien Han 7a223adde4 Merge pull request #9230 from leseb/osd-rm-check
osd: check if osd is safe-to-destroy before removal
2021-11-25 10:55:34 +01:00
Sébastien Han ad2c3c2ae6 Merge pull request #8931 from BlaineEXE/test-rgw-multisite-in-nightly-tests
test: test rgw multisite nightly
2021-11-25 10:25:57 +01:00
Sébastien Han 7402c2cce6 osd: check if osd is ok-to-stop before removal
If multiple removal jobs are fired in parallel, there is a risk of
losing data since we will forcefully remove the OSD. It's also simply
true if a single OSD is not safe to destroy, there is also a risk of
data loss.

So now, we check if the OSD is safe-to-destroy first and then proceed.
The code waits forever and retries every minute unless the
--force-osd-removal flag is passed.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-11-25 10:21:32 +01:00
Travis Nielsen ba54567e8f Merge pull request #9176 from TomHellier/9174-ingress-support-more-k8s-versions
helm: Allow further configurability of the ingress version
2021-11-23 13:47:33 -07:00
Tom Hellier ba44602477 helm: allow further configurability of ingress version
The ingress api version changed when it went to v1, and this has caused some upheaval
throughout the kubernetes ecosystem. This commit uses a common method of deciding which
ingress api to use, and allows the optional override of the kubernetes version
presented to helm using the helm build-in capabilities.
also add an ingress into the helm integration tests so any regressions to how ingresses
are handled in the future are caught easier.

Closes rook#9174

Signed-off-by: Tom Hellier <me@tomhellier.com>
2021-11-22 10:03:02 +00:00
Blaine Gardner e80368674d test: run RGW multisite test in nightly job
In the nightly job, run the test with the latest Ceph version so we can
detect if there are RGW changes in Ceph that might break multisite. Use
a reusable GitHub action workflow to duplicate as little code as
possible.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2021-11-19 09:56:41 -07:00
Jiffin Tony Thottan aba50d3ca9 object: add support in RGW to communicate vault with TLS
From ceph v16.2.6 onwards the vault TLS suppport in RGW was added,
include similar changes for RGW.

Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2021-11-17 10:19:28 +05:30
subhamkrai 99358688d8 ci: use github composition to reduce duplication
Using Github Compositoin to reduce the yaml duplication.
https://github.blog/changelog/2021-08-25-github-actions-reduce-duplication-with-action-composition/

Closes: https://github.com/rook/rook/issues/8637
Signed-off-by: subhamkrai <srai@redhat.com>
2021-11-09 16:41:55 +05:30
Sébastien Han 8cfaedcbf6 Merge pull request #9127 from leseb/fix-9090
ci: wait for kubeproxy to be ready
2021-11-08 18:16:57 +01:00
Sébastien Han 0e26176b54 ci: wait for kubeproxy to be ready
When requesting issuer, we run a local kubectl proxy command which spawn
a proxy server. However, we must wait for the proxy to be ready before
we actually start making requests to it.
Now the CI waits up to 10sec to retrieve the issuer.

Closes: https://github.com/rook/rook/issues/9090
Signed-off-by: Sébastien Han <seb@redhat.com>
2021-11-08 17:45:53 +01:00
Satoru Takeuchi cd4862a7f7 Merge pull request #9123 from leseb/fix-arm64
ci: fix arm64 job
2021-11-08 20:19:11 +09:00
Sébastien Han d081a3e764 ci: fix arm64 job
They are no arm64 packages for ceph-nfs so we must skip this validation
for the nightly arm64 CI job.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-11-08 09:18:23 +01:00
Sébastien Han d06a6f93a5 core: run operator with rook user
The rook operator as well as the toolbox pod run with the "rook" user
with UID 2016. The UID was chosen based on the year of the initial
commit in the rook/rook repository.
No more root user running.

Closes: https://github.com/rook/rook/issues/8734
Signed-off-by: Sébastien Han <seb@redhat.com>
2021-11-05 17:22:04 +01:00
Blaine Gardner cd480df581 Merge pull request #9112 from BlaineEXE/allow-push-image-build-on-tag-again
Revert "ci: trigger push build action after tag creation"
2021-11-04 14:48:36 -06:00
Blaine Gardner 30e02c1063 Revert "ci: trigger push build action after tag creation"
This reverts commit c53304c3b4.

After experimenting with this release, we have found that the
`workflow_run` action source doesn't work for branches. The
documentation was updated with this PR and has more detail.
https://github.com/github/docs/pull/531

For now, we will revert back to using on.push.tags = ["v*"]

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2021-11-04 14:40:37 -06:00
Travis Nielsen b3b8172e13 Merge pull request #9056 from leseb/fix-8851
docs: simplify dev guide
2021-11-03 12:34:41 -06:00
Sébastien Han 85f8fdec5a docs: simplify dev guide
We removed the obsolete `minikube.sh` script for a cleaner dev
procedure.

Closes: https://github.com/rook/rook/issues/8851
Signed-off-by: Sébastien Han <seb@redhat.com>
2021-11-03 18:56:33 +01:00
Yuzuki Mimura 536b59ef0f rgw: change the way to livenessProbe and introduce readinessProbe
rgw doesn't respond `livenessProbe` if the number of connection reaches its
limit (by default, 1000). Then rgw is out of service but still live.
Hense the current `livenessProbe` logic is suitiable for `readinessProbe`.
`tcpSocket` is enough for `livenessProbe`.

Closes: #8407

Signed-off-by: Yuzuki Mimura <yuzuki725.m@gmail.com>
Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2021-10-29 15:07:29 +00:00
Satoru Takeuchi 79571d860a test: remove an unnecessary check in rgw-multisite-testing
The deployment of the OSD is already confirmed at the end of
`deploy first cluster rook' step.

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2021-10-29 13:52:35 +00:00
Sébastien Han f2cb792e9f rgw: add support for updating user caps
User's capabilities can now be updated from the admin ops API.

Closes: https://github.com/rook/rook/issues/8683
Signed-off-by: Sébastien Han <seb@redhat.com>
2021-10-28 14:17:13 +02:00
Sébastien Han 522fa7a782 ci: wait longer on fs mirroring
It looks like the CI needs more time.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-10-26 11:01:11 +02:00
Sébastien Han d8e9885fd6 ci: only run snyk on merges and not on PRs
We cannot use the secret when PRs are pushed from forks so let's run the
security scan only after PRs are merged.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-10-26 10:55:43 +02:00
subhamkrai 0ebbb78373 ci: update snyk token
Update snyk token, it was pointing to wrong token.

Signed-off-by: subhamkrai <srai@redhat.com>
2021-10-26 08:51:51 +05:30
Sébastien Han 3b5bbf28d5 Merge pull request #9003 from leseb/vault-k8s-auth
osd: add support for k8s with vault kms
2021-10-25 18:02:48 +02:00