apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: nginx
  labels:
    app: nginx
spec:
  replicas: 2
  serviceName: "nginx"
  podManagementPolicy: "Parallel"
  selector: # define how the deployment finds the pods it manages
    matchLabels:
      app: nginx
  template: # define the pods specifications
    metadata:
      labels:
        app: nginx
    spec:
      securityContext:
        runAsUser: 1005
        runAsGroup: 1005
      containers:
        - name: nginx
          image: nginx
          imagePullPolicy: IfNotPresent
          volumeMounts:
            - mountPath: /data
              name: test
          command:
            - tail
            - -f
            - /dev/null
      volumes:
        - name: test
          persistentVolumeClaim:
            claimName: hbase
