Skip to content

Modernize Docker and cluster deployment for the gRPC samples - #1797

Merged
mkurz merged 2 commits into
playframework:mainfrom
mkurz:modernize-grpc-docker
Nov 20, 2026
Merged

mkurz merged 2 commits into
playframework:mainfrom
mkurz:modernize-grpc-docker

Conversation

@mkurz

@mkurz mkurz commented Nov 20, 2026

Copy link
Copy Markdown
Member

Run both gRPC samples in Java 25 Temurin containers on Ubuntu 26.04, using sbt-native-packager's generated non-root launcher. This replaces the old Alpine/Bash workaround and explicitly trusts the existing bundled development certificate so the HTTP controller can call the gRPC service over TLS. Enable native access for the packaged JVM's Netty transport.

Update the Docker, Kubernetes and OpenShift guides together with their manifests:

  • Document local Docker startup and one-off ARM64/AMD64 publishing settings.
  • Use current Deployment/Ingress APIs, application Secrets and startup/readiness probes.
  • Bind HTTP and HTTPS to 0.0.0.0 so Service traffic and kubectl port-forward both work.
  • Apply restricted security settings without fixing the UID; keep the OpenShift hostname override in its own overlay.

Validation

Both Java and Scala samples were checked locally on Linux ARM64:

  • Java 17 / Scala 2.13.18 / sbt 2.1.0: uncached sample tests, Paradox documentation and HTTPS development mode.
  • Java 25 containers: HTTP and HTTPS requests as the default user and as 1000770000:0, with capabilities dropped and privilege escalation disabled for the arbitrary-UID runs.
  • Negative TLS checks: removing trust fails certificate validation; an incorrect authority fails hostname verification.
  • Multi-platform publication to a temporary local registry, with ARM64 and AMD64 manifests verified.
  • Kubernetes 1.37.2 / containerd on Minikube: restricted Pod Security admission, two ready replicas per sample, Service port-forwarding and NGINX Ingress requests.

After adding the native-access setting, rebuilt both images and repeated all four default/arbitrary-UID HTTP/HTTPS cases. The running JVM receives the option and the Netty native-access warning is gone; Guice's Unsafe warning remains visible.

Actual OpenShift deployment remains untested. Temporary clusters, containers, images and tooling were cleaned up; validation receipts and logs are retained locally.

Use native ARM64/AMD64 Temurin images with the generated non-root
launcher. Trust the bundled development certificate explicitly so the
HTTP controller can call the gRPC service in the packaged application,
and document Docker startup.

Enable native access explicitly for the packaged JVM because gRPC's
Netty transport intentionally loads native libraries on Java 25.
Use current Deployment and Ingress APIs, generated image entrypoints,
application Secrets, startup/readiness probes and Kustomize overlays.
Bind HTTP and HTTPS to 0.0.0.0 so both Service traffic and kubectl
port-forward can reach the samples.

Set non-root security contexts, disable privilege escalation, drop Linux
capabilities and use the runtime's default seccomp profile. Leave the UID
unspecified in the manifests so OpenShift can assign it.

Keep OpenShift hostname settings in an overlay-only deployment patch and
document Minikube image loading and OpenShift registry setup.
@mergify

mergify Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

This pull request is merged.

@mkurz
mkurz merged commit 468a314 into playframework:main Nov 20, 2026
34 checks passed
@mkurz
mkurz deleted the modernize-grpc-docker branch November 20, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant