kind: StatefulSet
apiVersion: apps/v1
metadata:
  labels:
    app: origin
  name: origin
  namespace: srs-cluster
spec:
  replicas: 2
  selector:
    matchLabels:
      app: origin
  template:
    metadata:
      labels:
        app: origin
    spec:
      volumes:
        - name: conf
          configMap:
            name: origin-conf
      containers:
      - name: srs
        image: 'hub.bigdatagz.com/ossrs/srs:v4.0'
        imagePullPolicy: Always
        ports:
          - name: rtmp
            containerPort: 1935
        volumeMounts:
          - name: conf
            mountPath: /app
        livenessProbe: 
          httpGet:
            path: /api/v1/versions
            port: 1985
            scheme: HTTP
          initialDelaySeconds: 5
          periodSeconds: 5
      - name: sidecar
        image: 'hub.bigdatagz.com/ossrs/node-srs-sidecar:v1.0'
        imagePullPolicy: Always
        ports:
          - name: sidecar
            containerPort: 3000
        env:
          - name: POD_IP
            valueFrom:
              fieldRef:
                apiVersion: v1
                fieldPath: status.podIP
        envFrom:
          - configMapRef:
              name: sidecar-env
        args:
          - webhook
      restartPolicy: Always
  serviceName: origin-svc
  updateStrategy:
    type: OnDelete