---
apiVersion: v1
kind: Service
metadata:
  name: kubernetes-external-secrets-metrics
  namespace: kubernetes-external-secrets
  labels:
    app: kubernetes-external-secrets
spec:
  selector:
    app: kubernetes-external-secrets
  ports:
    - protocol: TCP
      port: 3001
      name: prometheus
      targetPort: prometheus
  loadBalancerIP: 34.134.82.56
  type: LoadBalancer
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: kubernetes-external-secrets
  namespace: kubernetes-external-secrets
  labels:
    app: kubernetes-external-secrets
spec:
  replicas: 1
  selector:
    matchLabels:
      app: kubernetes-external-secrets
  template:
    metadata:
      labels:
        app: kubernetes-external-secrets
    spec:
      serviceAccountName: kubernetes-external-secrets
      containers:
        - name: kubernetes-external-secrets
          image: "ghcr.io/external-secrets/kubernetes-external-secrets:8.1.2"
          imagePullPolicy: IfNotPresent
          ports:
          - name: prometheus
            containerPort: 3001
          env:
          - name: "LOG_LEVEL"
            value: "debug"
          - name: "LOG_MESSAGE_KEY"
            value: "msg"
          - name: "METRICS_PORT"
            value: "3001"
          - name: "POLLER_INTERVAL_MILLISECONDS"
            value: "10000"
          - name: "WATCH_TIMEOUT"
            value: "60000"
          # Params for env vars populated from k8s secrets
      securityContext:
        runAsNonRoot: true
