apiVersion: apps/v1
kind: Deployment
metadata:
  name: message-queue-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      app: message-queue
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
  minReadySeconds: 5
  template:
    metadata:
      labels:
        app: message-queue
    spec:
      containers:
      - name: messagequeue
        image: nats:linux
        imagePullPolicy: Always
        resources:
          requests:
            cpu: 100m
            memory: 128Mi
          limits:
            cpu: 250m
            memory: 256Mi        
        ports:
        - containerPort: 4222
          name: client
        - containerPort: 6222
          name: cluster
        - containerPort: 8222
          name: monitor