apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: apc-write
    cluster: apc-example
  name: apc-write
spec:
  replicas: 2
  selector:
    matchLabels:
      app: apc-write
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
    type: RollingUpdate

  template:
    metadata:
      labels:
        app: apc-write
        cluster: apc-example
    spec:
      containers:
        - name: apc-write
          # remove for real clusters, useful for minikube
          imagePullPolicy: Never
          image: kubakka/endtoendexample:latest
          ports:
            - name: management
              containerPort: 8558
              protocol: TCP
            - name: http
              containerPort: 8080
              protocol: TCP
          env:
            - name: ROLE
              value: write
          readinessProbe:
            httpGet:
              path: /ready
              port: management
          livenessProbe:
            httpGet:
              path: /alive
              port: management
