Skip to content

Commit e210cbb

Browse files
author
arpechenin
committed
- add token securing description
- fix broken link Signed-off-by: arpechenin <[email protected]>
1 parent d57c3ff commit e210cbb

File tree

4 files changed

+22
-2
lines changed

4 files changed

+22
-2
lines changed

proposals/separate-standalone-driver/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ Below is a scheme where, instead of creating a pod for the driver's task, we reu
151151
152152
153153
To move from the container template to the Executor Plugin template:
154-
- patch the [Argo compiler](https://github.com/kubeflow/pipelines/tree/a870b1a325dae0c82c8b6f57941468ee1aea960b/backend/src/v2/compiler/argocompiler) to generate a plugin template instead of a container template. Sample: hello-world [adapted](kfp-plugin-flow.png) (see name: system-container-driver)
154+
- patch the [Argo compiler](https://github.com/kubeflow/pipelines/tree/a870b1a325dae0c82c8b6f57941468ee1aea960b/backend/src/v2/compiler/argocompiler) to generate a plugin template instead of a container template. Sample: hello-world [adapted](hello_world_plugin.yaml) (see name: system-container-driver)
155155
- Namely, replace the templates used in the [container-driver](https://github.com/kubeflow/pipelines/blob/a870b1a325dae0c82c8b6f57941468ee1aea960b/backend/src/v2/compiler/argocompiler/container.go#L148) and [dag-driver](https://github.com/kubeflow/pipelines/blob/a870b1a325dae0c82c8b6f57941468ee1aea960b/backend/src/v2/compiler/argocompiler/dag.go#L156) section of the compiler
156156
- Extract the [driver](https://github.com/kubeflow/pipelines/tree/a870b1a325dae0c82c8b6f57941468ee1aea960b/backend/src/v2/driver) component into a standalone server.
157157
- Implement the [plugin](plugin.md)
79.7 KB
Loading

proposals/separate-standalone-driver/plugin.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,15 @@ However, by default, the Argo Workflow Controller does not mount the service acc
3333
As a result, to enable access to the Kubernetes API:
3434
1. Create ServiceAccount in each profile namespace with the name `driver-plugin-executor-plugin`. Argo WF [expects](https://github.com/argoproj/argo-workflows/blob/main/workflow/controller/agent.go#L285) the format <plugin-name>-executor-plugin
3535
2. Add a Role with appropriate Kubernetes API access and bind it to the service account.
36-
3. Configure `sidecar.automountServiceAccountToken` see [example](plugin.yaml)
36+
3. Configure `sidecar.automountServiceAccountToken` see [example](plugin.yaml)
37+
38+
### Securing the driver sidecar container
39+
The driver's sidecar [exposes](https://argo-workflows.readthedocs.io/en/latest/executor_plugins/#example-a-simple-python-plugin) the HTTP `/api/v1/template.execute` API externally. So hypothetically not only Argo WF Controller able to call it.
40+
To prevent unauthorized access
41+
by default (without extra customization):
42+
- The Argo Workflow Controller mounts the `/var/run/argo` volume into the executor agent pod (which hosts the plugin sidecar). This volume contains a token.
43+
- The Argo Workflow Controller includes the same token in the authorization Bearer header of each execution request.
44+
additionally:
45+
The central driver needs to read the token from `/var/run/argo/token` and compare it with the token from the request header.
46+
More details are available [here](https://argo-workflows.readthedocs.io/en/latest/executor_plugins/#example-a-simple-python-plugin)
47+

proposals/separate-standalone-driver/plugin.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,12 @@ data:
1212
name: driver-plugin
1313
resources:
1414
...
15+
securityContext:
16+
allowPrivilegeEscalation: false
17+
capabilities:
18+
drop:
19+
- ALL
20+
readOnlyRootFilesystem: true
21+
runAsNonRoot: true
22+
runAsUser: 1000 # Must run as a non-nobody user to access the token inside the /var/run/argo volume from the sidecar
23+

0 commit comments

Comments
 (0)