forked from BitInit/eureka-on-kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 1
/
k8s-eureka-prod.yml
90 lines (90 loc) · 1.86 KB
/
k8s-eureka-prod.yml
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
apiVersion: v1
kind: ConfigMap
metadata:
name: eureka-cm
data:
# if you want to deploy n instances of eureka cluster,
# you should set eureka_service_address: http://eureka-0.eureka:8761/eureka,...,http://eureka-(n-1).eureka:8761/eureka
eureka_service_address: http://eureka-0.eureka:8761/eureka,http://eureka-1.eureka:8761/eureka,http://eureka-2.eureka:8761/eureka
---
apiVersion: v1
kind: Service
metadata:
name: eureka-np
labels:
app: eureka
spec:
type: NodePort
ports:
- port: 8761
nodePort: 30030
name: eureka
selector:
app: eureka
---
apiVersion: v1
kind: Service
metadata:
name: eureka
labels:
app: eureka
spec:
clusterIP: None
ports:
- port: 8761
name: eureka
selector:
app: eureka
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: eureka
spec:
serviceName: 'eureka'
# n instances
replicas: 3
selector:
matchLabels:
app: eureka
template:
metadata:
labels:
app: eureka
spec:
containers:
- name: eureka
image: bitinit/eureka
ports:
- containerPort: 8761
resources:
requests:
memory: "1Gi"
cpu: "500m"
limits:
memory: "1200Mi"
cpu: "500m"
env:
- name: EUREKA_SERVER_ADDRESS
valueFrom:
configMapKeyRef:
name: eureka-cm
key: eureka_service_address
- name: ENVIRONMENT
value: "prod"
- name: JVM_OPTS
value: "-Xms1g -Xmx1g"
livenessProbe:
httpGet:
path: /
port: 8761
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
readinessProbe:
httpGet:
path: /
port: 8761
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5