forked from emqxarchive/emqx-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathemqtt.yaml
111 lines (110 loc) · 2.73 KB
/
emqtt.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: emqtt
subjects:
- kind: ServiceAccount
name: default
namespace: default
roleRef:
kind: ClusterRole
name: cluster-admin
apiGroup: rbac.authorization.k8s.io
---
apiVersion: v1
kind: Service
metadata:
name: emqtt
labels:
app: emqtt
spec:
ports:
- port: 1883
name: mqtt
- port: 8883
name: mqttssl
- port: 8080
name: mgmt
- port: 18083
name: dashboard
- port: 4369
name: mapping
selector:
app: emqtt
type: LoadBalancer
---
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: emqtt
spec:
replicas: 2
serviceName: emqtt
template:
metadata:
labels:
app: emqtt
spec:
containers:
- name: emqtt
image: philipbui/emq-docker
ports:
- containerPort: 1883
- containerPort: 8883
- containerPort: 8080
- containerPort: 18083
- containerPort: 4369
- containerPort: 4370
- containerPort: 6369
- containerPort: 6370
- containerPort: 6371
- containerPort: 6372
- containerPort: 6373
- containerPort: 6374
- containerPort: 6375
- containerPort: 6376
- containerPort: 6377
- containerPort: 6378
readinessProbe:
tcpSocket:
port: 1883
initialDelaySeconds: 5
periodSeconds: 10
env:
- name: EMQ_NAME
value: "emqtt"
- name: EMQ_CLUSTER__DISCOVERY
value: "k8s"
- name: EMQ_CLUSTER__K8S__NAMESPACE
value: "emqtt"
- name: EMQ_CLUSTER__K8S__APISERVER
value: "https://kubernetes.default:443"
- name: EMQ_CLUSTER__K8S__SERVICE_NAME
value: "emqtt"
- name: EMQ_CLUSTER__K8S__ADDRESS_TYPE
value: "ip"
- name: EMQ_CLUSTER__K8S__APP_NAME
value: "emqtt"
- name: EMQ_NODE__COOKIE
valueFrom:
secretKeyRef:
name: emqttsecret
key: cookie
- name: EMQ_ADMIN_PASSWORD
valueFrom:
secretKeyRef:
name: emqttsecret
key: password
- name: EMQ_LOADED_PLUGINS
value: "emq_auth_jwt,emq_recon,emq_modules,emq_dashboard"
- name: EMQ_AUTH__JWT__SECRET
valueFrom:
secretKeyRef:
name: emqttsecret
key: secret
- name: EMQ_CLUSTER__NAME
value: "emqcl"
- name: EMQ_CLUSTER__AUTOHEAL
value: "on"
- name: EMQ_CLUSTER__AUTOCLEAN
value: "5m"