Skip to content

Commit 1eb5923

Browse files
committed
Try mounting kernel modules.
1 parent 0d09a41 commit 1eb5923

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

generate_compose.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def fetch_agent_info(agentbeats_id: str) -> dict:
7474
depends_on:{green_depends}
7575
networks:
7676
- agent-network
77-
{k8s_service_options}
77+
{extra_options}
7878
7979
{participant_services}
8080
agentbeats-client:
@@ -184,11 +184,17 @@ def generate_docker_compose(scenario: dict[str, Any], app: str) -> str:
184184
participant_names = [p["name"] for p in participants]
185185

186186
# Expose kubeconfig and localhost for k8s app to allow communication with kind cluster
187-
k8s_service_options = """extra_hosts:
188-
- "host.docker.internal:host-gateway"
189-
volumes:
187+
extra_options = ""
188+
if app == "k8s":
189+
extra_options = """volumes:
190190
- ./kubeconfig:/root/.kube/:ro
191-
"""
191+
extra_hosts:
192+
- "host.docker.internal:host-gateway"
193+
"""
194+
elif app == "route":
195+
extra_options = """volumes:
196+
- /lib/modules:/lib/modules
197+
"""
192198

193199
participant_services = "\n".join([
194200
PARTICIPANT_TEMPLATE.format(
@@ -215,7 +221,7 @@ def generate_docker_compose(scenario: dict[str, Any], app: str) -> str:
215221
participant_services=participant_services,
216222
client_depends=format_depends_on(all_services),
217223
privileged=str(app == "route").lower(),
218-
k8s_service_options=k8s_service_options if app == "k8s" else ""
224+
extra_options=extra_options
219225
)
220226

221227

0 commit comments

Comments
 (0)