Net::Kubernetes - An object oriented interface to the REST API's provided by kubernetes
version 0.22
my $kube = Net::Kubernetes->new(url=>'http://127.0.0.1:8080', username=>'dave', password=>'davespassword'); my $pod_list = $kube->list_pods(); my $nginx_pod = $kube->create_from_file('kubernetes/examples/pod.yaml'); my $ns = $kube->get_namespace('default'); my $services = $ns->list_services; my $pod = $ns->get_pod('my-pod'); $pod->delete; my $other_pod = $ns->create_from_file('./my-pod.yaml');
All parameters are optional and have some basic default values (where appropriate).
The base url for the kubernetes. This should include the protocal (http or https) but not "/api/v1beta3" (see base_path).
The entry point for api calls, this may be used to set the api version with which to interact.
Username to use with basic authentication. If either username or password are not provided, basic authentication will not be used.
Password to use with basic authentication. If either username or password are not provided, basic authentication will not be used.
An authentication token to be used to access the apiserver. This may be provided as a plain string, a path to a file from which to read the token (like /var/run/secrets/kubernetes.io/serviceaccount/token from within a pod), or a reference to a file handle (from which to read the token).
This there options passed into new will cause Net::Kubernetes in inlcude SSL client certs to requests to the kuberernetes API server for authentication. There are basically just a passthrough to the underlying LWP::UserAgent used to handle the api requests.
This method returns a "Namespace" object on which many methods can be called implicitly limited to the specified namespace.
Delegates automatically to Net::Kubernetes::Namespace via $self->get_namespace('default')
returns a list of Net::Kubernetes::Resource::Nodes
returns a list of Net::Kubernetes::Resource::Services
Dave Mueller <dave@perljedi.com>
This software is Copyright (c) 2015 by Dave Mueller.
This is free software, licensed under:
The MIT (X11) License
Please see those modules/websites for more information related to this module.
Net::Kubernetes::Namespace
Net::Kubernetes::Resource
Net::Kubernetes::Role::APIAccess
Net::Kubernetes::Role::ResourceFactory
Net::Kubernetes::Role::ResourceFetcher
Net::Kubernetes::Role::ResourceLister
Christopher Pruden <cdpruden@liquidweb.com>
Dave <dave@perljedi.com>
Dave Mueller <dmueller@liquidweb.com>
To install Net::Kubernetes, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Kubernetes
CPAN shell
perl -MCPAN -e shell install Net::Kubernetes
For more information on module installation, please visit the detailed CPAN module installation guide.