apiVersion: apps/v1
|
kind: Deployment
|
metadata:
|
labels:
|
app: zhbaw
|
name: zhbaw
|
#一定要写名称空间
|
namespace: zhba
|
spec:
|
progressDeadlineSeconds: 600
|
replicas: 1
|
selector:
|
matchLabels:
|
app: zhbaw
|
strategy:
|
rollingUpdate:
|
maxSurge: 50%
|
maxUnavailable: 50%
|
type: RollingUpdate
|
template:
|
metadata:
|
labels:
|
app: zhbaw
|
spec:
|
imagePullSecrets:
|
- name: aliyun #提前在项目下配置访问阿里云的账号密码
|
containers:
|
- image: registry.cn-hangzhou.aliyuncs.com/arsn/zhbaw:SNAPSHOT-9
|
# - image: $REGISTRY/$DOCKERHUB_NAMESPACE/zhba:SNAPSHOT-$BUILD_NUMBER
|
imagePullPolicy: Always
|
name: zhbaw
|
env:
|
- name: JAVA_TOOL_OPTIONS
|
value: -Xmx512m -Xms128m -Xmn32m -Xss16m
|
ports:
|
- containerPort: 81
|
protocol: TCP
|
resources:
|
limits:
|
cpu: 300m
|
memory: 600Mi
|
terminationMessagePath: /dev/termination-log
|
terminationMessagePolicy: File
|
dnsPolicy: ClusterFirst
|
restartPolicy: Always
|
terminationGracePeriodSeconds: 30
|
---
|
apiVersion: v1
|
kind: Service
|
metadata:
|
labels:
|
app: zhbaw
|
name: zhbaw
|
namespace: zhba
|
spec:
|
ports:
|
- name: http
|
port: 81
|
protocol: TCP
|
targetPort: 81
|
selector:
|
app: zhbaw
|
sessionAffinity: None
|
type: ClusterIP
|