Skip to content

test: enforce restricted PSS for CI user namespace - #3674

Open
vikas-saxena02 wants to merge 4 commits into
kubeflow:masterfrom
vikas-saxena02:restricted-pss-user-namespace
Open

vikas-saxena02 wants to merge 4 commits into
kubeflow:masterfrom
vikas-saxena02:restricted-pss-user-namespace

Conversation

@vikas-saxena02

@vikas-saxena02 vikas-saxena02 commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

✏️ Summary of Changes

This pull request continues #3487 by @danish9039 and @abdullahpathan22, which I have taken over, and supersedes it. Their work is squashed and rebased onto master, and both are credited as co-authors.

tests/kubeflow_profile_install.sh stays on Pod Security Standards baseline by default, and twelve individual workflows opt in to restricted with an argument. Regular installations are unchanged, and kustomize build example still renders empty Pipelines security context defaults.

Carried over from #3487

  • The Katib and Pipelines overlays for continuous integration, selected only when GITHUB_ACTIONS is set.
  • The restricted security contexts for the Katib, KServe, Notebook and Istio validation workloads.
  • Waiting for pipeline run completion in tests/pipeline_run_and_wait_kubeflow.py.
  • The workflow path filter updates.

Dropped or replaced, and why

  • Katib timeout increases in tests/katib_test.sh. The reason for them was not in the review discussion, and master also changed this file, so the master version is restored.
  • Dashboard timeout increases in tests/dashboard_install.sh. They have the same open question, and the dashboard runs outside the user namespace, so the master version is restored.
  • Runtime dump in tests/trainer_test.sh. It was diagnostic output only, so the master version is restored.
  • Trainer overlay and tests/trainer_install.sh changes. The Trainer fixes belong upstream first, so trainer_test stays on baseline.
  • Live Ray kubectl patch in experimental/ray/test.sh. master rewrote this script. The autoscaler security context is now declared in experimental/ray/raycluster_example.yaml.
  • runAsUser: 1000 in the KServe workloads. The sklearn server image declares user 1000.
  • Separate Pipelines configuration file. The restricted Pipelines values are now an inline patch in applications/pipeline/restricted-pss/kustomization.yaml.
  • KF_PROFILE_PSS switch. Workflows now pass restricted to tests/kubeflow_profile_install.sh directly.

Added

  • ray_test now uses tests/kubeflow_profile_install.sh restricted.
  • Security contexts for the Spark notebook fixture and the Spark Connect server and executor pods, because those workflows were merged after test: enforce restricted PSS for CI user namespace #3487 was last rebased.
  • Each pipeline status request is now bounded by the remaining deadline, so a stalled API reaches the failure diagnostics. The timer is disarmed in a finally block, so it cannot interrupt them.
  • Path filters for the restricted dependencies in the Keycloak, Pipelines, Notebook and Workspace workflows.

Remaining limitations

  • The Trainer, full integration and Helm workflows stay on baseline.
  • runAsUser remains only where the image does not declare a numeric non-root user: Katib, Pipelines, the Istio validation client and Spark.
  • The Katib overlay remains a full copy of katib-config.yaml until config: add restricted PSS contexts for suggestions katib#2683 is released and synchronized.

📦 Dependencies

None.

🐛 Related Issues

Supersedes #3487. Related to #3562.

✅ Contributor Checklist

  • I have tested these changes with kustomize. See Installation Prerequisites.
  • All commits are signed-off to satisfy the DCO check.
  • I have considered adding my company to the adopters page to support Kubeflow and help the community, since I expect help from the community for my issue (see 1. and 2.).

