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 the server_side and force_conflicts options to control Helm v4 server-side apply when installing or upgrading a release (PR #1164).
  • helm_plugin - adds a --keyring argument to allow changing the keyring default location. The option is only accepted with state=present (the helm plugin install subcommand), 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 as Login Succeeded are printed to stdout instead of stderr (PR #1147).
  • kubeconfig - adds the remove value to the behavior option, allowing entries to be deleted from the kubeconfig file by name (PR #1123).

Bugfixes

  • ee - added meta/execution-environment.yml to decouple ansible-builder EE builds from the openshift-clients system dependency declared in bindep.txt, which is not available in standard UBI repositories and caused builds to fail with No package matches 'openshift-clients' (issue #1141).
  • helm - uses --server-side=false --force-replace instead of the deprecated/removed --force flag when force=true is 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-failure flag instead of the deprecated/removed --atomic flag when atomic=true is 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 for empty_dir volumes in replicated pods and pods managed by DaemonSets (PR #1095).

New Modules

  • kubeconfig - generate, update, and optionally write Kubernetes kubeconfig files.

Component Overview

ComponentChange typeReference
helmserver_side / force_conflicts options, --force and --atomic fixes for Helm v4PR #1164, PR #1144
helm_pluginnew --keyring argumentPR #1150
helm_registry_authdoc update for Helm 4.2.1 stdout messagesPR #1147
helm_repositorytrailing slash bugfixPR #1121
kubeconfignew module + remove behaviorPR #1123
k8s_drainempty_dir detection bugfixPR #1095
ee metadatadecoupled openshift-clients dependencyissue #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.