apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: opal-server-daemonset
  namespace: opal-impl
  labels:
    app: opal-server-daemonset
spec:
  selector:
    matchLabels:
      name: opal-server-daemonset
  template:
    metadata:
      labels:
        name: opal-server-daemonset
    spec:
      containers:
      - name: opalserver
        image: permitio/opal-server:latest
        ports:
        - containerPort: 7002
        env:
        - name: OPAL_BROADCAST_URI
          value: "postgres://postgresadmin:admin123@broadcast-channel-service.opal-impl.svc:5432/postgres"
        - name: UVICORN_NUM_WORKERS
          value: "3"
        - name: OPAL_POLICY_REPO_URL
          value: "<git repo>"
        - name: OPAL_DATA_CONFIG_SOURCES
          value: '{"config":{"entries":[{"url":"http://opalserver:7002/policy-data","topics":["policy_data"],"dst_path":"/static"}]}}'
        - name: OPAL_LOG_FORMAT_INCLUDE_PID
          value: "true"
        - name: OPAL_POLICY_REPO_MAIN_BRANCH
          value: "main"
        - name: OPAL_POLICY_REPO_WEBHOOK_SECRET
          value: "<secret>"
        - name: OPAL_REPO_WATCHER_ENABLED
          value: "0"