---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: openfaas
    component: basic-auth-plugin
  name: basic-auth-plugin
  namespace: "openfaas"
spec:
  replicas: 1
  selector:
    matchLabels:
      app: basic-auth-plugin
  template:
    metadata:
      annotations:
        prometheus.io.scrape: "false"
      labels:
        app: basic-auth-plugin
    spec:
      volumes:
      - name: auth
        secret:
          secretName: basic-auth
      containers:
      - name:  basic-auth-plugin
        resources:
            requests:
              cpu: 20m
              memory: 50Mi
        image: openfaas/basic-auth-plugin:0.20.1
        imagePullPolicy: Always
        securityContext:
          readOnlyRootFilesystem: true
          runAsUser: 10001
        livenessProbe:
          httpGet:
            path: /health
            port: 8080
          timeoutSeconds: 5
        readinessProbe:
          httpGet:
            path: /health
            port: 8080
          timeoutSeconds: 5
        env:
        - name: secret_mount_path
          value: "/var/secrets"
        - name: basic_auth
          value: "true"
        volumeMounts:
        - name: auth
          readOnly: true
          mountPath: "/var/secrets"
        ports:
        - name: http
          containerPort: 8080
          protocol: TCP
      nodeSelector:
        beta.kubernetes.io/arch: amd64
