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 rekor-mysql ExternalSecret #1099

Merged
merged 1 commit into from
May 14, 2024
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
39 changes: 39 additions & 0 deletions terraform/gcp/modules/external_secrets/external_secrets.tf
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,42 @@ YAML
kubectl_manifest.trillian_namespace
]
}

resource "kubectl_manifest" "rekor_namespace" {
yaml_body = <<YAML
apiVersion: v1
kind: Namespace
metadata:
name: rekor-system
YAML
}

resource "kubectl_manifest" "rekor_mysql_external_secret" {
yaml_body = <<YAML
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: rekor-mysql
namespace: rekor-system
spec:
secretStoreRef:
kind: ClusterSecretStore
name: gcp-backend
target:
name: rekor-mysql
template:
data:
mysql-database: "${var.rekor_mysql_dbname}"
mysql-password: "{{ .mysqlPassword | toString }}" # <-- convert []byte to string
mysql-user: trillian
data:
- secretKey: mysqlPassword
remoteRef:
key: mysql-password
YAML

depends_on = [
kubectl_manifest.secretstore_gcp_backend,
kubectl_manifest.rekor_namespace
]
}
6 changes: 6 additions & 0 deletions terraform/gcp/modules/external_secrets/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,9 @@ variable "mysql_dbname" {
description = "Name of MySQL database."
default = "trillian"
}

variable "rekor_mysql_dbname" {
type = string
description = "Name of the MySQL database for Rekor search indexes."
default = "searchindexes"
}
Loading