apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    db: rethinkdb
  name: rethinkdb-replica-2
spec:
  selector:
    matchLabels:
      db: rethinkdb
  replicas: 1
  template:
    metadata:
      labels:
        db: rethinkdb
        role: replica
        instance: two
    spec:
      containers:
      - image: rosskukulinski/rethinkdb-kubernetes:2.3.5
        args:
          - "--cache-size"
          - "100"
        imagePullPolicy: Always
        name: rethinkdb
        env:
        - name: POD_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        - name: POD_IP
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: status.podIP
        - name: RETHINK_CLUSTER
          value: rethinkdb
        ports:
        - containerPort: 8080
          name: admin
        - containerPort: 28015
          name: driver
        - containerPort: 29015
          name: cluster
        livenessProbe:
          exec:
            command:
              - /probe
          failureThreshold: 3
          initialDelaySeconds: 15
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 5
        readinessProbe:
          exec:
            command:
              - /probe
          failureThreshold: 3
          initialDelaySeconds: 15
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 5
        resources:
          limits:
            cpu: 100m
            memory: 256Mi
          requests:
            cpu: 100m
            memory: 256Mi
        volumeMounts:
        - mountPath: /data
          name: storage
      volumes:
      - gcePersistentDisk:
          fsType: ext4
          pdName: rethinkdb-storage-2
        name: storage
