Kubernetes 舵图:字符串连接
我试图在helmchart中连接变量以开发连接字符串 连接字符串:Kubernetes 舵图:字符串连接,kubernetes,kubernetes-helm,rancher,Kubernetes,Kubernetes Helm,Rancher,我试图在helmchart中连接变量以开发连接字符串 连接字符串: ConnectionStrings:TheSourceContext="Server=10.xx.xx.xx,1433;Database=Test;User Id=Test; Password=pass123;" 我将用户id和密码作为机密传递,但它不起作用。它没有建立所需的字符串 - name: DBUSERD valueFrom: secretKeyRef
ConnectionStrings:TheSourceContext="Server=10.xx.xx.xx,1433;Database=Test;User Id=Test; Password=pass123;"
我将用户id和密码作为机密传递,但它不起作用。它没有建立所需的字符串
- name: DBUSERD
valueFrom:
secretKeyRef:
key: dbuser
name: api-catalogue
- name: DBPASSD
valueFrom:
secretKeyRef:
key: dbpass
name: api-catalogue
- name: ConnectionStrings__TheSourceContext
value: {{ .Values.const.DBSVR }}{{ .Values.app.connectionStringsServer }},{{.Values.app.connectionStringsPort }}{{ .Values.const.DB }}{{ .Values.app.connectionStringsDB }}{{ .Values.const.DBUSR }}$(DBUSERD){{ .Values.const.DBPASS }}($DBPASSD)*
如何更正上述变量以使其正常工作?,看看这是否有帮助。什么不起作用?你得到了什么输出?(
helm-template
可以向您显示生成的YAML,而无需将其提交给Kubernetes。)您显示的示例字符串有一些您的YAML显然不具备的常量文本和标点(Server=
例如)。下面的逻辑是工作值:{.Values.const.DBSVR}{.Values.app connectionStringsServer}{{.Values.app.connectionStringsPort}{{.Values.const.DB}{{.Values.app.connectionStringsDB}{{.Values.const.DBUSR}}{{.printf$}{.Values.const.DBPASS}{.Values.app.connectionStringsPassword}}{.yaml const:dbvr:“Server=”DB:“Database=”DBUSR:”;User ID=“pass:”Password=”Password------------------------------问题是当我使用secrets作为变量并尝试使用这些变量时,它会在第一个post中抛出共享的错误,值为:{{.Values.const.DBSVR}{{.Values.app.connectionStringsServer}},{{.Values.app.connectionStringsPort}{.Values.const.DB}{.Values.app.connectionStringsDB}{.Values.const.DBUSR}}{{printf“%s:$DBUSERD”}{{.Values.const.DBPASS}}{printf“%s:$DBPASSD”}}}输出:ConnectionStrings\uu TheSourceContext=“Server=10.241.64.281433;Database=TheSource\u new;用户ID=%!s(缺失):$DBUSERD;密码=%!s(缺失):$DBPASSD”密码=%!s(缺失):$DBPASSD)密码=%!s(缺失):$dbpassd是否可以将此更新为问题?请避免在注释中放置代码或命令。