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

ceph: add support in RGW to communicate vault with TLS #8579

Merged
merged 1 commit into from Nov 18, 2021

Conversation

thotz
Copy link
Contributor

@thotz thotz commented Aug 23, 2021

Description of your changes:

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

Which issue is resolved by this Pull Request:
Resolves #

Checklist:

  • Commit Message Formatting: Commit titles and messages follow guidelines in the developer guide.
  • Skip Tests for Docs: Add the flag for skipping the build if this is only a documentation change. See here for the flag.
  • Skip Unrelated Tests: Add a flag to run tests for a specific storage provider. See test options.
  • Reviewed the developer guide on Submitting a Pull Request
  • Documentation has been updated, if necessary.
  • Unit tests have been added, if necessary.
  • Integration tests have been added, if necessary.
  • Pending release notes updated with breaking and/or notable changes, if necessary.
  • Upgrade from previous release is tested and upgrade user guide is updated, if necessary.
  • Code generation (make codegen) has been run to update object specifications, if necessary.

@mergify mergify bot added the ceph main ceph tag label Aug 23, 2021
pkg/daemon/ceph/osd/kms/volumes.go Outdated Show resolved Hide resolved
pkg/daemon/ceph/osd/kms/volumes.go Outdated Show resolved Hide resolved
pkg/daemon/ceph/osd/kms/volumes.go Outdated Show resolved Hide resolved
tests/scripts/deploy-validate-vault.sh Outdated Show resolved Hide resolved
@mergify
Copy link

mergify bot commented Aug 26, 2021

This pull request has merge conflicts that must be resolved before it can be merged. @thotz please rebase it. https://rook.io/docs/rook/master/development-flow.html#updating-your-fork

@thotz thotz force-pushed the vaultsslsupport branch 3 times, most recently from 55e700c to ecdcf7b Compare August 31, 2021 05:44
.github/workflows/canary-integration-test.yml Outdated Show resolved Hide resolved
pkg/daemon/ceph/osd/kms/volumes.go Outdated Show resolved Hide resolved
@thotz
Copy link
Contributor Author

thotz commented Aug 31, 2021

@leseb: anyidea what is failing here, locally when I tried steps in github actions job it is working fine. Is OSD not coming up os the issue or toolpods is missing I am not able to figure this out

@leseb
Copy link
Member

leseb commented Aug 31, 2021

@leseb: anyidea what is failing here, locally when I tried steps in github actions job it is working fine. Is OSD not coming up os the issue or toolpods is missing I am not able to figure this out

2021-08-31 12:51:41.509712 E | ceph-cluster-controller: failed to reconcile CephCluster "rook-ceph/rook-ceph". failed to reconcile cluster "rook-ceph": failed to configure local ceph cluster: failed to perform validation before cluster creation: failed to validate kms connection details: failed to get backend version: failed to initialize vault client: open vault-client-cert: no such file or directory

Copy link
Member

@leseb leseb left a comment

Choose a reason for hiding this comment

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

holding until CI job is fixed

@thotz
Copy link
Contributor Author

thotz commented Aug 31, 2021

@leseb: anyidea what is failing here, locally when I tried steps in github actions job it is working fine. Is OSD not coming up os the issue or toolpods is missing I am not able to figure this out

2021-08-31 12:51:41.509712 E | ceph-cluster-controller: failed to reconcile CephCluster "rook-ceph/rook-ceph". failed to reconcile cluster "rook-ceph": failed to configure local ceph cluster: failed to perform validation before cluster creation: failed to validate kms connection details: failed to get backend version: failed to initialize vault client: open vault-client-cert: no such file or directory

@leseb : from code reading even though tlsConfig.Insecure is set ConfigureTLS() , setting VAULT_TLS_SECRET may creating the issue here. If understand correctly tlsConfig.other options expects path we but are providing secret names. IMO NewClient() is not ignoring this values even though tlsConfig.Insecure is set

@thotz thotz force-pushed the vaultsslsupport branch 3 times, most recently from fd2932d to 6c8c8a9 Compare August 31, 2021 18:21
Copy link
Member

@BlaineEXE BlaineEXE left a comment

Choose a reason for hiding this comment

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

No unit tests?

@thotz
Copy link
Contributor Author

thotz commented Sep 1, 2021

No unit tests?
@BlaineEXE I can add unit test for VaultTokenFileVolume() similar to TestTLSSecretVolumeAndMount().

Other addition can done in TestCheckRGWKMS() to validate the tls client certs passed, but similar cases are performed in TestValidateConnectionDetails() and CheckRGWKMS() calls the ValidateConnectionDetails() internally. So do I need to cover these cases?

@BlaineEXE
Copy link
Member

No unit tests?
@BlaineEXE I can add unit test for VaultTokenFileVolume() similar to TestTLSSecretVolumeAndMount().

Other addition can done in TestCheckRGWKMS() to validate the tls client certs passed, but similar cases are performed in TestValidateConnectionDetails() and CheckRGWKMS() calls the ValidateConnectionDetails() internally. So do I need to cover these cases?

