Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix example docker-compose data sources configuration #627

Merged
merged 3 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ jobs:
- name: Output container logs
run: docker-compose -f docker/docker-compose-test.yml logs

- name: check if opal-client was brought up
- name: check if opal-client was brought up successfully
run: |
docker-compose -f docker/docker-compose-test.yml logs opal_client | grep "Connected to PubSub server"
docker-compose -f docker/docker-compose-test.yml logs opal_client | grep "Got policy bundle"
docker-compose -f docker/docker-compose-test.yml logs opal_client | grep 'PUT /v1/data/static -> 204'
3 changes: 1 addition & 2 deletions docker/docker-compose-api-policy-source-example.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.8"
services:
# When scaling the opal-server to multiple nodes and/or multiple workers, we use
# a *broadcast* channel to sync between all the instances of opal-server.
Expand Down Expand Up @@ -37,7 +36,7 @@ services:
# configures from where the opal client should initially fetch data (when it first goes up, after disconnection, etc).
# the data sources represents from where the opal clients should get a "complete picture" of the data they need.
# after the initial sources are fetched, the client will subscribe only to update notifications sent by the server.
- OPAL_DATA_CONFIG_SOURCES={"config":{"entries":[{"url":"http://host.docker.internal:7002/policy-data","topics":["policy_data"],"dst_path":"/static"}]}}
- OPAL_DATA_CONFIG_SOURCES={"config":{"entries":[{"url":"http://opal-server:7002/policy-data","topics":["policy_data"],"dst_path":"/static"}]}}
- OPAL_LOG_FORMAT_INCLUDE_PID=true
ports:
# exposes opal server on the host machine, you can access the server at: http://localhost:7002
Expand Down
1 change: 0 additions & 1 deletion docker/docker-compose-example-cedar.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.8"
services:
# When scaling the opal-server to multiple nodes and/or multiple workers, we use
# a *broadcast* channel to sync between all the instances of opal-server.
Expand Down
1 change: 0 additions & 1 deletion docker/docker-compose-example.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.8"
services:
# When scaling the opal-server to multiple nodes and/or multiple workers, we use
# a *broadcast* channel to sync between all the instances of opal-server.
Expand Down
1 change: 0 additions & 1 deletion docker/docker-compose-git-webhook.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.8"
services:
# When scaling the opal-server to multiple nodes and/or multiple workers, we use
# a *broadcast* channel to sync between all the instances of opal-server.
Expand Down
1 change: 0 additions & 1 deletion docker/docker-compose-scopes-example.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.8"
services:
redis:
image: redis
Expand Down
3 changes: 1 addition & 2 deletions docker/docker-compose-with-callbacks.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.8"
services:
# When scaling the opal-server to multiple nodes and/or multiple workers, we use
# a *broadcast* channel to sync between all the instances of opal-server.
Expand Down Expand Up @@ -32,7 +31,7 @@ services:
# configures from where the opal client should initially fetch data (when it first goes up, after disconnection, etc).
# the data sources represents from where the opal clients should get a "complete picture" of the data they need.
# after the initial sources are fetched, the client will subscribe only to update notifications sent by the server.
- OPAL_DATA_CONFIG_SOURCES={"config":{"entries":[{"url":"http://host.docker.internal:7002/policy-data","topics":["policy_data"],"dst_path":"/static"}]}}
- OPAL_DATA_CONFIG_SOURCES={"config":{"entries":[{"url":"http://opal_server:7002/policy-data","topics":["policy_data"],"dst_path":"/static"}]}}
- OPAL_LOG_FORMAT_INCLUDE_PID=true
ports:
# exposes opal server on the host machine, you can access the server at: http://localhost:7002
Expand Down
3 changes: 1 addition & 2 deletions docker/docker-compose-with-kafka-example.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.8"

