apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: namespace-delete-checker
  namespace: default
spec:
  replicas: 3
  selector:
    matchLabels:
      app: namespace-delete-checker
  serviceName: ""
  template:
    metadata:
      labels:
        app: namespace-delete-checker
    spec:
      containers:
        - args:
            - -cfgFile=/etc/namepspace-delete-checker/config/config.json
            - -grace-shutdown-period=10
            - -logRemain=14
            - -logdir=/var/log/namespace-delete-checker
            - -port=443
            - -tlsCertFile=/etc/namespace-delete-checker/certs/cert.pem
            - -tlsKeyFile=/etc/namespace-delete-checker/certs/key.pem
          image: ctripcloud/namespace-delete-checker:v1.0.0
          imagePullPolicy: IfNotPresent
          name: delete-checker
          resources:
            limits:
              cpu: "1"
              memory: 2Gi
            requests:
              cpu: "1"
              memory: 2Gi
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          volumeMounts:
            - mountPath: /etc/namespace-delete-checker/certs
              name: certs
              readOnly: true
            - mountPath: /etc/namespace-delete-checker/config
              name: config
            - mountPath: /var/log/namespace-delete-checker
              name: logs
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      serviceAccount: namespace-delete-checker
      serviceAccountName: namespace-delete-checker
      terminationGracePeriodSeconds: 30
      volumes:
        - name: certs
          secret:
            defaultMode: 420
            secretName: certs
        - configMap:
            defaultMode: 420
            name: namespace-delete-checker-config
          name: config
        - hostPath:
            path: /var/log/namespace-delete-checker
            type: ""
          name: logs