apiVersion: apps/v1
kind: Deployment
metadata:
  name: docker-localstack-webapp
  namespace: default
  labels:
    name: docker-localstack-webapp
    app: docker-localstack-webapp
spec:
  selector:
    matchLabels:
      app: docker-localstack-webapp
  replicas: 1
  template:
    metadata:
      labels:
        app: docker-localstack-webapp
    spec:
      containers:
        - name: docker-localstack-webapp
          image: craftandtechnology/docker-localstack-webapp:latest
          ports:
            - containerPort: 8080
              name: http
          env:
            - name: REST_ENDPOINT
              value: "http://docker-localstack.default.svc.cluster.local:8080"
          livenessProbe:
            httpGet:
              path: /health
              port: http
              scheme: HTTP
            initialDelaySeconds: 2
            periodSeconds: 10
            timeoutSeconds: 1
            successThreshold: 1
            failureThreshold: 3
          readinessProbe:
            httpGet:
              path: /health
              port: http
              scheme: HTTP
            initialDelaySeconds: 2
            periodSeconds: 10
            timeoutSeconds: 1
            successThreshold: 1
            failureThreshold: 3
        - name: docker-localstack-webapp-https-proxy
          image: craftandtechnology/https-proxy:latest
          ports:
            - containerPort: 8443
              name: https
          livenessProbe:
            httpGet:
              path: /health
              port: https
              scheme: HTTPS
            initialDelaySeconds: 2
            periodSeconds: 10
            timeoutSeconds: 1
            successThreshold: 1
            failureThreshold: 3
          readinessProbe:
            httpGet:
              path: /health
              port: https
              scheme: HTTPS
            initialDelaySeconds: 2
            periodSeconds: 10
            timeoutSeconds: 1
            successThreshold: 1
            failureThreshold: 3
