Skip to content

policy-test: use local registry - #2583

Draft
davidweisse wants to merge 1 commit into
dav/policy-test-suitefrom
dav/suite-local-registry
Draft

policy-test: use local registry#2583
davidweisse wants to merge 1 commit into
dav/policy-test-suitefrom
dav/suite-local-registry

Conversation

@davidweisse

Copy link
Copy Markdown
Member

This uses the --insecure-registry flag from #2580 to configure a local registry via crane registry serve during the policy test suite evaluation. To use this, first run just policy-registry and wait until it says Registry is ready.. Then run just policy. The first target will start a local registry via crane registry serve and push the needed images into it while also writing to the image replacements file.

One problem is: genpolicy also pulls the configured pause image (ghcr.io/edgelesssys/kuberenetes/pause:3.6 in our case), which cannot be replaced by the image replacements file, since it isn't present in any of the deployment YAMLs. We configure ghcr.io as an insecure registry and set up an HTTP proxy that reroutes requests to ghcr.io to the local registry. For this to work, we of course push the pause image to the local registry beforehand.

Doing some testing, I get the following results:

  • The first image pull will always take longer, as it has to pull the layers. About 2-3s to pull busybox from a local registry.
  • Subsequent pulls only need the manifest/config, this takes ~120ms.
  • Policy evaluation takes ~30-50ms for each RPC request.

Fixes CON-251

This PR is currently rebased on both #2580 and #2582, so only the most recent commit is relevant.

@davidweisse davidweisse added the no changelog PRs not listed in the release notes label Aug 10, 2026
@linear-code

linear-code Bot commented Aug 10, 2026

Copy link
Copy Markdown

CON-251

@davidweisse
davidweisse force-pushed the dav/suite-local-registry branch from fc7a027 to 1f0f237 Compare August 12, 2026 10:54
@davidweisse
davidweisse changed the base branch from main to dav/policy-test-suite August 12, 2026 10:55
@davidweisse
davidweisse force-pushed the dav/policy-test-suite branch 3 times, most recently from ecd4a47 to 7c9e278 Compare August 19, 2026 11:12
@davidweisse
davidweisse force-pushed the dav/suite-local-registry branch from 1f0f237 to 15decf2 Compare August 19, 2026 12:17
@davidweisse

Copy link
Copy Markdown
Member Author

Update: Instead of the weird proxy setup, we can dynamically overwrite the pause image in the genpolicy settings file before running contrast generate. We can then explicitly pass that file to generate via a command line flag.

Also, with the rebase, the rego evaluation timing goes down to <10ms (~10-20ms max for CreateContainerRequest and <1ms for for others)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog PRs not listed in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant