apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: redis-sts
  namespace: goms-ek8s
  labels:
    app: redis
spec:
  serviceName: redis-svc
  replicas: 1
  selector:
    matchLabels:
      app: redis  #选择 pod label
  template:
    metadata:
      labels:
        app: redis #标注 pod label
    spec:
      containers:
      - name: redis
        image: redis:latest
        imagePullPolicy: IfNotPresent
        resources:
          limits:
            cpu: 150m
            memory: 400Mi
          requests:
            cpu: 100m
            memory: 400Mi
        ports:
        - containerPort: 6379