Files
floci/src/main/java/io
Priamo Germosen 97ce09f22a fix(lambda): replace the fabric8 kubernetes client with a plain REST client (#2919)
* fix(lambda): replace the fabric8 kubernetes client with a plain REST client

quarkus-kubernetes-client was an always-on dependency, so the fabric8 client
and its generated Kubernetes model classes were reachable in every native
image regardless of whether floci.services.lambda.executor was ever set to
kubernetes. That was the single largest contributor to a ~20% native image
size increase last month (issue #2914).

The kubernetes executor only ever needs a handful of plain REST calls
(create/get/list/delete pods, create-or-update a ConfigMap, stream logs)
against a plain JSON HTTPS API, the same shape Floci already talks to AWS
in without an SDK. KubernetesApiClient replaces the fabric8 client with the
JDK HttpClient (as FlinkRestClient already does for another container
orchestrator's REST API), so the dependency is gone entirely rather than
merely unused: it no longer appears anywhere in the packaged application,
native or JVM.

Connection resolution mirrors kubectl's for the common cases: in-cluster
service account (token re-read per call since projected tokens rotate, CA
loaded once), or a kubeconfig's current-context with a static bearer token
or client-certificate/client-key (PKCS#8) credential. exec/auth-provider
credential plugins (e.g. aws eks get-token) are not supported and fail
with a clear error naming the limitation.

LambdaPodSpecFactory now builds the pod manifest as a plain JSON tree
instead of fabric8 builders. Tests keep using fabric8's kubernetes-server-mock
as a fake API server (test-scope only, so it never reaches the shipped
artifact) and point KubernetesApiClient at it over HTTP(S) instead of
constructing a fabric8 client directly.

* fix(lambda): support insecure-skip-tls-verify and drop stale test devservices config

kubeconfig's insecure-skip-tls-verify (the common kind/minikube dev-cluster
case) fell through to the default trust store and failed with a generic
PKIX error instead of a named limitation like every other unsupported
kubeconfig case. Honor it: skip both chain and hostname validation,
matching kubectl. Verified against a real self-signed HTTPS server, both
with and without the flag, so a regression here fails loudly.

Also drops src/test/resources/application.yml's leftover
quarkus.kubernetes-client.devservices block: with the extension gone from
pom.xml that key is unrecognized config pointing at a dependency that no
longer exists.
2026-09-02 17:40:21 -05:00
..