Hey :slightly_smiling_face: we are trying to insta...
# opal
i
Hey πŸ™‚ we are trying to install opal in one of our k8 clusters with the helm charts, but the opal-client doesnt seems to be able to start
adding our values file -
d
Hey @Itamar Shpak, thanks for reaching out! πŸ’Ž Notice the OPAL Client does not become healthy because it did not load the data sources completely. From the YAML file it seem you have not yet configured any data sources in your OPAL setup, that may explain it πŸ™‚ See the Data Sources documentation
You can always tag the @Ask Inkeep or inside the docs page to help you get started quickly πŸ€–
a
Thanks for tagging me @Dan. I'll look through relevant sources and get back to you shortly.
Based on the thread history, it looks like the OPAL client isn't starting properly due to missing data source configuration. Here's what's happening and how to fix it: The OPAL client needs proper data sources configured to become healthy (1) . When
server.dataConfigSources
has no entries, the Helm chart automatically sets
OPAL_DATA_UPDATER_ENABLED: False
to prevent the client from reporting an unhealthy state (2) . To resolve this, you need to configure your data sources in your Helm values file. Here's the minimum configuration needed (1) :
Copy code
server:
  dataConfigSources:
    config:
      entries:
        - url: "<https://api.permit.io/v1/policy-config>"
          topics: ["policy_data"]
          config:
            headers:
              Authorization: "Bearer YOUR-SECRET-TOKEN"