services:
# Based on: https://developer.confluent.io/quickstart/kafka-docker/
Expand Down Expand Up @@ -70,7 +69,7 @@ services:
# configures from where the opal client should initially fetch data (when it first goes up, after disconnection, etc).
# the data sources represents from where the opal clients should get a "complete picture" of the data they need.
# after the initial sources are fetched, the client will subscribe only to update notifications sent by the server.
- OPAL_DATA_CONFIG_SOURCES={"config":{"entries":[{"url":"http://host.docker.internal:7002/policy-data","topics":["policy_data"],"dst_path":"/static"}]}}
- OPAL_DATA_CONFIG_SOURCES={"config":{"entries":[{"url":"http://opal-server:7002/policy-data","topics":["policy_data"],"dst_path":"/static"}]}}
- OPAL_LOG_FORMAT_INCLUDE_PID=true
ports:
# exposes opal server on the host machine, you can access the server at: http://localhost:7002
Expand Down
1 change: 0 additions & 1 deletion docker/docker-compose-with-oauth-initial.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.8"
services:
# When scaling the opal-server to multiple nodes and/or multiple workers, we use
# a *broadcast* channel to sync between all the instances of opal-server.
Expand Down
3 changes: 1 addition & 2 deletions docker/docker-compose-with-rate-limiting.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# This docker compose example shows how to configure OPAL's rate limiting feature
version: "3.8"
services:
# When scaling the opal-server to multiple nodes and/or multiple workers, we use
# a *broadcast* channel to sync between all the instances of opal-server.
Expand Down Expand Up @@ -31,7 +30,7 @@ services:
# configures from where the opal client should initially fetch data (when it first goes up, after disconnection, etc).
# the data sources represents from where the opal clients should get a "complete picture" of the data they need.
# after the initial sources are fetched, the client will subscribe only to update notifications sent by the server.
- OPAL_DATA_CONFIG_SOURCES={"config":{"entries":[{"url":"http://host.docker.internal:7002/policy-data","topics":["policy_data"],"dst_path":"/static"}]}}
- OPAL_DATA_CONFIG_SOURCES={"config":{"entries":[{"url":"http://opal-server:7002/policy-data","topics":["policy_data"],"dst_path":"/static"}]}}
- OPAL_LOG_FORMAT_INCLUDE_PID=true
# Turns on rate limiting in the server
# supported formats documented here: https://limits.readthedocs.io/en/stable/quickstart.html#rate-limit-string-notation
Expand Down
3 changes: 1 addition & 2 deletions docker/docker-compose-with-security.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# this docker compose file is relying on external environment variables!
# run it by running the script: ./run-example-with-security.sh
version: "3.8"
services:
# When scaling the opal-server to multiple nodes and/or multiple workers, we use
# a *broadcast* channel to sync between all the instances of opal-server.
Expand Down Expand Up @@ -46,7 +45,7 @@ services:
# after the initial sources are fetched, the client will subscribe only to update notifications sent by the server.
# please notice - since we fetch data entries from the OPAL server itself, we need to authenticate to that endpoint
# with the client's token (JWT).
- OPAL_DATA_CONFIG_SOURCES={"config":{"entries":[{"url":"http://host.docker.internal:7002/policy-data","config":{"headers":{"Authorization":"Bearer ${OPAL_CLIENT_TOKEN}"}},"topics":["policy_data"],"dst_path":"/static"}]}}
- OPAL_DATA_CONFIG_SOURCES={"config":{"entries":[{"url":"http://opal-server:7002/policy-data","config":{"headers":{"Authorization":"Bearer ${OPAL_CLIENT_TOKEN}"}},"topics":["policy_data"],"dst_path":"/static"}]}}
- OPAL_LOG_FORMAT_INCLUDE_PID=true
# --------------------------------------------------------------------------------
# the jwt audience and jwt issuer are not typically necessary in real setups
Expand Down
3 changes: 1 addition & 2 deletions docker/docker-compose-with-statistics.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.8"
services:
# When scaling the opal-server to multiple nodes and/or multiple workers, we use
# a *broadcast* channel to sync between all the instances of opal-server.
Expand Down Expand Up @@ -32,7 +31,7 @@ services:
# configures from where the opal client should initially fetch data (when it first goes up, after disconnection, etc).
# the data sources represents from where the opal clients should get a "complete picture" of the data they need.
# after the initial sources are fetched, the client will subscribe only to update notifications sent by the server.
- OPAL_DATA_CONFIG_SOURCES={"config":{"entries":[{"url":"http://host.docker.internal:7002/policy-data","topics":["policy_data"],"dst_path":"/static"}]}}
- OPAL_DATA_CONFIG_SOURCES={"config":{"entries":[{"url":"http://opal-server:7002/policy-data","topics":["policy_data"],"dst_path":"/static"}]}}
- OPAL_LOG_FORMAT_INCLUDE_PID=true
# turning on statistics collection on the server side
- OPAL_STATISTICS_ENABLED=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ This example is running three containers that we have mentioned at the beginning
Here is an overview of the whole `docker-compose.yml` file, but don't worry, we will be referring to each section separately.

```yml showLineNumbers
version: "3.8"
services:
broadcast_channel:
image: postgres:alpine
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ opal_server:
You can also simply change the tracked repo in the example `docker-compose.yml` file by editing these variables:

```yml {7,9,11} showLineNumbers
version: "3.8"
services:
...
opal_server:
Expand Down
Loading