-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeployment.yaml
60 lines (60 loc) · 1.41 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
apiVersion: v1
kind: Service
metadata:
name: mynats
spec:
type: ClusterIP
clusterIP: None
selector:
app: nats-server
ports:
- name: nats
port: 4222
- name: cluster
port: 6222
- name: monitor
port: 8222
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nats-server
spec:
replicas: 2
selector:
matchLabels:
app: nats-server
template:
metadata:
labels:
app: nats-server
spec:
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
app: nats-server
containers:
- name: nats-server
image: nats
imagePullPolicy: Always
env:
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
command: [ "nats-server" ]
args: [ "--server_name", "$(NODE_NAME)", "--cluster_name", "mynats", "-js", "--cluster", "nats://0.0.0.0:6222", "--routes", "nats://mynats.sandbox:6222", "-m", "8222" ]
resources:
requests:
memory: "128Mi"
cpu: "100m"
limits:
memory: "256Mi"
cpu: "1000m"
ports:
- containerPort: 4222
- containerPort: 6222
- containerPort: 8222