The key configuration variables for the Helm chart include (2) : β€’
server.policyRepoUrl
- Git repository with your policy code β€’
server.dataConfigSources
- Data sources for the clients β€’
server.broadcastUri
- Backend for broadcasting updates (needed if replicas > 1) For a complete working example with proper data sources (3) :
Copy code
export OPAL_DATA_CONFIG_SOURCES='{"config": {"entries": [{"url": "<https://api.permit.io/v1/policy-config>", "topics": ["policy_data"], "config": {"headers": {"Authorization": "Bearer FAKE-SECRET"}}}]}}'
Make sure your values file includes at least one data source entry, otherwise the client won't be able to complete its initialization and will remain unhealthy.
i
thanks for replying ! i do have this config entries: - url: http://opal-server:7002/policy-data topics: ["policy_data"] dst_path: "/static"
but not sure what does data source should be? also tried to start it without any datasource so it will set automatically the OPAL_DATA_UPDATER_ENABLED to false so client should start healthy no ?
in addition does the opal-server has web ui ? or nope ?
d
OPAL does not have a Web UI at the moment πŸ™‚ The
OPAL_DATA_UPDATER_ENABLED=false
is to disable real-time updates, but the OPAL Client would still load in the statically configured Data Source Entires configured. See Trigger Data Update tutorial for reference Check the Data Updates FAQ for more details
πŸ‘€ 1
i
thanks ! i will check it out and will update
@Ask Inkeep hey i tried to read docs, but still didnt understand what is a data source and why we uses it, in case we want only kubernetes level opa for example, what should i use there for ?
a
Thanks for tagging me @Itamar Shpak. I'll look through relevant sources and get back to you shortly.
A data source in OPAL provides the actual authorization data (like users, roles, permissions) that your policies need to make decisions (1) (2) . Even for Kubernetes-level authorization, you need data about what resources exist and who can access them. For Kubernetes-level OPA specifically, OPAL offers distinct advantages over kube-mgmt (1) : 1. ​*Decoupling from deployments*​: You can update both policy and data on the fly without changing K8s configuration 2. ​*Data updates and distribution*​: OPAL allows loading data from multiple sources and maintaining sync 3. ​*More secure channel*​: OPAL provides secure data loading with JWT authentication What are Data Sources? Data sources are directives that tell OPAL clients how to fetch data and where to put it in OPA (3) . The
OPAL_DATA_CONFIG_SOURCES
contains the "complete picture" data sources - fetched after OPAL client loads and after every disconnect . For Kubernetes-level Authorization If you're using OPAL just for Kubernetes authorization without external data, you can configure a minimal data source. Here's an example from the documentation :
Copy code
{
  "config": {
    "entries": [
      {
        "url": "<http://example-api-server.com/policy-config>",
        "config": {
          "headers": {
            "Authorization": "Bearer YOUR-SECRET-HERE"
          }
        },
        "topics": [
          "policy_data"
        ],
        "dst_path": "/"
      }
    ]
  }
}
The data source URL should point to an API that returns your Kubernetes authorization data (like namespace permissions, RBAC rules, etc.) . If you don't have external data yet, you could start with a simple static JSON file served via HTTP containing your initial authorization rules.
To learn more, see the sources I considered: [[1] Data updates](https://docs.opal.ac/faq/) [[2] FAQ | OPAL](https://docs.opal.ac/FAQ) [[3] How to configure external data sources](https://docs.opal.ac/tutorials/configure_external_data_sources)
o
1. You probably do want to use data-sources - it’s pretty rare that policy don’t depend on any context / state of the system they are gating access to or the wider world. 2. If you don’t want to use data sources you can simply have an entry that provides data within it as an empty object (i.e.
{}
) - @Ask Inkeep please provide and example
a
Thanks for tagging me @Or Weis. I'll look through relevant sources and get back to you shortly.
You're right that policies rarely work without any context or state data. Here's an example of configuring OPAL with minimal or empty data sources: For a minimal data source configuration with empty data, you can structure your
OPAL_DATA_CONFIG_SOURCES
like this (1) :
Copy code
{
  "config": {
    "entries": [
      {
        "url": "<https://api.permit.io/v1/policy-config>",
        "topics": [
          "policy_data"
        ],
        "config": {
          "headers": {
            "Authorization": "Bearer FAKE-SECRET"
          }
        }
      }
    ]
  }
}
The data source configuration tells OPAL clients ​*what to fetch*​ (url) and ​*where to put it*​ in OPA data document hierarchy (destination path) . Each entry in the configuration is a directive for the OPAL client to fetch data and place it in OPA cache using the Data API . If you want to provide static empty data, your API endpoint (specified in the
url
field) would simply need to return
{}
when called. The entry uses the default
dst_path
of
/
which places data at the root of OPA document hierarchy . For encoding this in an environment variable :
Copy code
export OPAL_DATA_CONFIG_SOURCES='{"config": {"entries": [{"url": "<https://api.permit.io/v1/policy-config>", "topics": ["policy_data"], "config": {"headers": {"Authorization": "Bearer FAKE-SECRET"}}}]}}'
The key point is that even with "empty" data, OPAL still needs a valid data source configuration - it's just that your endpoint would return minimal or empty JSON data.
Thanks for tagging me @Or Weis. I'll look through relevant sources and get back to you shortly.
To learn more, see the sources I considered: [[1] Data Source Configuration](https://docs.opal.ac/getting-started/running-opal/run-opal-server/data-sources)
You're right that policies typically need context/state data to function properly. Here's how to configure OPAL with minimal or empty data sources: For a minimal data source configuration, you can set up your
OPAL_DATA_CONFIG_SOURCES
like this (1) :
Copy code
{
  "config": {
    "entries": [
      {
        "url": "<https://api.permit.io/v1/policy-config>",
        "topics": [
          "policy_data"
        ],
        "config": {
          "headers": {
            "Authorization": "Bearer FAKE-SECRET"
          }
        }
      }
    ]
  }
}
Each entry in the
entries
array is a directive that tells the OPAL client to fetch data and place it in OPA cache using the Data API . The configuration specifies: β€’ ​*From where to fetch:*​ The URL endpoint to retrieve data from β€’ ​*How to fetch (optional) :*​ Configuration like HTTP headers for authentication β€’ ​*Where to place the data in OPA cache:*​ Uses the default
/
path at the root of OPA document hierarchy if not specified If you want to provide static empty data, your API endpoint (specified in the
url
field) would need to return
{}
when called. The OPAL client will fetch this empty object and place it in the OPA cache, allowing the client to start successfully even without actual data. For encoding this as an environment variable, you can use Python's
json.dumps()
to get a one-line string :
Copy code
{
  "config": {
    "entries": [
      {
        "url": "<https://api.permit.io/v1/policy-config>",
        "topics": [
          "policy_data"
        ],
        "config": {
          "headers": {
            "Authorization": "Bearer FAKE-SECRET"
          }
        }
      }
    ]
  }
}
To learn more, see the sources I considered: [[1] Data Source Configuration](https://docs.opal.ac/getting-started/running-opal/run-opal-server/data-sources)
o
Ugh AI did a poor job here. Here’s a better example of just passing data in the entry:
Copy code
OPAL_DATA_CONFIG_SOURCES={"config":{"entries":[{"url":"<http://opal_server:7002/policy-data>","topics":["policy_data"],"dst_path":"/static", "data":{} }]}}
πŸ‘€ 1
i
thanks will check and update !
ok i updated the server + client config with the configuration you sent + added the topic to the client, it looks like it connected to topic + to server but i still see its not healthy, adding configuration in next comment
the dataconfigsources + added the env var in client configuration
not sure maybe i need generate and add client token also (although looks like it connected)?
o
Hey @Itamar Shpak can you please attach the logs of the client after the configuration change ?
i
Hey adding here
a
Hey @Itamar Shpak, thanks for sharing this, Will make sure the team see it and will circle back to you soon
βœ… 1
i
thanks a lot!
πŸ’œ 1
Hey any news maybe ? πŸ™
a
Hey @Itamar Shpak, sorry for the delayed answer, @Dan is currently investigating it and will reply soon πŸ™πŸΌ
i
all good thanks for quick response! if it helps we can schedule a meeting
d
Hey @Itamar Shpak, sorry for the delays. I’m looking into it now I've noticed you configure those env variables on your OPAL Client
Copy code
extraEnv:
  - name: OPAL_DATA_UPDATER_ENABLED
    value: "FALSE"
  - name: OPAL_OPA_HEALTH_CHECK_POLICY_ENABLED
    value: "FALSE"
The issue is with OPAL Client not applying any data update on boot, therefor making the service considered as not healthy. Is this something intentional? I would like to understand better the use-case you are trying to setup to guide you best how to configure it properly.
i
hey @Dan i tried those env vars before to try and make it started, but no success, they are not applied now, currently I added only the OPAL_DATA_TOPICS env there
d
I see. You shouldn't need to configure the data topic too though. I'm starting to suspect that the Helm may misconfigure the data sources, since that setup seem correct. I'll consult with @Eli Moshkovich that knows best the OPAL Helm. Can you please export the deployment yaml and all env variables of the OPAL Server and OPAL Client deployments from your k8s cluster?
i
sure 1 sec sending deployments + our current values file
client-deployment.yaml,server-deployment.yaml,values.yaml
got the deployments with those command - kubectl get deployments.apps it-infra-cluster-opal-opal-server -n opal -o yaml
if you have any other preferred way feel free to share and ill send you, thanks πŸ™Œ
d
Thank you! Going over them and trying it out
The
OPAL_DATA_CONFIG_SOURCES
is not configured correctly, notice the
server-deployment.yaml
at lines 57-58 with empty entries for data sources. I'm checking it out and let you know what I find out ✨
e
Hey @Itamar Shpak! Found and fixed the issue. Will update you once the new release is published. Thanks for reporting! πŸ™
i
NP & Sure ! thank you πŸ™‚ waiting for updates, @Dan do you want that ill try to change the OPAL_DATA_CONFIG_SOURCES ? or should i wait for the new release ?
e
Hey @Itamar Shpak, The fix is now released in version 0.0.29! πŸŽ‰ Please try this new version and let us know if it works for you! πŸ™
i
Great thanks πŸ™Œ !! I will upgrade later today and will update youπŸ™
πŸ’œ 1
πŸš€ its working thanks !! will update if we'll have another questions thanks !πŸ™
πŸ’œ 2
πŸŽ‰ 1
Hey again πŸ™‚ do you have maybe a guide for migrating from styra or something ? Im trying to understand how I can export the datasources from there and add them to opal server?
a
Hey @Itamar Shpak, thanks for keeping in touch 😊 I’ll pass your question to the right people and get back to you as soon as possible!
πŸ™Œ 3
@Itamar Shpak We’re currently going through similar migration processes with other clients as well. You’re welcome to schedule a meeting with @Thomas using the following link: here I’ll also continue looking for reading materials that might be helpful for you.
βœ… 1
i
thanks ! scheduled