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

enable auto-unseal with leveraging gkms #89

Merged
merged 1 commit into from
Dec 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions deployments/with-creds/vault/templates/vault-gcp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: Secret
metadata:
name: vault-gcp
type: Opaque
data:
vault.gcp: {{ default "" .Values.vault.gcp | b64enc | quote }}

11 changes: 11 additions & 0 deletions deployments/with-creds/vault/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ vault:
extraVolumes:
- type: secret
name: vault-server-tls
- type: secret
name: vault-gcp
extraEnvironmentVars:
GOOGLE_REGION: global
GOOGLE_PROJECT: cf-concourse-production
GOOGLE_APPLICATION_CREDENTIALS: /vault/userconfig/vault-gcp/vault.gcp
standalone:
enabled: true
config: |
Expand All @@ -20,3 +26,8 @@ vault:
storage "file" {
path = "/vault/data"
}

seal "gcpckms" {
key_ring = "vault-helm-unseal-kr"
crypto_key = "vault-helm-unseal-key"
}
20 changes: 20 additions & 0 deletions terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,23 @@ module "ci-database" {
zone = "${var.zone}"
max_connections = "100"
}

# gkms key for vault unseal
# Concourse deployment.
#
resource "google_kms_key_ring" "keyring" {
name = "vault-helm-unseal-kr"
location = "global"
}

# crypto key for vault unseal
# Concourse deployment.
#
resource "google_kms_crypto_key" "vault-helm-unseal-key" {
name = "vault-helm-unseal-key"
key_ring = google_kms_key_ring.keyring.self_link

lifecycle {
prevent_destroy = true
}
}