-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add certificate authority selection support and Google CAS integration (
#122) Closes #107. This PR introduces the concept of Certificate Authority (CA) providers to deployment scripts. It allows selecting a certificate provider to configure Terraform files, helm charts and cluster resources necessary to generate certificates using the selected provider. The existing integration with Let's Encrypt has been kept as a certificate provider option. Integration with Google's Certificate Authority Service (CAS) has been added and can be selected as a certificate provider. ## Changes 1. Certificate providers. There are two options available: `lets-encrypt`, and `google-cas`. The default option was set to `lets-encrypt` for backwards compatibility purposes. 2. Some configuration variables have been added. Existing configurations can be updated by running `deploy.sh set-config`. ## How to test 1. Run `./deploy.sh set-config <PROJECT_ID>` to configure new environment variables. * Select `google-cas` as the certificate provider. * Fill in the Common Name (`CN`) and Organization (`O`) certificate fields. Optionally, fill in the Organizational Unit (`OU`) certificate field. 2. Run `./deploy.sh update <PROJECT_ID>` to deploy the configuration. 3. Verify that the `cloud-robotics` certificate was issued correctly. The output should look something like this ```bash # Make sure kubectl is using the correct config and context $ kubectl get certificate cloud-robotics NAME READY SECRET AGE cloud-robotics True cloud-robotics-tls XXm ``` 4. Verify that `www.endpoints.$PROJECT_ID.cloud.goog` is using the certificate. ```sh # Make sure to set <PROJECT_ID> openssl s_client -showcerts -connect www.endpoints.$PROJECT_ID.cloud.goog:443 ``` --------- Signed-off-by: Alejo Carballude <[email protected]>
- Loading branch information
Showing
15 changed files
with
365 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/app_charts/base/cert-manager-google-cas-issuer-cloud.values.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Configuration for the cert-manager chart. | ||
# Reference: https://github.com/jetstack/google-cas-issuer/blob/main/deploy/charts/google-cas-issuer/values.yaml | ||
|
||
# No values are required for now. | ||
# This was put in place to add values in the future without requiring additional configuration in other files. | ||
# If values are added this disclaimer should be removed. | ||
|
||
# The Kubernetes service account must be annotated in order to impersonate a GCP service account using workload identity. | ||
serviceAccount: | ||
annotations: | ||
# PROJECT-ID will be replaced by a script in a future step with the contents of the `PROJECT_ID` env var. | ||
iam.gke.io/gcp-service-account: [email protected] | ||
|
||
app: | ||
approval: | ||
subjects: | ||
- kind: ServiceAccount | ||
name: cert-manager | ||
# TODO(alejoasd): this should be set from configuration dynamically | ||
namespace: default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
src/app_charts/base/cloud/cert-manager-google-cas-issuer.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{{ if eq .Values.certificate_provider "google-cas" }} | ||
# This includes all resources expanded from the cert-manager chart using | ||
# the values in ../cert-manager-cloud.values.yaml. | ||
# Some pseudo-variables that were inserted there are replaced with actual runtime values. | ||
{{ .Files.Get "files/cert-manager-google-cas-issuer-chart.cloud.yaml" | replace "HELM-NAMESPACE" .Release.Namespace | replace "PROJECT-ID" .Values.project }} | ||
{{ end }} |
Oops, something went wrong.