# apiVersion: v1
# kind: Service
# metadata:
#   name: nginx
#   labels:
#     app: nginx
# spec:
#   ports:
#   - port: 80
#     name: web
#   clusterIP: None
#   selector:
#     app: nginx
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: factomd
spec:
  serviceName: "factomd"
  replicas: 1
  selector:
    matchLabels:
      app: factomd
  template:
    metadata:
      labels:
        app: factomd
    spec:
      containers:
      - name: factomd
        image: gcr.io/factomd-dev/factomd_test
        ports:
        - containerPort: 8090
          name: control-panel
        - containerPort: 8093
          name: sim-control
        - containerPort: 8088
          name: factomd
      - name: walletd
        image: gcr.io/factomd-dev/oracle_wallet
        ports:
        - containerPort: 8089
          name: wallet
        command: ["factom-walletd", "-s", "localhost:8088"]        
      - name: factom-cli
        image: gcr.io/factomd-dev/oracle_cli
        command: ["tail", "-f", "/dev/null"]        
        volumeMounts:
          - name: database
            mountPath: /root/.factom/
  volumeClaimTemplates:
    - metadata:
        name: database
      spec:
        accessModes: [ "ReadWriteOnce" ]
        storageClassName: "standard"
        resources:
          requests:
            storage: 10G
