k8s配置容器的环境变量可以直接使用Java获取或Spring的@Value获取
apiVersion: apps/v1kind: Deploymentmetadata:name: xxx-devnamespace: openspec:replicas: 1selector:matchLabels:name: xxxstrategy:rollingUpdate:maxSurge: 1maxUnavailable: 1template:metadata:label
·
apiVersion: apps/v1
kind: Deployment
metadata:
name: xxx-dev
namespace: open
spec:
replicas: 1
selector:
matchLabels:
name: xxx
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
template:
metadata:
labels:
name: xxx
spec:
containers:
- name: xxx
image: /public-repository/testsl/xxx:0.0.0
imagePullPolicy: Always
env:
- name: TCP_PORT
value: '21399'
- name: STR_DELIMITER
value: ']'
resources:
limits:
cpu: '1'
memory: 1024Mi
requests:
cpu: 500m
memory: 128Mi
volumeMounts:
- name: hosts
mountPath: /etc/hosts
subPath: hosts
- name: logs
mountPath: /www/logs/
volumes:
- name: hosts
hostPath:
path: /etc/
- name: logs
hostPath:
path: /logs/
imagePullSecrets:
- name: xxxxxxx
nodeSelector:
lable_open: open
更多推荐
已为社区贡献6条内容
所有评论(0)