kubernetes.core 6.5.0 - Whats New and How to Test
Introduction
kubernetes.core is the Ansible collection that provides the modules and plugins used to manage Kubernetes and OpenShift resources from playbooks, including k8s, helm, k8s_drain, and kubeconfig management modules. Version 6.5.0 has just been published on Ansible Galaxy and brings Helm v4 compatibility across the Helm-related modules along with a set of targeted bug fixes.
Whats New
Release Summary
According to the collection's own changelog, this release "implements minor changes and bug fixes such as a new remove value to the behavior option of the kubeconfig module, allowing entries to be deleted from the kubeconfig file by name, as well as Helm v4 compatibility across the Helm modules."
Minor Changes
helm- adds theserver_sideandforce_conflictsoptions to control Helm v4 server-side apply when installing or upgrading a release (PR #1164).helm_plugin- adds a--keyringargument to allow changing the keyring default location. The option is only accepted withstate=present(thehelm plugin installsubcommand), since that is the only implemented subcommand supporting--keyring(PR #1150).helm_registry_auth- documents that, as of Helm 4.2.1, registry success messages such asLogin Succeededare printed to stdout instead of stderr (PR #1147).kubeconfig- adds theremovevalue to thebehavioroption, allowing entries to be deleted from the kubeconfig file by name (PR #1123).
Bugfixes
ee- addedmeta/execution-environment.ymlto decouple ansible-builder EE builds from theopenshift-clientssystem dependency declared inbindep.txt, which is not available in standard UBI repositories and caused builds to fail withNo package matches 'openshift-clients'(issue #1141).helm- uses--server-side=false --force-replaceinstead of the deprecated/removed--forceflag whenforce=trueis used with Helm v4, preserving the Helm v3 client-side replacement behaviour and avoiding server-side apply conflicts (PR #1164).helm- uses the--rollback-on-failureflag instead of the deprecated/removed--atomicflag whenatomic=trueis used with Helm v4 (PR #1144).helm_repository- corrects handling of repository URLs with trailing slashes (PR #1121).k8s_drain- fixes logic for handling pods with local storage to correctly check forempty_dirvolumes in replicated pods and pods managed by DaemonSets (PR #1095).
New Modules
kubeconfig- generate, update, and optionally write Kubernetes kubeconfig files.
Component Overview
| Component | Change type | Reference |
|---|---|---|
| helm | server_side / force_conflicts options, --force and --atomic fixes for Helm v4 | PR #1164, PR #1144 |
| helm_plugin | new --keyring argument | PR #1150 |
| helm_registry_auth | doc update for Helm 4.2.1 stdout messages | PR #1147 |
| helm_repository | trailing slash bugfix | PR #1121 |
| kubeconfig | new module + remove behavior | PR #1123 |
| k8s_drain | empty_dir detection bugfix | PR #1095 |
| ee metadata | decoupled openshift-clients dependency | issue #1141 |
Installing and Testing kubernetes.core 6.5.0
The collection can be installed or upgraded from Ansible Galaxy with ansible-galaxy. It is recommended to test it in a virtual environment or container before rolling it out in production automation.
# install the collection at the specific version
ansible-galaxy collection install kubernetes.core:6.5.0
# or force an upgrade if already installed
ansible-galaxy collection install kubernetes.core:6.5.0 --force
# verify the installed version
ansible-galaxy collection list kubernetes.core
# quick sanity check of the new kubeconfig module
ansible-doc kubernetes.core.kubeconfig
# quick check of the new helm options
ansible-doc kubernetes.core.helm | grep -A2 server_side
Before adopting 6.5.0 in existing playbooks, review any usage of helm with force=true or atomic=true against a Helm v4 binary, since the underlying CLI flags used internally have changed. Also check any automation building custom execution environments that previously worked around the openshift-clients dependency issue, as it should no longer be necessary.