1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
| 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-6
| # - image: $REGISTRY/$DOCKERHUB_NAMESPACE/zhba:SNAPSHOT-$BUILD_NUMBER
| imagePullPolicy: Always
| name: app
| 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
|
|