-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathk8s.yaml
58 lines (56 loc) · 1.05 KB
/
k8s.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
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: <APP_NAME>
namespace: <NAMESPACE>
labels:
app: <APP_NAME>
spec:
replicas: <REPLICAS>
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
app: <APP_NAME>
spec:
restartPolicy: Always
hostAliases:
- ip: "10.2.7.1"
hostnames:
- "kafka01"
- ip: "10.2.7.9"
hostnames:
- "kafka02"
containers:
- image: <IMAGE>
name: <APP_NAME>
imagePullPolicy: IfNotPresent
ports:
- containerPort: <APP_PORT>
name: api
resources:
limits:
cpu: 800m
memory: 1200Mi
requests:
cpu: 50m
memory: 600Mi
---
kind: Service
apiVersion: v1
metadata:
name: <APP_NAME>
namespace: <NAMESPACE>
spec:
selector:
app: <APP_NAME>
type: NodePort
ports:
- name: api-port
port: 8080
targetPort: api
nodePort: <NODE_PORT>