Skip to content

Instantly share code, notes, and snippets.

@chainhead
Last active August 19, 2021 03:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chainhead/25d13adf777710339659805d1102da11 to your computer and use it in GitHub Desktop.
Save chainhead/25d13adf777710339659805d1102da11 to your computer and use it in GitHub Desktop.
mosquitto-k8s

Introduction

# https://raw.githubusercontent.com/eclipse/mosquitto/master/mosquitto.conf
kubectl create ns/mqtt
kubectl -n mqtt create configmap mosquitto-conf --from-file=mosquitto.conf
kubectl -n mqtt create -f deploy.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: mqtt
name: mosquitto
spec:
selector:
matchLabels:
app.kubernetes.io/name: mosquitto
replicas: 1
template:
metadata:
labels:
app.kubernetes.io/name: mosquitto
spec:
containers:
- name: mosquitto
image: eclipse-mosquitto:latest
imagePullPolicy: IfNotPresent
resources:
limits:
memory: "128Mi"
cpu: "100m"
ports:
- containerPort: 1883
protocol: "TCP"
volumeMounts:
- name: mosquitto
mountPath: /mosquitto/log
- name: mosquitto
mountPath: /mosquitto/data
- name: mosquitto-conf
mountPath: /mosquitto/config
volumes:
- name: mosquitto
emptyDir: {}
- name: mosquitto-conf
configMap:
name: mosquitto-conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment