-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtomcat-deployment.yaml
49 lines (49 loc) · 1.36 KB
/
tomcat-deployment.yaml
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
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
name: tomcat
spec:
replicas: 1
selector:
matchLabels:
app: tomcat
template:
metadata:
labels:
app: tomcat
spec:
hostname: tomcat
dnsPolicy: ClusterFirst
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- node1.qyos.com
- node7.qyos.com
# preferredDuringSchedulingIgnoredDuringExecution:
# - weight: 1 //取值范围1-100
# preference:
# matchExpressions:
# - key: another-node-label-key
# operator: In
# values:
# - another-node-label-value
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- tomcat
topologyKey: kubernetes.io/hostname
containers:
- name: tomcat
image: docker-registry.default.svc:5000/openshift/tomcat:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080