容器注入staging,我这里采用的配置中心,通过这个函数来读取不同环境的配置
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app: boss
name: boss
namespace: s2b2c
spec:
replicas: 1
selector:
matchLabels:
app: boss
template:
metadata:
creationTimestamp: null
labels:
app: boss
spec:
imagePullSecrets:
- name: registry-pull-secret
containers:
- name: boss
image: 10.1.234.11/data/boss:v1
imagePullPolicy: Always
env:
- name: "ASPNETCORE_ENVIRONMENT"
value: "Staging"
ports:
- containerPort: 11001
volumeMounts:
- name: "appsetting"
mountPath: /appsetting.toml
subPath: appsetting.toml
- name: "priv"
mountPath: /rsa_1024_priv.pem
subPath: rsa_1024_priv.pem
- name