apiVersion: apps/v1
kind: Deployment
metadata:
  name: regions-updater
  namespace: pia-webhook-system
  labels:
    project: pia-sidecar-injector
    app: regions-updater
spec:
  replicas: 1
  selector:
    matchLabels:
      project: pia-sidecar-injector
      app: regions-updater
  template:
    metadata:
      labels:
        project: pia-sidecar-injector
        app: regions-updater
    spec:
      serviceAccountName: regions-updater-service-account
      containers:
      - name: regions-updater
        image: asimpleidea/regions-updater:v0.3.1
        imagePullPolicy: Always
        args:
        - "--max-latency=$(MAX_LATENCY)"
        - "--workers=$(WORKERS)"
        - "--max-servers=$(MAX_SERVERS)"
        - "--servers-list-url=$(SERVERS_LIST_URL)"
        - "--order-by=$(ORDER_BY)"
        - "--order-direction=$(ORDER_DIRECTION)"
        - "--verbosity=$(VERBOSITY)"
        - "--frequency=$(FREQUENCY)"
        env:
        - name: NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        envFrom:
        - configMapRef:
            name: regions-updater-options
        securityContext:
          runAsNonRoot: true
          runAsUser: 65532