kind: "Deployment"
apiVersion: "apps/v1"
metadata:
  name: "king-rabbitmq"
  namespace: "kingfisher"
  labels:
    app: "king-rabbitmq"
spec:
  replicas: 1
  selector:
    matchLabels:
      app: "king-rabbitmq"
  template:
    metadata:
      labels:
        app: "king-rabbitmq"
    spec:
      containers:
        -
          name: "king-rabbitmq"
          image: "rabbitmq:3-management"
          ports:
            -
              containerPort: 15672
              protocol: "TCP"
            -
              containerPort: 5672
              protocol: "TCP"
          env:
            -
              name: "RABBITMQ_DEFAULT_USER"
              valueFrom:
                secretKeyRef:
                  name: "king-rabbitmq"
                  key: "username"
            -
              name: "RABBITMQ_DEFAULT_PASS"
              valueFrom:
                secretKeyRef:
                  name: "king-rabbitmq"
                  key: "password"
          livenessProbe:
            tcpSocket:
              port: 5672
            initialDelaySeconds: 1
            timeoutSeconds: 1
            periodSeconds: 10
            successThreshold: 1
            failureThreshold: 3
          readinessProbe:
            tcpSocket:
              port: 5672
            initialDelaySeconds: 1
            timeoutSeconds: 1
            periodSeconds: 10
            successThreshold: 1
            failureThreshold: 3
