NAME

IO::K8s::Role::APIObject - Role for top-level Kubernetes API objects

VERSION

version 1.000

DESCRIPTION

This role is automatically applied when using IO::K8s::APIObject. It provides the metadata attribute and auto-derives apiVersion and kind from the class name.

Note: The metadata attribute is registered in IO::K8s::APIObject's import to ensure proper class registration for inflation.

metadata

Standard object's metadata. See IO::K8s::Apimachinery::Pkg::Apis::Meta::V1::ObjectMeta.

api_version

Returns the Kubernetes API version derived from the class name.

$pod->api_version;  # "v1"
$deployment->api_version;  # "apps/v1"

kind

Returns the Kubernetes kind derived from the class name.

$pod->kind;  # "Pod"
$deployment->kind;  # "Deployment"

resource_plural

Returns the plural resource name for URL building, or undef to use automatic pluralization. Override this in CRD classes where the plural name is not simply the lowercased kind with an "s" appended:

sub resource_plural { 'staticwebsites' }

to_yaml

my $yaml = $pod->to_yaml;

Serialize the object to YAML format suitable for kubectl apply -f.

save

$pod->save('pod.yaml');

Save the object to a YAML file. Returns the object for chaining.

SUPPORT

Issues

Please report bugs and feature requests on GitHub at https://github.com/pplu/io-k8s-p5/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 <jlmartinez@capside.com> (original author, inactive)

COPYRIGHT AND LICENSE

This software is Copyright (c) 2018 by CAPSiDE.

This is free software, licensed under:

The Apache License, Version 2.0, January 2004