apiVersion: apps/v1
kind: Deployment
metadata:
  name: website
  namespace: watheia
  labels:
    app: website
spec:
  selector:
    matchLabels:
      app: website
  replicas: 1
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: website
    spec:
      # initContainers:
      # Init containers are exactly like regular containers, except:
      # - Init containers always run to completion.
      # - Each init container must complete successfully before the next one starts.
      containers:
        - name: vertx-mesh-website
          image: registry.digitalocean.com/watheia/vertx-mesh-website:v0.1.0
          resources:
            limits:
              cpu: 100m
              memory: 1Gi
          livenessProbe:
            tcpSocket:
              port: 8080
            initialDelaySeconds: 5
            timeoutSeconds: 5
            successThreshold: 1
            failureThreshold: 3
            periodSeconds: 10
          readinessProbe:
            httpGet:
              path: /greeting
              port: 8080
            initialDelaySeconds: 5
            timeoutSeconds: 2
            successThreshold: 1
            failureThreshold: 3
            periodSeconds: 10
          ports:
            - containerPort: 8080
              name: http1
            - containerPort: 8443
              name: http2
      # volumeMounts:
      #   - name: website-data
      #     mountPath: /wa
      # volumes:
      #   - name: website-data
      #     persistentVolumeClaim:
      #       claimName: website-data
      restartPolicy: Always