Yes. All code that adds or modifies a feature should come with added or modified unit tests. Part of development is writing tests to ensure the feature works as intended and to catch corner case issues during development. We have collectively (including myself) slacked off on doing this for Rook in the past, but with as much complexity as Rook has and the importance that it works well for our downstream customers and upstream users, we can't continue to ignore that responsibility.

When I write a new feature, the unit tests I write for it always catch bugs that I make in the code. Every single time. I usually find that I spend more time working on tests than the feature itself and that writing good tests that cover all corner cases is much more difficult than implementing the feature. When I estimate the time it will take to implement a feature, I often estimate the time I think it will take to implement the feature itself, then multiply by three to estimate the time it will take me to implement the feature plus the tests (I assume tests take twice as long).

Questions that every unit test should answer and test (not all are always applicable):

  1. What if the feature is enabled?
  2. What if the feature is disabled?
  3. What if the feature is only partially enabled? (and how many ways can it be partially enabled?)
  4. What errors can be encountered when the configuration is being applied? (need test for each kind of error)
  5. Is there a slice/array involved? (test slice length=0, length=1, length=3, length=max, larger than max length)
  6. What if an input is not specified? (test for every input that can be entered incorrectly)
  7. What if an input is specified incorrectly? (test every input that can be incorrect)
  8. What if a resource we rely on doesn't exist?

I'm sure there are some questions I missed.

Copy link
Member

@travisn travisn left a comment

Choose a reason for hiding this comment

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

It's great to see all the unit and integration tests, thanks

pkg/daemon/ceph/osd/kms/volumes_test.go Outdated Show resolved Hide resolved
pkg/daemon/ceph/osd/kms/volumes_test.go Outdated Show resolved Hide resolved
pkg/daemon/ceph/osd/kms/volumes_test.go Outdated Show resolved Hide resolved
pkg/operator/ceph/object/spec.go Outdated Show resolved Hide resolved
Documentation/ceph-object-store-crd.md Show resolved Hide resolved
pkg/operator/ceph/object/spec.go Outdated Show resolved Hide resolved
pkg/operator/ceph/object/spec.go Outdated Show resolved Hide resolved
pkg/operator/ceph/object/spec.go Outdated Show resolved Hide resolved
.github/workflows/canary-integration-test.yml Outdated Show resolved Hide resolved
tests/manifests/test-object.yaml Outdated Show resolved Hide resolved
tests/manifests/test-object.yaml Outdated Show resolved Hide resolved
Copy link
Member

@BlaineEXE BlaineEXE left a comment

Choose a reason for hiding this comment

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

We should also run a version of TestPodSpecs for the RGW spec where KMS is enabled.

pkg/daemon/ceph/osd/kms/volumes.go Outdated Show resolved Hide resolved
pkg/daemon/ceph/osd/kms/volumes.go Outdated Show resolved Hide resolved
pkg/daemon/ceph/osd/kms/volumes_test.go Outdated Show resolved Hide resolved
pkg/operator/ceph/object/spec_test.go Outdated Show resolved Hide resolved
@mergify
Copy link

mergify bot commented Oct 25, 2021

This pull request has merge conflicts that must be resolved before it can be merged. @thotz please rebase it. https://rook.io/docs/rook/latest/development-flow.html#updating-your-fork

.github/workflows/canary-integration-test.yml Show resolved Hide resolved
.github/workflows/canary-integration-test.yml Outdated Show resolved Hide resolved
pkg/operator/ceph/object/spec.go Outdated Show resolved Hide resolved
tests/scripts/deploy-validate-vault.sh Outdated Show resolved Hide resolved
pkg/daemon/ceph/osd/kms/volumes.go Outdated Show resolved Hide resolved
pkg/daemon/ceph/osd/kms/volumes.go Outdated Show resolved Hide resolved
Copy link
Member

@BlaineEXE BlaineEXE left a comment

Choose a reason for hiding this comment

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

I flagged a few nit typos, given Seb already requested changes. I think this looks pretty good overall now, with some good questions from Seb.

Documentation/ceph-object-store-crd.md Outdated Show resolved Hide resolved
pkg/operator/ceph/object/spec.go Outdated Show resolved Hide resolved
pkg/operator/ceph/object/spec.go Outdated Show resolved Hide resolved
pkg/operator/ceph/object/spec.go Outdated Show resolved Hide resolved
tests/scripts/deploy-validate-vault.sh Outdated Show resolved Hide resolved
tests/scripts/deploy-validate-vault.sh Outdated Show resolved Hide resolved
tests/scripts/deploy-validate-vault.sh Outdated Show resolved Hide resolved
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>
@BlaineEXE BlaineEXE merged commit cd832e5 into rook:master Nov 18, 2021
@thotz thotz deleted the vaultsslsupport branch November 19, 2021 04:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ceph main ceph tag
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants