NAME
kube_client - Kubernetes CLI client using Kubernetes::REST
VERSION
version 1.001
SYNOPSIS
# List all pods in default namespace
kube_client get Pod
# Get specific pod
kube_client get Pod nginx
# List pods in specific namespace
kube_client get Pod -n kube-system
# Output as YAML
kube_client get Pod -o yaml
# Output only names
kube_client get Pod -o name
# Create resource from file
kube_client create -f pod.yaml
# Create resource from stdin
cat pod.json | kube_client create
# Delete resource
kube_client delete Pod nginx -n default
# Use different context
kube_client -c production get Pod
# Use different kubeconfig
kube_client --kubeconfig /path/to/config get Pod
# Raw API call
kube_client raw CoreV1 ListNamespace
kube_client raw CoreV1 ReadNamespacedPod namespace=default name=nginx
DESCRIPTION
kube_client is a command-line tool for interacting with Kubernetes clusters using the Kubernetes::REST Perl library. It reads cluster configuration from your kubeconfig file (typically ~/.kube/config).
NAME
kube_client - Kubernetes CLI client using Kubernetes::REST
OPTIONS
- --kubeconfig=PATH
-
Path to kubeconfig file. Defaults to ~/.kube/config.
- -c, --context=NAME
-
Kubernetes context to use. Defaults to current-context from kubeconfig.
- -n, --namespace=NAME
-
Namespace for namespaced resources. Defaults to
default. - -o, --output=FORMAT
-
Output format:
json(default),yaml, orname.
COMMANDS
get
kube_client get <Kind> [name]
Get one or more resources. If name is provided, fetches that specific resource. Otherwise lists all resources of that kind.
kube_client get Pod
kube_client get Pod nginx
kube_client get Deployment -n production
kube_client get Node -o yaml
create
kube_client create -f <file>
Create a resource from a JSON or YAML file. Use -f - to read from stdin.
kube_client create -f deployment.yaml
cat pod.json | kube_client create
delete
kube_client delete <Kind> <name>
Delete a resource by kind and name.
kube_client delete Pod nginx
kube_client delete Namespace test
raw
kube_client raw <Group> <Method> [key=value ...]
Make a raw API call using Kubernetes::REST method groups.
kube_client raw CoreV1 ListNamespace
kube_client raw CoreV1 ReadNamespacedPod namespace=default name=nginx
kube_client raw AppsV1 ListNamespacedDeployment namespace=default
ENVIRONMENT
HOME-
Used to locate the default kubeconfig at ~/.kube/config.
SEE ALSO
Kubernetes::REST, Kubernetes::REST::CLI, IO::K8s
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 <torsten@raudssus.de>
Jose Luis Martinez Torres <jlmartin@cpan.org> (JLMARTIN, original author, inactive)
COPYRIGHT AND LICENSE
This software is Copyright (c) 2019 by Jose Luis Martinez.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004