apiVersion: apps/v1
kind: Deployment
metadata:
  name: nats-streaming
spec:
  selector:
    matchLabels:
      app: nats-streaming
      version: 0.12.0
  replicas: 1
  template:
    metadata:
      labels:
        app: nats-streaming
        version: 0.12.0
      name: nats-streaming
    spec:
      containers:
      - name: nats-streaming
        image: nats-streaming:0.12.0
        args: ["-p", "4222", 
        "-m", "8222", 
        "--max_channels", "200", 
        "--auth", "01234567890", 
        "-tls_client_cert", "/etc/vamp/certs/nats-client.pem", 
        "-tls_client_key", "/etc/vamp/certs/nats-client.key", 
        "-tls_client_cacert", "/etc/vamp/certs/ca.pem", 
        "-tlscert", "/etc/vamp/certs/nats-server.pem", 
        "-tlskey", "/etc/vamp/certs/nats-server.key", 
        "-tlscacert", "/etc/vamp/certs/ca.pem"]
        ports:
        - name: client
          containerPort: 4222
          protocol: TCP
        - name: monitoring
          containerPort: 8222
          protocol: TCP
        readinessProbe:
          httpGet:
            path: /
            port: monitoring
          initialDelaySeconds: 5
          periodSeconds: 15
        volumeMounts:
        - name: certs
          mountPath: "/etc/vamp/certs"
          readOnly: true
      volumes:
      - name: certs
        secret:
          secretName: nats-certs