NAME

Kubernetes::REST::HTTPTinyIO - HTTP client using HTTP::Tiny

VERSION

version 1.110

SYNOPSIS

use Kubernetes::REST::HTTPTinyIO;

my $io = Kubernetes::REST::HTTPTinyIO->new(
    ssl_verify_server => 1,
    ssl_ca_file => '/path/to/ca.crt',
);

DESCRIPTION

HTTP client implementation using HTTP::Tiny for making Kubernetes API requests. Lighter alternative to Kubernetes::REST::LWPIO.

Response bodies are returned as bytes - HTTP::Tiny hands back the body unmodified and never decodes a charset. See "Encoding contract" in Kubernetes::REST::Role::IO.

This backend does not implement call_duplex: Kubernetes::REST methods that need full-duplex transport (port_forward, exec, attach) croak against it by design. Use Net::Async::Kubernetes for those.

ssl_verify_server

Boolean. Whether to verify the server's SSL certificate. Defaults to true.

The value drives both verify_SSL of HTTP::Tiny and the SSL_verify_mode handed to IO::Socket::SSL (SSL_VERIFY_PEER or SSL_VERIFY_NONE), so it covers the certificate chain and the hostname check together. Both are set explicitly; the backend does not rely on the HTTP::Tiny default (on since 0.083). Use HTTP::Tiny 0.054 or newer: from that version verify_SSL controls the hostname check, and older releases do not honour the option reliably.

ssl_cert_file

Path to a client certificate file (PEM) for TLS client-certificate authentication. Ignored when ssl_cert_pem is set.

ssl_cert_pem

Client certificate as a PEM string, for TLS client-certificate authentication. Takes precedence over ssl_cert_file.

ssl_key_file

Path to the private key file (PEM) matching ssl_cert_file or ssl_cert_pem. Ignored when ssl_key_pem is set.

ssl_key_pem

Private key as a PEM string, matching ssl_cert_file or ssl_cert_pem. Takes precedence over ssl_key_file.

ssl_ca_file

Path to a CA certificate file (PEM) used to verify the server's certificate. Ignored when ssl_ca_pem is set.

ssl_ca_pem

CA certificate as a PEM string, used to verify the server's certificate. Takes precedence over ssl_ca_file.

timeout

Timeout in seconds for HTTP requests. Defaults to 310 (slightly more than the Kubernetes default watch timeout of 300s).

ua

The underlying HTTP::Tiny instance.

call

my $response = $io->call($req);

Execute an HTTP request. Receives a fully prepared Kubernetes::REST::HTTPRequest (URL, headers, content all set). Returns a Kubernetes::REST::HTTPResponse.

A transport failure is returned as status 599 with the message as content, as HTTP::Tiny reports it; any other status is the API server's. See "Error contract" in Kubernetes::REST::Role::IO.

call_streaming

my $response = $io->call_streaming($req, sub { my ($chunk) = @_; ... });

Execute an HTTP request with streaming response. The $data_callback is called with each chunk of data as it arrives.

Used internally by "watch" in Kubernetes::REST and "log" in Kubernetes::REST for the Watch and Pod Log APIs.

Transport failures come back as status 599. If the callback dies, the transfer is aborted and the same exception is rethrown unchanged, with no response: it is not turned into the 599 HTTP::Tiny would report for it. See "Error contract" in Kubernetes::REST::Role::IO.

SEE ALSO

SUPPORT

Issues

Please report bugs and feature requests on GitHub at https://github.com/pplu/kubernetes-rest/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.

AUTHORS

  • Torsten Raudssus <getty@cpan.org>

  • Jose Luis Martinez Torres <jlmartin@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2019-2026 by Jose Luis Martinez Torres <jlmartin@cpan.org>.

This is free software, licensed under:

The Apache License, Version 2.0, January 2004