-
Notifications
You must be signed in to change notification settings - Fork 7
/
deploy.yaml
68 lines (68 loc) · 1.41 KB
/
deploy.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: boom-server
labels:
app: boom-server
spec:
replicas: 1
selector:
matchLabels:
app: boom-server
template:
metadata:
labels:
app: boom-server
spec:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- client
topologyKey: kubernetes.io/hostname
containers:
- name: boom-server
image: anfernee/k8s-issue-74839
ports:
- containerPort: 9000
---
kind: Service
apiVersion: v1
metadata:
name: boom-server
spec:
selector:
app: boom-server
ports:
- protocol: TCP
port: 9000
targetPort: 9000
---
apiVersion: v1
kind: Pod
metadata:
name: startup-script
labels:
app: client
spec:
hostPID: true
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- boom-server
topologyKey: kubernetes.io/hostname
containers:
- name: startup-script
image: gcr.io/google-containers/startup-script:v1
command: ['bash', '-c', 'while true; do sleep 2; nc boom-server 9000& done']
imagePullPolicy: IfNotPresent