NAME

Rex::Rancher::Options - Pure checks of install options, before anything touches the host

VERSION

version 0.003

SYNOPSIS

use Rex::Rancher::Options;

my $method = Rex::Rancher::Options->resolve_install_method($opts{install_method}, $opts{version});
my $cidr   = Rex::Rancher::Options->check_cluster_cidr($opts{cluster_cidr});
my $mode   = Rex::Rancher::Options->check_ipam_mode($opts{ipam_mode});

DESCRIPTION

Option checks that are the same for RKE2 and K3s and need no host: they return the value to use or die with a message for the Rexfile author, before Rex::Rancher::Server, Rex::Rancher::Agent, Rex::Rancher::Cilium or Rex::Rancher touch anything. Class methods; nothing is exported. "resolve_install_method" and "check_cluster_cidr" are still callable on Rex::Rancher::Distribution, which hands them on to this class.

resolve_install_method

my $method = Rex::Rancher::Options->resolve_install_method($method, $version);

script (default) or artifact; anything else dies, and so does artifact without a version.

check_cluster_cidr

Rex::Rancher::Options->check_cluster_cidr($cidr);

Returns $cidr when it is one IPv4 CIDR, undef for undef, and dies otherwise (Cilium's pool is IPv4 only here, so no dual-stack).

check_ipam_mode

Rex::Rancher::Options->check_ipam_mode($mode);

Returns $mode when it is kubernetes or cluster-pool, undef for undef, and dies otherwise. These are the two Cilium IPAM modes that work on RKE2 and K3s from nothing but a CIDR: kubernetes takes the node podCIDRs the cluster cuts from its cluster-cidr, cluster-pool cuts per-node ranges from Cilium's own pool. multi-pool needs pools defined in the Helm values, crd, eni, azure, alibabacloud and delegated-plugin an external allocator or cloud; those stay a matter of helm_values.

SEE ALSO

Rex::Rancher::Distribution, Rex::Rancher::Server, Rex::Rancher::Agent

SUPPORT

Issues

Please report bugs and feature requests on GitHub at https://github.com/Getty/rex-rancher/issues.

CONTRIBUTING

Contributions are welcome! Please fork the repository and submit a pull request.

AUTHOR

Torsten Raudssus <getty@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2026 by Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.