Skip to content

Commit d7dbc76

Browse files
author
arpechenin
committed
- add descriptions of the problem with accessing the Kubernetes API from the agent pod.
Signed-off-by: arpechenin <[email protected]>
1 parent 428142c commit d7dbc76

File tree

3 files changed

+85
-3
lines changed

3 files changed

+85
-3
lines changed

proposals/separate-standalone-driver/README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ It creates a pod that launches the driver container using the kfp-driver image.
7373
## Alternative
7474
7575
Instead of launching a new driver's pod using a container template, configure the system to send requests to an already running server.
76-
Something like this:
76+
Something like this (showing both types of containers):
7777
```yaml
7878
templates:
7979
- name: system-container-driver
8080
request:
81-
args:
81+
args:
8282
...
8383
outputs:
8484
parameters:
@@ -87,6 +87,27 @@ Something like this:
8787
- name: cached-decision
8888
jsonPath: $.cached_decision
8989
```
90+
```yaml
91+
- name: system-dag-driver
92+
request:
93+
args:
94+
...
95+
outputs:
96+
parameters:
97+
- name: execution-id
98+
valueFrom:
99+
jsonPath: $.execution-id
100+
- name: iteration-count
101+
valueFrom:
102+
default: "0"
103+
jsonPath: $.iteration-count
104+
- name: condition
105+
valueFrom:
106+
default: "true"
107+
jsonPath: $.condition
108+
```
109+
110+
90111
### Requirements:
91112
- Execute a remote call with parameters
92113
- Read the response

proposals/separate-standalone-driver/hello_world_plugin.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ spec:
6767
run_id: '{{workflow.uid}}'
6868
task: '{{inputs.parameters.task}}'
6969
type: CONTAINER
70+
namespace: '{{workflow.namespace}}'
7071
- dag:
7172
tasks:
7273
- arguments:
@@ -232,6 +233,7 @@ spec:
232233
runtime_config: '{{inputs.parameters.runtime-config}}'
233234
task: '{{inputs.parameters.task}}'
234235
type: '{{inputs.parameters.driver-type}}'
236+
namespace: '{{workflow.namespace}}'
235237
- dag:
236238
tasks:
237239
- arguments:

proposals/separate-standalone-driver/plugin.md

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,63 @@ After that, you will be able to reference the corresponding driver plugin in you
2424
plugin:
2525
driver-plugin:
2626
...
27-
```
27+
```
28+
29+
### Problem: Interaction With the Kubernetes API From a Sidecar Container
30+
The driver [requires](https://github.com/kubeflow/pipelines/blob/master/backend/src/v2/driver/k8s.go#L68) access to the k8s API.
31+
However, the required volume with the service account secret (/var/run/secrets/kubernetes.io/serviceaccount) is mounted only into the main (driver) container, but not into the sidecar container.
32+
Below is a sample YAML snippet showing the container definitions in the agent pod.
33+
```yaml
34+
Containers:
35+
driver-plugin:
36+
Image: .../kfp-driver-agent:2.4.1-63
37+
Port: 2948/TCP
38+
Host Port: 0/TCP
39+
Restart Count: 0
40+
Limits:
41+
cpu: 1
42+
memory: 1Gi
43+
Requests:
44+
cpu: 250m
45+
memory: 512Mi
46+
Environment:
47+
DRIVER_HOST: http://ml-pipeline-kfp-driver.kubeflow.svc
48+
DRIVER_PORT: 2948
49+
SERVER_PORT: 2948
50+
TIMEOUT_SECONDS: 120
51+
Mounts:
52+
/etc/gitconfig from gitconfig (ro,path="gitconfig")
53+
/var/run/argo from var-run-argo (ro,path="driver-plugin")
54+
main:
55+
Image: .../ml-platform/argoexec:v3.6.7
56+
Command:
57+
argoexec
58+
Args:
59+
agent
60+
main
61+
--loglevel
62+
info
63+
--log-format
64+
text
65+
--gloglevel
66+
0
67+
Ready: True
68+
Restart Count: 2
69+
Limits:
70+
cpu: 100m
71+
memory: 256M
72+
Requests:
73+
cpu: 10m
74+
memory: 64M
75+
Environment:
76+
ARGO_WORKFLOW_NAME: debug-component-pipeline-7bgps
77+
ARGO_WORKFLOW_UID: 03caea4e-70c1-4113-b700-b7183271f3b6
78+
ARGO_AGENT_PATCH_RATE: 10s
79+
ARGO_PLUGIN_ADDRESSES: ["http://localhost:2948"]
80+
ARGO_PLUGIN_NAMES: ["driver-plugin"]
81+
Mounts:
82+
/etc/gitconfig from gitconfig (ro,path="gitconfig")
83+
/var/run/argo from var-run-argo (rw)
84+
/var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-z9nt6 (ro)
85+
```
86+
As a workaround, it makes sense to use the agent pod only as a proxy to the kfp-driver-server.

0 commit comments

Comments
 (0)