NAME
Kubernetes::REST::CLI::Cmd::Create - The create command of kube_client
VERSION
version 1.107
SYNOPSIS
kube_client create -f <file>
kube_client create -f - # read from stdin
DESCRIPTION
Implements the create command of Kubernetes::REST::CLI. Reads a YAML or JSON manifest, inflates it into typed IO::K8s objects (the class of each document is auto-detected from its kind field) and creates them on the cluster. MooX::Cmd finds and loads this class, you do not use it directly.
The format is detected from the content, not from the file name, so -f - is covered as well as -f file.yaml: a manifest starting with { after optional whitespace goes to "inflate" in Kubernetes::REST as before, anything else is parsed as YAML by "load_yaml" in Kubernetes::REST.
Multi-document YAML (----separated) is supported and is the common case for Kubernetes manifests. Each document is created in the order it appears in the file - which is what makes a manifest listing a Namespace before the objects inside it work - and each created object is printed through "format_output" in Kubernetes::REST::CLI. With --output yaml that is a ----separated stream again; with the default --output json it is one JSON document per created object. If a document fails, the documents before it have already been created and the error names the one that failed.
file
Path of the manifest to create, - for stdin. Short form: -f. Defaults to -.
execute
Runs the command. Called by MooX::Cmd with the remaining arguments and the command chain, whose first element is the Kubernetes::REST::CLI root object.
SEE ALSO
Kubernetes::REST::CLI - CLI base class
"load_yaml" in Kubernetes::REST - The YAML reader this command parses manifests with
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