Skip to content

Commit

Permalink
Merge pull request #89 from concourse/auto-unseal
Browse files Browse the repository at this point in the history
enable auto-unseal with leveraging gkms
  • Loading branch information
pivotal-bin-ju authored Dec 4, 2019
2 parents c57869e + a67e295 commit 2690e34
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
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
}
}

0 comments on commit 2690e34

Please sign in to comment.