k8s 部署mqtt —— 筑梦之路

mqtt是干嘛的,网上有很多资料,这里就不再赘述。

---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: mqtt
  name: mqtt
  namespace: default
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mqtt
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: mqtt
    spec:
      containers:
        - image: 'emqx/emqx:latest'
          imagePullPolicy: Always
          name: mqtt
          ports:
            - containerPort: 18083
              name: dashboard
              protocol: TCP
            - containerPort: 8083
              name: data
              protocol: TCP
          resources: {}
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 30

---
apiVersion: v1
kind: Service
metadata:
  annotations: {}
  labels:
    app: mqtt
  name: mqtt-svc
  namespace: default
spec:
  ports:
    - name: cbf36m
      nodePort: 32004
      port: 18083
      protocol: TCP
      targetPort: 18083
    - name: tffafa
      nodePort: 31238
      port: 8083
      protocol: TCP
      targetPort: 8083
  selector:
    app: mqtt
  sessionAffinity: None
  type: NodePort

登录账号:admin
密码:public

k8s 部署mqtt —— 筑梦之路_第1张图片

k8s 部署mqtt —— 筑梦之路_第2张图片 k8s 部署mqtt —— 筑梦之路_第3张图片

你可能感兴趣的:(linux系统运维,物联网,云计算,kubernetes,容器,mqtt)