-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdeployment.yaml
91 lines (91 loc) · 1.85 KB
/
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
apiVersion: v1
kind: ServiceAccount
metadata:
name: replicator-account
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: replicator-role
rules:
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "watch", "list"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: replicator-account-role
subjects:
- kind: ServiceAccount
name: replicator-account
namespace: default
roleRef:
kind: ClusterRole
name: replicator-role
apiGroup: rbac.authorization.k8s.io
---
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
name: replicator
spec:
selector:
matchLabels:
app: replicator
replicas: 3 # tells deployment to run 2 pods matching the template
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
template:
metadata:
labels:
app: replicator
spec:
serviceAccount: replicator-account
containers:
- name: replicator
env:
- name: HOSTNAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: status.podIP
imagePullPolicy: Never
image: replicator:1.7
securityContext:
capabilities:
add: [ "NET_ADMIN" ]
readinessProbe:
tcpSocket:
port: 8080
livenessProbe:
tcpSocket:
port: 8080
ports:
- containerPort: 8080
name: api
- containerPort: 8081
name: mgmt
- containerPort: 2552
name: akka
---
apiVersion: v1
kind: Service
metadata:
name: replicator
spec:
type: NodePort
selector:
app: replicator
ports:
- protocol: TCP
name: mgmt
port: 8081
targetPort: mgmt
- protocol: TCP
name: api
port: 8080
targetPort: api