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

roachprod: support --secure flag for start-tenant #82248

Merged
merged 1 commit into from
Jun 25, 2022

Conversation

stevendanna
Copy link
Collaborator

The in-development tenant streaming features require a secure tenant
to test them properly.

This change adds support for the --secure flag when starting a
tenant. When passed, we use the host cluster to generate tenant-client
certificates and distribute them to the tenant cluster, along with the
CA and previously created client certificates.

For simplicity, we've stuck with using a single CA for all certificate
creation.

Release note: None

@stevendanna stevendanna requested a review from a team as a code owner June 1, 2022 10:25
@stevendanna stevendanna requested review from otan and removed request for a team June 1, 2022 10:25
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@rimadeodhar rimadeodhar left a comment

Choose a reason for hiding this comment

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

Reviewed 4 of 4 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @otan and @stevendanna)


pkg/roachprod/install/cluster_synced.go line 1124 at r2 (raw file):

mkdir -p tenant-certs/certs
cp certs/ca.crt tenant-certs/certs/
cp certs/client.* tenant-certs/certs/

This will not work as expected with the new incoming code around tenant scoped certificates i.e. after this PR - #79065 merges.
Instead of copying the client certificates as is, you will need to recreate these certificates by adding a tenant scope with the specific tenant IDs. The CLI changes to add tenant scopes have already been merged so you should be able to update your PR to add a tenant scope along the lines of what is already being done for roachtests:

if v.AtLeast(version.MustParse("v22.2.0")) {
.

@stevendanna stevendanna force-pushed the start-tenant-secure branch from f50a04a to 64c31fb Compare June 3, 2022 20:45
@otan otan removed their request for review June 14, 2022 11:48
The in-development tenant streaming features require a secure tenant
to test them properly.

This change adds support for the --secure flag when starting a
tenant. When passed, we use the host cluster to generate tenant-client
certificates and distribute them to the tenant cluster, along with the
CA and previously created client certificates.

For simplicity, we've stuck with using a single CA for all certificate
creation.

Release note: None
@stevendanna stevendanna force-pushed the start-tenant-secure branch from 64c31fb to 31ccbc5 Compare June 15, 2022 12:46
@stevendanna
Copy link
Collaborator Author

@rimadeodhar Thanks, updated with the version check. PTAL.

@knz knz requested review from a team and srosenberg and removed request for a team June 16, 2022 14:04
Copy link
Contributor

@knz knz left a comment

Choose a reason for hiding this comment

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

:lgtm: but also let's get a look from test-eng.

Reviewed 2 of 2 files at r3, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @srosenberg and @stevendanna)

Copy link
Collaborator

@rimadeodhar rimadeodhar left a comment

Choose a reason for hiding this comment

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

The certs code :lgtm:

Reviewed all commit messages.
Reviewable status: :shipit: complete! 2 of 0 LGTMs obtained (waiting on @srosenberg)

@stevendanna
Copy link
Collaborator Author

bors r+

@craig
Copy link
Contributor

craig bot commented Jun 25, 2022

Build succeeded:

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.

4 participants