forked from mehmetihsansevinc/decice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmosquitto-deployment.yaml
80 lines (77 loc) · 1.64 KB
/
mosquitto-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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
apiVersion: v1
kind: Namespace
metadata:
name: mosquitto
labels:
name: mosquitto
---
apiVersion: v1
kind: ConfigMap
metadata:
namespace: mosquitto
name: mosquitto-config
data:
mosquitto.conf: |-
# Ip/hostname to listen to.
# If not given, will listen on all interfaces
#bind_address
# Port to use for the default listener.
port 1883
# Allow anonymous users to connect?
# If not, the password file should be created
allow_anonymous true
# The password file.
# Use the `mosquitto_passwd` utility.
# If TLS is not compiled, plaintext "username:password" lines bay be used
# password_file /mosquitto/config/passwd
---
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: mosquitto
name: mosquitto
spec:
replicas: 3
selector:
matchLabels:
app: mosquitto
template:
metadata:
labels:
app: mosquitto
spec:
nodeSelector:
node-role.kubernetes.io/worker: ""
containers:
- name: mosquitto
image: eclipse-mosquitto:2.0
resources:
requests:
cpu: "50m"
limits:
memory: "128Mi"
cpu: "500m"
ports:
- containerPort: 1883
volumeMounts:
- name: mosquitto-config
mountPath: /mosquitto/config/mosquitto.conf
subPath: mosquitto.conf
volumes:
- name: mosquitto-config
configMap:
name: mosquitto-config
---
apiVersion: v1
kind: Service
metadata:
namespace: mosquitto
name: mosquitto
spec:
selector:
app: mosquitto
type: NodePort
ports:
- nodePort: 31441
port: 1883
targetPort: 1883