apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: streams-demo
  name: streams-demo
spec:
  replicas: 1
  selector:
    matchLabels:
      app: streams-demo
  progressDeadlineSeconds: 20
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
  template:
    metadata:
      labels:
        app: streams-demo
    spec:
      containers:
        - image: streams-demo
          name: streams-demo
          imagePullPolicy: Never
          env:
            - name: JAVA_OPTS
              value: >
                -Dcom.sun.management.jmxremote
                -Dcom.sun.management.jmxremote.port=5555
                -Dcom.sun.management.jmxremote.rmi.port=5555
                -Dcom.sun.management.jmxremote.local.only=false
                -Dcom.sun.management.jmxremote.authenticate=false
                -Dcom.sun.management.jmxremote.ssl=false
                -Djava.rmi.server.hostname=127.0.0.1
            - name: HEALTH_PORT
              value: "9999"
            - name: KAFKA_BOOTSTRAP_SERVERS
              value: my-cluster-kafka-bootstrap.kafka.svc.cluster.local:9092
          livenessProbe:
            httpGet:
              path: /health/live
              port: 9999
            periodSeconds: 15
            initialDelaySeconds: 5
            timeoutSeconds: 5
            failureThreshold: 3
          readinessProbe:
            httpGet:
              path: /health/ready
              port: 9999
            periodSeconds: 10
            initialDelaySeconds: 3
            timeoutSeconds: 2
            failureThreshold: 3
          resources:
            limits:
              cpu: 500m
              memory: 512Mi
            requests:
              cpu: 300m
              memory: 256Mi
      terminationGracePeriodSeconds: 30
