我想问你有没有可能在kubernetes上使用带有scdf服务器的vault?我尝试使用它,但我无法将secrets from vault设置为scdf服务器的环境变量。
https://www.vaultproject.io/docs/platform/k8s/injector/examples#environment-变量示例
下面是我的k8s部署设置:
spec:
selector:
matchLabels:
app: scdf-server
replicas: 1
template:
metadata:
annotations:
vault.hashicorp.com/agent-inject: "true"
vault.hashicorp.com/agent-inject-status: "update"
vault.hashicorp.com/role: "internal-app"
vault.hashicorp.com/agent-inject-secret-database-config: "internal/data/database/config"
vault.hashicorp.com/agent-inject-template-database-config: |
{{ with secret "internal/data/database/config" -}}
export DB_USERNAME="{{ .Data.data.username }}"
export DB_PASSWORD="{{ .Data.data.password }}"
{{- end }}
[...]
args: [ "sh", "-c", ". ./vault/secrets/database-config && printenv|sort" ]
当我试着
command: [ "/bin/sh" ]
args: [ "-c", ". ./vault/secrets/database-config && printenv|sort" ]
env var被加载了,但是scdf服务器没有启动,我想是因为默认入口点被覆盖了。
暂无答案!
目前还没有任何答案,快来回答吧!