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

Add ctlog shards that create their own Cloud SQL instances. #370

Merged
merged 9 commits into from
Oct 13, 2022

Conversation

vaikas
Copy link
Contributor

@vaikas vaikas commented Sep 22, 2022

Signed-off-by: Ville Aikas vaikas@chainguard.dev

Summary

WIP: Need to do some testing, but wanted to share the approach early :)

Starts putting the pieces at the infra level necessary for:

In particular:

  • Add mysql creation (optionally) into the CTLog module. It's made optional since we already use that module, and we don't
    want to create a new Cloud SQL instance for the already existing one.
  • Add ctlog_shards variable to Sigstore ctlog_shards which is a list of shards. So we'd add, say 2021 into this list first to create a new separate Cloud SQL instance for the new CTLog
  • Add ctlog_mysql_instances which outputs the list of CTLog DB instances

Release Note

  • Add ability to create new CTLog shards with their own Cloud SQL instance.

Documentation

terraform/gcp/modules/ctlog/main.tf Outdated Show resolved Hide resolved
terraform/gcp/modules/ctlog/main.tf Outdated Show resolved Hide resolved
terraform/gcp/modules/ctlog/main.tf Outdated Show resolved Hide resolved
terraform/gcp/modules/ctlog/main.tf Outdated Show resolved Hide resolved
terraform/gcp/modules/ctlog/variables.tf Outdated Show resolved Hide resolved
@vaikas
Copy link
Contributor Author

vaikas commented Sep 22, 2022

Thank you so much @k4leung4
What's the best way to test these? Just run it against my own GKE project? Or are there other tests I could do?

@vaikas
Copy link
Contributor Author

vaikas commented Sep 22, 2022

Tests are failures because v0.4.8 didn't roll out correctly. @cpanato and I have been trying to sort it.

@k4leung4
Copy link
Contributor

Thank you so much @k4leung4 What's the best way to test these? Just run it against my own GKE project? Or are there other tests I could do?

yes, the best way to test/develop is to run it against your own project.
thats what most of us do.

@vaikas
Copy link
Contributor Author

vaikas commented Sep 23, 2022

I've now tested (and fixed bunch of things that terraform plan showed). terraform plan now works with these 'garbage values':

terraform plan -var ctlog_shards="[2021, 2022]" -var project_id=vaikas -var attestation_bucket=a -var dns_domain_name=a -var dns_zone_name=a -var github_repo=f -var region=us-west1 -var tuf_bucket=a -var tuf_preprod_bucket=a -var tunnel_accessor_sa=a -out /tmp/plan

and it produces a bunch of stuff. I guess my next step here is to create the sigstore stack in my project without ctlog_shards defined, and then run it again with the ctlog_shards for the new 2021 and we should be seeing just a new DB being created.

I'll do that tomorrow.

@vaikas vaikas force-pushed the new-ctlog branch 3 times, most recently from 1abed76 to 46ecc72 Compare September 23, 2022 17:14
load_balancer_ipv4 = module.network.external_ipv4_address

cluster_name = var.cluster_name
mysql_database_version = var.mysql_db_version
Copy link

Choose a reason for hiding this comment

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

Can we wire in a separate version (and tier) for ctlog? Trillian appears to have some performance problems with 8.0 and we will likely stick with 5.7 for prod so testing that in staging would be great. The tier is higher in staging because of the performance issues as well.

Copy link

Choose a reason for hiding this comment

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

Signed-off-by: Ville Aikas <vaikas@chainguard.dev>
Signed-off-by: Ville Aikas <vaikas@chainguard.dev>
serviceaccounts, services, etc.

Signed-off-by: Ville Aikas <vaikas@chainguard.dev>
Signed-off-by: Ville Aikas <vaikas@chainguard.dev>
Signed-off-by: Ville Aikas <vaikas@chainguard.dev>
Signed-off-by: Ville Aikas <vaikas@chainguard.dev>
Signed-off-by: Ville Aikas <vaikas@chainguard.dev>
Signed-off-by: Ville Aikas <vaikas@chainguard.dev>
Signed-off-by: Ville Aikas <vaikas@chainguard.dev>
@vaikas
Copy link
Contributor Author

vaikas commented Oct 11, 2022

@var-sdk care to take one more look. Things got cleaned a bunch and now when applied with a new shard here:
https://github.com/sigstore/public-good-instance/pull/900

Only 3 resources were created:

Apply complete! Resources: 3 added, 0 changed, 0 destroyed.
Outputs:
<snip>
ctlog_mysql_connections = [
  "projectsigstore-staging:us-central1:sigstore-staging-ctlog-2022",
]
ctlog_mysql_instances = [
  "sigstore-staging-ctlog-2022",
]

And connected to the new DB and verified there was trillian database on that instance, but it was empty (no tables), which createdb will handle. Onto the helm charts :)

Thank you @k4leung4 for all the help here!!! ❤️

@vaikas vaikas changed the title [WIP] Add ctlog shards that create their own Cloud SQL instances. Add ctlog shards that create their own Cloud SQL instances. Oct 11, 2022
@vaikas vaikas merged commit 9322721 into sigstore:main Oct 13, 2022
@vaikas vaikas deleted the new-ctlog branch October 13, 2022 15:37
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.

3 participants