migrate NATS to StatefulSet for clustering support
All checks were successful
Dynamic Branch Deploy / build-and-deploy (push) Successful in 7m36s
All checks were successful
Dynamic Branch Deploy / build-and-deploy (push) Successful in 7m36s
This commit is contained in:
@@ -1,10 +1,39 @@
|
|||||||
apiVersion: apps/v1
|
apiVersion: v1
|
||||||
kind: Deployment
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: nats-headless
|
||||||
|
labels:
|
||||||
|
app: nats
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 6222
|
||||||
|
name: cluster
|
||||||
|
clusterIP: None #
|
||||||
|
selector:
|
||||||
|
app: nats
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: nats
|
name: nats
|
||||||
labels:
|
labels:
|
||||||
app: nats
|
app: nats
|
||||||
spec:
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 4222
|
||||||
|
name: client
|
||||||
|
selector:
|
||||||
|
app: nats
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: StatefulSet
|
||||||
|
metadata:
|
||||||
|
name: nats
|
||||||
|
labels:
|
||||||
|
app: nats
|
||||||
|
spec:
|
||||||
|
serviceName: "nats-headless"
|
||||||
|
replicas: 3
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: nats
|
app: nats
|
||||||
@@ -16,8 +45,18 @@ spec:
|
|||||||
containers:
|
containers:
|
||||||
- name: nats
|
- name: nats
|
||||||
image: nats:alpine
|
image: nats:alpine
|
||||||
|
# Start-Befehl für Clustering
|
||||||
|
command:
|
||||||
|
- "nats-server"
|
||||||
|
- "--cluster"
|
||||||
|
- "nats://0.0.0.0:6222"
|
||||||
|
- "--routes"
|
||||||
|
- "nats://nats-headless:6222" # Route zeigt auf den Headless Service
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 4222
|
- containerPort: 4222
|
||||||
|
name: client
|
||||||
|
- containerPort: 6222
|
||||||
|
name: cluster
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
memory: "64Mi"
|
memory: "64Mi"
|
||||||
@@ -25,13 +64,3 @@ spec:
|
|||||||
limits:
|
limits:
|
||||||
memory: "256Mi"
|
memory: "256Mi"
|
||||||
cpu: "500m"
|
cpu: "500m"
|
||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: nats
|
|
||||||
spec:
|
|
||||||
ports:
|
|
||||||
- port: 4222
|
|
||||||
selector:
|
|
||||||
app: nats
|
|
||||||
|
|||||||
Reference in New Issue
Block a user