NAME

Kubernetes::Comb::Client::Async - Asynchronous Comb client on Net::Async::Kubernetes

VERSION

version 0.001

SYNOPSIS

use IO::Async::Loop;
use Kubernetes::Comb::Client::Async;

my $loop = IO::Async::Loop->new;
my $k8s  = Kubernetes::Comb::Client::Async->new(loop => $loop, context => 'dev');
my $k8s  = Kubernetes::Comb::Client::Async->new(kube => $kube);   # your own client

$k8s->list('Pod', namespace => 'platform')->then(sub {
  my ( $list ) = @_;
  ...
});

DESCRIPTION

The client of Kubernetes::Comb::Role::Client for an IO::Async program. Every request goes through Net::Async::Kubernetes and returns its Future; the loop runs the request. Where Net::Async::Kubernetes croaks instead of failing -- bad arguments to update, update_status, ensure -- the croak becomes a failed Future too.

IO::Async and Net::Async::Kubernetes are optional dependencies of Kubernetes::Comb. Loading this module without them dies with a message naming the missing one. The client needs Net::Async::Kubernetes 0.009 for ensure, update_status, patch_status and delete with a propagationPolicy, and an older one is refused the same way, when this module is loaded: the message names the version needed, the version found and the file it was found in.

kubeconfig

Path of the kubeconfig to read. Defaults to what Net::Async::Kubernetes finds: $KUBECONFIG, then ~/.kube/config, then the in-cluster service account.

context

Kube context to use. Defaults to the kubeconfig's current context.

kube

The Net::Async::Kubernetes instance. Built on first use from "kubeconfig" and "context", with the Comb custom resource in its resource map, and added to "loop". A failure building it fails the Future of the request that needed it. One you pass yourself must already be added to a loop.

loop

The IO::Async::Loop. Defaults to the loop a passed "kube" is in, else to IO::Async::Loop->new, the process-wide loop.

get

list

ensure

delete

update

patch

update_status

patch_status

log

The request methods of Kubernetes::Comb::Role::Client, each passing its arguments to the Net::Async::Kubernetes method of the same name and returning its Future.

server_url

The API server URL of "kube".

for_context

my $dev = $k8s->for_context('dev');

The client on the same "loop" for another context of the same "kubeconfig" (the default one when none was given), made on first use and kept: asking again returns the same one, so the loop gets one more Net::Async::Kubernetes per context, not per call. Nothing is read until its first request.

SEE ALSO

SUPPORT

Issues

Please report bugs and feature requests on GitHub at https://github.com/Getty/p5-kubernetes-comb/issues.

IRC

Join #kubernetes on irc.perl.org or message Getty directly.

CONTRIBUTING

Contributions are welcome! Please fork the repository and submit a pull request.

AUTHOR

Torsten Raudssus <getty@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2026 by Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.