apiVersion: apps/v1
kind: Deployment
metadata:
  name: crdt-graph
spec:
  replicas: 5
  selector:
    matchLabels:
      app: crdt-graph
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
  template:
    metadata:
      labels:
        app: crdt-graph
    spec:
      serviceAccountName: crdt-graph
      containers:
      - image: crdt-graph:0.1.0-SNAPSHOT
        imagePullPolicy: IfNotPresent
        name: crdt-graph
        env:
          - name: HOSTNAME
            valueFrom:
              fieldRef:
                apiVersion: v1
                fieldPath: status.podIP
        ports:
        - name: remoting
          containerPort: 2551
        - name: api
          containerPort: 8080
        - name: management
          containerPort: 8558
        readinessProbe:
          tcpSocket:
            port: 8080
          initialDelaySeconds: 5
          periodSeconds: 10
        livenessProbe:
          tcpSocket:
            port: 8080
          initialDelaySeconds: 15
          periodSeconds: 20
