---
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: kinesis
  labels:
    name: kinesis
    app: kinesis
spec:
  serviceName: "kinesis"
  replicas: 1
  selector:
    matchLabels:
      app: kinesis
  template:
    metadata:
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/port: "4567"
      labels:
        name: kinesis
        app: kinesis
    spec:
      terminationGracePeriodSeconds: 60
      containers:
        - image: saidsef/aws-kinesis-local:latest
          name: kinesis
          imagePullPolicy: Always
          tty: true
          ports:
            - protocol: TCP
              containerPort: 4567
              name: tcp-kinesis
          resources:
            limits:
              memory: 512Mi
              cpu: 200m
            requests:
              memory: 128Mi
              cpu: 100m
          livenessProbe:
            exec:
              command:
                - pgrep
                - node
            initialDelaySeconds: 3
            periodSeconds: 3
            successThreshold: 1
            failureThreshold: 2
            timeoutSeconds: 2
          readinessProbe:
            tcpSocket:
                port: 4567
            initialDelaySeconds: 5
            periodSeconds: 3
            successThreshold: 1
            failureThreshold: 2
            timeoutSeconds: 1
          securityContext:
            allowPrivilegeEscalation: false
            privileged: false
            runAsNonRoot: true
            runAsGroup: 65534
            runAsUser: 65534
            capabilities:
             drop:
               - ALL
             add:
               - NET_BIND_SERVICE
               - SYS_TIME
          volumeMounts:
            - name: kinesis-storage
              mountPath: /data
              subPath: data
      volumes:
        - name: kinesis-storage
          emptyDir: {}
