Skip to content

Commit

Permalink
Merge pull request #370 from sap-contributions/cert_renewal_jobs_wg_ci
Browse files Browse the repository at this point in the history
Automatic certificate regeneration for capi load balancer certificates
  • Loading branch information
stephanme authored May 23, 2024
2 parents 217fe41 + e231635 commit d0e4f8c
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 3 deletions.
6 changes: 5 additions & 1 deletion docs/concourse/certificate_regeneration.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The automated regeneration is provided as separate Terragrunt module which must

## Prerequisites

The certificate's CA must be stored in CredHub, and they must be correctly linked.
The certificate's CA must be stored in CredHub, and the certificate must be correctly linked to the CA.

## Configuration and deployment

Expand Down Expand Up @@ -46,6 +46,10 @@ value: <redacted>
version_created_at: "2024-05-07T12:23:43Z"
(...)
```
Afterward, you should delete the job with:
```
kubectl -n concourse delete job cert-regen-job
```

## Limitations

Expand Down
4 changes: 2 additions & 2 deletions docs/concourse/concourse-architecture.drawio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
locals {
config = yamldecode(file("../config.yaml"))
}

remote_state {
backend = "gcs"
generate = {
path = "backend.tf"
if_exists = "overwrite"
}
config = {
bucket = "${local.config.gcs_bucket}"
prefix = "${local.config.gcs_prefix}/automatic-certificate-regeneration"
project = "${local.config.project}"
location = "${local.config.region}"
# use for uniform bucket-level access
# (https://cloud.google.com/storage/docs/uniform-bucket-level-access)
enable_bucket_policy_only = false
}
}

terraform {
source = local.config.tf_modules.automatic_certificate_regeneration
}

inputs = {
project = local.config.project
region = local.config.region
zone = local.config.zone

gke_name = local.config.gke_name

certificates_to_regenerate = local.config.certificates_to_regenerate
}
5 changes: 5 additions & 0 deletions terragrunt/concourse-wg-ci/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ tf_modules:
dr_create: "../../..//terraform-modules/concourse/dr_create"
dr_restore: "../../..//terraform-modules/concourse/dr_restore"
secret_rotation_postgresql: "../../..//terraform-modules/concourse/secret_rotation_postgresql"
automatic_certificate_regeneration: "../../..//terraform-modules/concourse/automatic_certificate_regeneration"



Expand Down Expand Up @@ -110,3 +111,7 @@ wg_ci_cnrm_service_account_permissions: [
"cloudsql.databases.list",
"cloudsql.databases.update"
]

# list of certificates that shall be automatically renewed every month
# enter as one string with a comma-separated list of CredHub certificate names
certificates_to_regenerate: "/concourse/capi-team/kiki_lb,/concourse/capi-team/scar_lb,/concourse/capi-team/elsa_lb,/concourse/capi-team/asha_lb"

0 comments on commit d0e4f8c

Please sign in to comment.