apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: go-demo-web
  labels:
    app.kubernetes.io/name: go-demo
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: go-demo
  serviceName: go-demo-api
  replicas: 3 # by default is 1
  template:
    metadata:
      labels:
        app.kubernetes.io/name: go-demo
    spec:
      terminationGracePeriodSeconds: 10
      containers:
      - name: go-demo
        image: bigkevmcd/go-demo-api:v0.0.1
        ports:
        - containerPort: 80
          name: web
        volumeMounts:
        - name: www
          mountPath: /usr/share/api/html
  volumeClaimTemplates:
  - metadata:
      name: www
    spec:
      accessModes: [ "ReadWriteOnce" ]
      storageClassName: "my-storage-class"
      resources:
        requests:
          storage: 1Gi
