apiVersion: apps/v1
kind: Deployment
metadata:
  name: admission-deploy
spec:
  selector:
    matchLabels:
      app: redb-admission
  template:
    metadata:
      labels:
        app: redb-admission
    spec:
      serviceAccountName: redis-enterprise-admission
      containers:
      - name: admin
        image: redislabs/operator:6.0.12-5
        command:
        - /usr/local/bin/admission
        imagePullPolicy: Always
        ports:
        - containerPort: 443
        env:
        - name: POD_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        resources:
          limits:
            cpu: 1000m
            memory: 512Mi
          requests:
            cpu: 250m
            memory: 256Mi
        readinessProbe:
          failureThreshold: 3
          successThreshold: 1
          periodSeconds: 30
          timeoutSeconds: 10
          httpGet:
            path: /healthz
            port: 8443
            scheme: HTTPS
      initContainers:
      - name: admin-init
        image: redislabs/operator:6.0.12-5
        command:
        - /usr/local/bin/admission
        args:
        - '-generate-tls'
        imagePullPolicy: Always
        env:
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        - name: POD_NAMESPACE
          valueFrom:
            fieldRef:
                fieldPath: metadata.namespace
        - name: POD_IP
          valueFrom:
            fieldRef:
              fieldPath: status.podIP
        resources:
          limits:
            cpu: 2000m
            memory: 256Mi
          requests:
            cpu: 100m
            memory: 256Mi

