PAT-1963 Move App-family CRD definitions out of k8s-client - #549
Merged
Conversation
…ster via extraClients BREAKING CHANGE: App/AppRun models, BaseApi, typed clients and the facade apps()/appRuns() accessors are removed. Consumers register their own CRD clients via KubernetesApiClientFacade $extraClients + client().
… README CRD section
…sal facade factory
Replace the four *ClientFacadeFactory classes with a KubernetesApiClientFactory
strategy family (Static/InCluster/EnvVariables/AutoDetect), each producing a
single configured KubernetesApiClient, plus one universal
KubernetesApiClientFacadeFactory that assembles a KubernetesApiClientFacade
from any of them. This separates credential resolution from facade assembly
and removes the indirection through a shared "generic" factory.
BREAKING CHANGE: removed Keboola\K8sClient\ClientFacadeFactory\GenericClientFacadeFactory,
InClusterClientFacadeFactory, EnvVariablesClientFacadeFactory and
AutoDetectClientFacadeFactory (and their Token\* originals). Replaced by
Keboola\K8sClient\ClientFactory\StaticKubernetesApiClientFactory,
InClusterKubernetesApiClientFactory, EnvVariablesKubernetesApiClientFactory,
AutoDetectKubernetesApiClientFactory (all implementing
KubernetesApiClientFactory::createApiClient(?string $namespace): KubernetesApiClient)
and KubernetesApiClientFacadeFactory::create(KubernetesApiClient, array $extraClients = []): KubernetesApiClientFacade.
ClientConfigurator and Token\{TokenInterface,StaticToken,InClusterToken} moved
to the Keboola\K8sClient\ClientFactory namespace.
…ct FakeCrdModel fixture - AutoDetect probes in-cluster availability without the caller namespace, matching the original AutoDetectClientFacadeFactory (the in-cluster branch also requires the namespace file). - Move FakeCrdModel to its own PSR-4 file so KubernetesApiClientFacadeFactoryTest no longer depends on a fixture defined inside another test file (fixed an isolation-order error).
…piClientFacade::create() BREAKING CHANGE: KubernetesApiClientFacadeFactory is removed; build the facade via the static named constructor KubernetesApiClientFacade::create(KubernetesApiClient, LoggerInterface, array $extraClients). Also drops the misleading @internal from KubernetesApiClient (it is the public construction seam) and documents $extraClients + a Symfony wiring recipe in the README.
pepamartinec
marked this pull request as ready for review
July 27, 2026 07:45
keboola-pr-reviewer-bot
left a comment
There was a problem hiding this comment.
Verdict: needs_human (risk 3/5) · profile ajda
reviewer stopped after 1/18 turns without emitting a verdict — escalating to human.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release Notes
https://linear.app/keboola/issue/PAT-1963/move-app-family-crd-definitions-from-keboolak8s-client-into-sandboxes
Note
Pridani podpory pro custom/extra API na client facade, presunuti App-related CRD primo do
sandboxes-servicek8s-clientlib s kazdou zmenou CRD (a ted jich zase bude dost)Two related breaking changes to
keboola/k8s-client, released together as5.0.0:1.
apps.keboola.comApp-family removed. TheApp/AppRunmodels,BaseApi, and typed clients (and the facade'sapps()/appRuns()accessors) are gone — they now live insandboxes-service. The App Deployments work iterates heavily on these CRDs; owning them in the consuming service removes the library-release + composer-bump roundtrip for every CRD tweak. The facade instead exposes a genericclient(<modelClass>)accessor and an$extraClientsregistry (array<class-string, ApiClientInterface>) that consumers populate with their own CRD clients; the generic facade methods (mergePatch,deleteAllMatching,get, …) all work for any registered type.2. Factory layer split into client factories + one universal facade factory. The four
Keboola\K8sClient\ClientFacadeFactory\{Generic,InCluster,EnvVariables,AutoDetect}ClientFacadeFactoryclasses differed only in how they produced a configured client. They are replaced by aKeboola\K8sClient\ClientFactory\strategy family —KubernetesApiClientFactory(interface,createApiClient(?ns): KubernetesApiClient) withStatic/InCluster/EnvVariables/AutoDetectimplementations. The facade is then assembled from that client by a static named constructorKubernetesApiClientFacade::create(KubernetesApiClient, LoggerInterface, $extraClients)(no separate facade-factory class).ClientConfigurator+Token\*moved intoClientFactory\, the misleading@internalwas dropped fromKubernetesApiClient(it's the public construction seam), and the README now documents$extraClients+ a Symfony wiring recipe.sandboxes-serviceupdate — owns the relocated classes and is the reference adopter of the new factory API: https://github.com/keboola/sandboxes-service/pull/637Migration (for the other five
keboola/k8s-clientconsumers)connection,job-queue,job-queue-daemon,runner-sync-api,sandboxesstay on^4.x(unaffected until they opt into^5.0) and migrate on their own schedule. When bumping to5.0.0:new <X>ClientFacadeFactory(...)->createClusterClient(...)with: build aClientFactory\<X>KubernetesApiClientFactory(credentials in its constructor), callcreateApiClient(?ns)to get aKubernetesApiClient, then the staticKubernetesApiClientFacade::create($apiClient, $logger[, $extraClients]).ClientFacadeFactory\ClientConfigurator/ClientFacadeFactory\Token\*imports toClientFactory\….apps()/appRuns()or anyModel\Io\Keboola\Apps\*class (none of these five do today), those are gone — register your own client via$extraClientsand useclient().Non-blocking follow-ups noted in review (deferred): identifier-scope the 3 remaining generic-registry
@phpstan-ignore; append "plus registered extra CRD types" to thedeleteAllMatchingdefault-set docblock; drop leftoverapps.keboola.comRBAC inprovisioning/local/kubernetes/main.tf.Plans for customer communication
None.
Impact analysis
No end-user impact. Internal library change; the sole consumer of the removed App-family classes (
sandboxes-service) is updated in the linked PR. Breaking for consumers of the old factory classes — the other five are unaffected until they choose to bump to^5.0and migrate per the note above.Change type
Refactoring
Justification
Prerequisite for the App Deployments model — CRD shape changes become single-repo edits in
sandboxes-service; the factory split cleanly separates credential resolution from facade assembly.Deployment
Merge to
main, then push tagk8s-client/5.0.0to publish the major release.Rollback plan
Revert of this PR.
Post release support plan
None.