You can join the CNCF Slack and access our meetings at the Kubeflow Community website. Our channel on the CNCF Slack is here [#kubeflow-community-distribution](https://cloud-native.slack.com/archives/C0

@google-oss-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign kimwnasptd for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@vikas-saxena02

Copy link
Copy Markdown
Contributor Author

@danish9039 Thank you for the groundwork in #3487. This pull request continues your work, and you are credited as a co-author.

I dropped the Katib and dashboard timeout increases because I could not find the reason for them in the review discussion.

  • Please review this pull request and tell me if I have missed anything.
  • If continuous integration needed those timeouts, please tell me what failed, so that I can add them back with that context. Otherwise, i will have to rely on the ci checks again here.

@vikas-saxena02

Copy link
Copy Markdown
Contributor Author

@juliusvonkohout Both Helm workflows currently stay on baseline through KF_PROFILE_PSS. Moving them to restricted requires exposing new values in the Pipelines, Katib and Trainer charts and their generators, without changing the chart defaults.

This pull request also keeps a full copy of katib-config.yaml in applications/katib/overlays/security until the fix from kubeflow/katib#2683 is merged, released and synchronized.

  • Should Helm move to restricted in this pull request, or in a follow-up?
  • I am expecting some flaky tests here because of config: add restricted PSS contexts for suggestions katib#2683. Given that Katib is being decommissioned, I need to raise a new pull request for this fix. Will you be able to get it merged as a priority, as it may become a dependency for this pull request?

I will follow your preference on Helm once this draft has continuous integration results.

@vikas-saxena02

Copy link
Copy Markdown
Contributor Author

waiting for ci check to pass so marking this as not ready

/hold

@vikas-saxena02

Copy link
Copy Markdown
Contributor Author

all checks passed
/hold cancel

Comment thread tests/trainer_install.sh Resolved
Comment thread tests/katib_test.yaml Resolved
@juliusvonkohout

Copy link
Copy Markdown
Member

We can merge a smaller PR first that does not need any trainer upstream fixes. and yes we need to stick to pss baseline by default for now for regular installations, but in the individual gha tests we can swith to restricted where possible.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The restricted-security defaults break KFP dependency installation for non-root pipeline components, causing notebook checks to fail, while unbounded status requests can exceed the intended deadline.

2 open issues
What changed in this PR

This pull request extends Kubeflow continuous integration to exercise user workloads under restricted Pod Security Standards, continuing #3487 and addressing #3562. Regular installation defaults remain unchanged, while the two Helm workflows explicitly retain baseline enforcement.

Changes:

  • Add restricted Katib, Trainer, and Pipelines overlays selected by GitHub Actions.
  • Update workload security contexts and restore pipeline completion checks with failure diagnostics.
  • Expand workflow path filters and route Ray Profile creation through the shared installation script.
File Description
tests/​trainer_install.sh Selects restricted runtimes in continuous integration.
tests/​spark_connect_session.py Adds driver and executor security contexts.
tests/​pipelines_install.sh Selects the restricted Pipelines overlay.
tests/​pipeline_run_and_wait_kubeflow.py Restores completion polling and failure diagnostics.
tests/​notebook.test.kubeflow-user-example.com.yaml Adds restricted Notebook security settings.
tests/​notebook.spark.test.kubeflow-user-example-com.yaml Adds restricted Spark Notebook security settings.
tests/​kubeflow_profile_install.sh Applies and verifies Profile namespace policy labels.
tests/​kserve_test.sh Adds predictor security contexts and adjusts authorization readiness checks.
tests/​kserve_sklearn_test.py Adds a restricted predictor security context.
tests/​katib_test.yaml Configures non-root training with a writable working directory.
tests/​katib_install.sh Selects the security overlay and waits for controller rollout.
experimental/​ray/​raycluster_example.yaml Declares restricted autoscaler security settings.
applications/​trainer/​overlays/​runtimes-restricted/​patches/​torch-distributed-restricted-pss.yaml Adds restricted Torch runtime settings.
applications/​trainer/​overlays/​runtimes-restricted/​kustomization.yaml Composes the restricted Trainer overlay.
applications/​pipeline/​restricted-pss/​pipeline-install-config-restricted-pss.yaml Sets non-root pipeline identity defaults.
applications/​pipeline/​restricted-pss/​kustomization.yaml Layers continuous-integration defaults over regular Pipelines manifests.
applications/​katib/​overlays/​security/​kustomization.yaml Replaces Katib configuration for restricted testing.
applications/​katib/​overlays/​security/​katib-config.yaml Enables security-context injection and configures suggestion containers.
.github/​workflows/​workspaces_pipeline_run_test.yaml Tracks restricted overlay and shared policy changes.
.github/​workflows/​volumes_web_application_test.yaml Tracks Profile installation changes.
.github/​workflows/​trainer_test.yaml Replaces obsolete policy trigger paths.
.github/​workflows/​ray_test.yaml Uses and tracks shared Profile installation.
.github/​workflows/​pipeline_test.yaml Expands pipeline and policy trigger coverage.
.github/​workflows/​pipeline_run_from_notebook.yaml Tracks pipeline tests, restricted overlays, and policy scripts.
.github/​workflows/​kserve_test.yaml Tracks shared policy scripts.
.github/​workflows/​katib_test.yaml Tracks Katib tests, overlays, and policy scripts.
.github/​workflows/​istio_validation.yaml Uses a restricted connectivity Pod and updates triggers.
.github/​workflows/​helm-pipelines-test.yaml Explicitly retains baseline Profile enforcement.
.github/​workflows/​helm_kubeflow_integration_test.yaml Explicitly retains baseline Profile enforcement.
.github/​workflows/​dex_oauth2-proxy_test.yaml Replaces obsolete policy trigger paths.

Review effort: Balanced

Comment thread tests/pipeline_run_and_wait_kubeflow.py Resolved
@vikas-saxena02
vikas-saxena02 force-pushed the restricted-pss-user-namespace branch from 868bdcf to 72e372e Compare November 5, 2026 01:40
@vikas-saxena02

Copy link
Copy Markdown
Contributor Author

We can merge a smaller PR first that does not need any trainer upstream fixes. and yes we need to stick to pss baseline by default for now for regular installations, but in the individual gha tests we can swith to restricted where possible.

@juliusvonkohout Done. tests/kubeflow_profile_install.sh now defaults to baseline, and twelve individual workflows pass restricted as an argument. The Trainer, full integration and Helm workflows stay on baseline, and the Trainer overlay is removed. The KF_PROFILE_PSS switch is gone, and regular installations are unchanged. Please take another look when continuous integration finishes.

@vikas-saxena02

Copy link
Copy Markdown
Contributor Author

/retest

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Restricted-policy validation remains incomplete, the pipeline timer can interrupt failure diagnostics, and missing workflow path filters allow relevant changes to bypass integration tests.

5 open issues
2 resolved since last review

Review effort: Max

Comment thread tests/kubeflow_profile_install.sh Resolved
Comment thread tests/pipeline_run_and_wait_kubeflow.py Resolved
vikas-saxena02 and others added 3 commits November 28, 2026 06:11
Co-authored-by: abdullahpathan22 <abdullahpathan22@users.noreply.github.com>
Co-authored-by: danish9039 <danishsiddiqui040@gmail.com>
Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>
Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>
Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>
@vikas-saxena02
vikas-saxena02 force-pushed the restricted-pss-user-namespace branch from e331df0 to df47de6 Compare November 27, 2026 19:11
Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants