新建configmap:
apiVersion: v1
kind: ConfigMap
metadata:
name: front-conf
namespace: tsp
data:
baseUrl.js: |
window.baseUrl = 'http://xxx.com/'
window.websocketUrl = 'ws://xxx:8090/ws'
创建configmap的几种形式:
您暂时无权查看此隐藏内容!
在deployment挂载配置文件:
...
deployment.spec
volumes:
- name: front-config
configMap:
name: front-conf
containers:
- name: app
image: xxx.docker.com/project/myapp:myversion
...
volumeMounts:
- name: front-config
mountPath: /mx-nodejs/dist/