apiVersion: apps/v1
kind: Deployment
metadata:
  name: testapp
spec:
  replicas: 1
  selector:
    matchLabels:
      app: testapp
  template:
    metadata:
      annotations:
        sidecar.istio.io/inject: "true"
      labels:
        app: testapp
    spec:
      containers:
      - name: https
        image: quay.io/noseka1/openshift-toolbox:full
        command:
        - /bin/sh
        args:
        - -c
        - 'openssl req
             -newkey rsa:2048
             -nodes
             -keyout httpbin.key
             -x509
             -out httpbin.crt
             -subj /CN=example.com
           &&
           gunicorn-3
             --bind 0.0.0.0:8443
             --access-logfile -
             --keyfile httpbin.key
             --certfile httpbin.crt
             httpbin:app'
        # The container port must be declared, otherwise Istio won't
        # forward the traffic to the container correctly!
        ports:
        - containerPort: 8443
      - name: http
        image: quay.io/noseka1/openshift-toolbox:full
        command:
        - /bin/sh
        args:
        - -c
        - 'gunicorn-3
             --bind 0.0.0.0:8080
             --access-logfile -
             httpbin:app'
        # The container port must be declared, otherwise Istio won't
        # forward the traffic to the container correctly!
        ports:
        - containerPort: 8080
