我已经使用 kubeseal 加密了两个数据库密码,但我不确定如何将它们安装在我的配置文件中,假设我使用的是 Spring Boot。
该应用程序不断抱怨缺少占位符密码。无法解析占位符“datasources.eco.password”
这是生成的秘密:
apiVersion: bitnami.com/v1alpha1
kind: SealedSecret
metadata:
annotations:
sealedsecrets.bitnami.com/namespace-wide: "true"
creationTimestamp: null
name: database-keys
namespace: eco-test
spec:
encryptedData:
ecoadmin: AgBPqs07GicbU4eyYXfQrVoRHCkfPHH8jxN8...sefwfs4fse
ecodb: AgAHYRYpk5j+ZCyIDpYr89d8pYLJ6E8S...sr3245sefsf
template:
data: null
metadata:
annotations:
sealedsecrets.bitnami.com/namespace-wide: "true"
creationTimestamp: null
name: database-keys
namespace: eco-test
这是我尝试在我的属性文件中安装秘密的地方:
datasources:
eco:
#url: jdbc:oracle:thin:@10.246...
url: jdbc:oracle:thin:@12.234...
username: ECO
password:
secretKeyRef:
name: database-keys
key: ecodb
minPoolSize: 5
maxPoolSize: 20
edition: 'REL_2021_12_06'
ecoadmin:
#url: jdbc:oracle:thin:@10.246...
url: jdbc:oracle:thin:@21.32...
username: ECOADM
password:
secretKeyRef:
name: database-keys
key: ecoadmin