Slackbot
12/15/2022, 2:55 PMAsaf Cohen
12/15/2022, 3:04 PMAsaf Cohen
12/15/2022, 3:04 PMNaveen
12/15/2022, 3:05 PMNaveen
12/15/2022, 4:36 PMapiVersion: 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: opal-server
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 hub url>"
- name: OPAL_DATA_CONFIG_SOURCES
value: '{"config":{"entries":[{"url":"<http://opal-server:7002/policy-data>","topics":["policy_data"],"dst_path":"/static"}]}}'
- name: OPAL_LOG_FORMAT_INCLUDE_PID
value: "true"
- name: OPAL_POLICY_REPO_MAIN_BRANCH
value: "master"
- name: OPAL_POLICY_REPO_WEBHOOK_SECRET
value: "<secret>"
Naveen
12/15/2022, 4:38 PM- name: opal-client
image: permitio/opal-client:latest
ports:
- containerPort: 7000
- containerPort: 8181
env:
- name: OPAL_SERVER_URL
value: "<opal server uri>"
- name: OPAL_LOG_FORMAT_INCLUDE_PID
value: "true"
- name: OPAL_INLINE_OPA_LOG_FORMAT
value: "http"
Asaf Cohen
12/15/2022, 5:22 PMAsaf Cohen
12/15/2022, 5:23 PM- name: OPAL_DATA_CONFIG_SOURCES
value: '{"config":{"entries":[{"url":"<http://opal-server:7002/policy-data>","topics":["policy_data"],"dst_path":"/static"}]}}'
Asaf Cohen
12/15/2022, 5:24 PMDATA_CONFIG_SOURCES = confi.model(
"DATA_CONFIG_SOURCES",
ServerDataSourceConfig,
confi.delay(
lambda ALL_DATA_URL="", ALL_DATA_TOPIC="": {
"config": {
"entries": [{"url": ALL_DATA_URL, "topics": [ALL_DATA_TOPIC]}]
}
}
),
description="Configuration of data sources by topics",
)
Asaf Cohen
12/15/2022, 5:25 PMAsaf Cohen
12/15/2022, 5:27 PMOPAL_DATA_CONFIG_SOURCES
2. define OPAL_ALL_DATA_URL
instead (set it to a dns that you know will be available from within the pod):
a. (not sure <http://opal-server:7002/policy-data>
is actually a valid DNS)Asaf Cohen
12/15/2022, 5:27 PMNaveen
12/15/2022, 5:38 PMNaveen
12/15/2022, 5:39 PMAsaf Cohen
12/15/2022, 5:39 PMmyurl:7002/policy-data
should return a json file that represents your data that you want to load into OPAAsaf Cohen
12/15/2022, 5:39 PMopal_client.data.fetcher ←[0m|←[31m←[1mERROR | Timeout while fetching url: <http://host.docker.internal:7002/policy-data←[0m>
←[33m←[1mTraceback (most recent call last):←[0m
Asaf Cohen
12/15/2022, 5:40 PM<http://host.docker.internal:7002/policy-data>
is not a url that the container can access (no such DNS)Asaf Cohen
12/15/2022, 5:40 PMNaveen
12/15/2022, 5:42 PMAsaf Cohen
12/15/2022, 5:44 PMOPAL_DATA_CONFIG_SOURCES
(which writes to /v1/data) and the static data files that are sourced from git (that are also written to /v1/data), that is why /v1/data/static is important - to prevent collisionAsaf Cohen
12/15/2022, 5:44 PMNaveen
12/15/2022, 5:44 PMAsaf Cohen
12/15/2022, 5:44 PMAsaf Cohen
12/15/2022, 5:45 PMAsaf Cohen
12/15/2022, 5:45 PMNaveen
12/15/2022, 5:46 PMAsaf Cohen
12/15/2022, 5:50 PMNaveen
12/15/2022, 5:50 PMAsaf Cohen
12/15/2022, 5:50 PMAsaf Cohen
12/15/2022, 5:50 PMThe opal server yaml file which i have shared with that configuration myurl:7002/policydata should return json right? There is no other configuration I missed
Asaf Cohen
12/15/2022, 5:50 PMAsaf Cohen
12/15/2022, 5:50 PM"dst_path":"/static"
is considered safe, but it can be any path that is not "/"Naveen
12/15/2022, 5:52 PMAsaf Cohen
12/15/2022, 5:53 PMNaveen
12/16/2022, 12:31 PMNaveen
12/16/2022, 2:35 PMOr Weis
12/16/2022, 5:11 PMAsaf Cohen
12/16/2022, 5:24 PMNaveen
01/02/2023, 5:02 AM