terranetes-controller
terranetes-controller copied to clipboard
Support valueFrom against specific variable names
Currently you can specify valueFrom to retrieve variables from Kubernetes Secrets, as follows:
spec:
valueFrom:
- secret: db-details
key: database-password
This translates to the following Terranetes Configuration Spec:
spec:
variables:
database-password: <secret_value>
This has a limitation in that the Secret Key Name must match precisely the Terraform Variable name that the module requires. If you cannot change the variable expected in the module you are using, then you must either manually create a new secret (if it's pre-existing) with the Key Name as expected, or fork and modify the Terraform Module so the variable name matches your secret key.
It would be nice to support valueFrom
as a type on a variable itself, for example:
spec:
variables:
username: "mydbuser"
password:
valueFrom:
secret: db-details
key: database-password
optional: false
vpc_security_group_ids:
- valueFrom:
secret: db-details
key: database-security-group-id
optional: false