apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: eda-demo-order-kstream
    app.kubernetes.io/name: eda-demo-order-kstream
    app.kubernetes.io/version: 1.0.0
  name: eda-demo-order-kstream
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: eda-demo-order-kstream
      app.kubernetes.io/version: 1.0.0
  template:
    metadata:
      labels:
        app: eda-demo-order-kstream
        app.kubernetes.io/name: eda-demo-order-kstream
        app.kubernetes.io/version: 1.0.0
    spec:
      containers:
      - args:
        - -Dquarkus.http.host=0.0.0.0
        - -Djava.util.logging.manager=org.jboss.logmanager.LogManager
        - -jar
        - /deployments/quarkus-run.jar
        command:
        - java
        image: quay.io/ibmcase/eda-demo-order-kstream
        imagePullPolicy: Always
        #imagePullSecrets:
        #- name: jbcodeforce-pull-secret
        # imagePullPolicy: IfNotPresent
        env:
        - name: KUBERNETES_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: JAVA_APP_JAR
          value: /deployments/quarkus-run.jar
        - name: KAFKA_SSL_TRUSTSTORE_LOCATION
          value: /deployments/certs/server/ca.p12
        - name: KAFKA_SECURITY_PROTOCOL
          value: SSL
        - name: KAFKA_SSL_TRUSTSTORE_TYPE
          value: PKCS12
        - name: KAFKA_SSL_KEYSTORE_LOCATION
          value: /deployments/certs/user/user.p12
        - name: KAFKA_SSL_KEYSTORE_TYPE
          value: PKCS12
        - name: KAFKA_SSL_TRUSTSTORE_PASSWORD
          valueFrom:
            secretKeyRef:
              key: ca.password
              name: es-demo-cluster-ca-cert
        - name: KAFKA_SSL_KEYSTORE_PASSWORD
          valueFrom:
            secretKeyRef:
              key: user.password
              name: es-tls-user
        # - name: JAAS_CFG
        #  valueFrom:
        #    secretKeyRef:
        #      key: sasl.jaas.config
        #      name: registry-user
        envFrom:
        - configMapRef:
            name: eda-demo-order-kstream-cm
        name: eda-demo-order-kstream
        ports:
        - containerPort: 8080
          name: http
          protocol: TCP
        volumeMounts:
        - mountPath: /deployments/certs/server
          name: kafka-cert
          readOnly: false
          subPath: ""
        - mountPath: /deployments/certs/user
          name: user-cert
          readOnly: false
          subPath: ""
      volumes:
      - name: kafka-cert
        secret:
          optional: false
          secretName: es-demo-cluster-ca-cert
      - name: user-cert
        secret:
          optional: true
          secretName: es-tls-user
