kubernetes.core 6.6.0 Released - Whats New and How to Test

Introduction

The kubernetes.core collection is the official Ansible collection for interacting with Kubernetes clusters, providing modules such as k8s, k8s_info, k8s_cp, helm, helm_info, and related lookup and inventory plugins. It is maintained by the Ansible Cloud team and is one of the dependencies pulled in by the ansible community package.

Version 6.6.0 has just been published on Ansible Galaxy, replacing 6.5.0. This release is not a pure bugfix drop: it ships a number of minor feature additions across the helm, k8s_cp, k8s_info, and k8s lookup/waiter code paths, plus several deprecation notices that collection users should be aware of ahead of future major releases.

Whats New

Helm module improvements

  • helm gains a new wait_for_jobs option, which waits for all Jobs to complete before marking a Helm release as successful. This requires Helm >= 3.5.0 (PR #1140).
  • helm gains a new cleanup_on_fail option, mapping to the --cleanup-on-fail Helm flag, allowing deletion of new resources created during a failed upgrade. It complements atomic and can be combined with it, but not with replace, since replace deploys via helm install, which does not accept that flag (PR #1206).
  • helm now warns when reuse_values or reset_then_reuse_values is requested in a combination that Helm silently ignores. This happens by default because reset_values defaults to true, and whenever either option is combined with replace. Documentation and examples now clarify that reset_values must be set to false for either option to take effect (PR #1230).

k8s_cp changes

  • New copy_timeout option (default 300 seconds) bounds how long k8s_cp spends streaming an archive to a pod and waiting for the remote tar to finish, so a stalled copy fails instead of hanging indefinitely (PR #1217).
  • The module now streams the tar archive to the pod chunk by chunk instead of building the whole archive in memory first, reducing peak memory usage when copying large files (PR #1217).
  • When copying to a pod, k8s_cp now also uses /bin/sh and head inside the container, when present, to confirm the copy completed. Containers without them keep the previous behaviour and get a warning that completion could not be verified (PR #1217).

k8s_info, lookup, and waiter

  • k8s_info now supports metadata-only fetches (PR #1030).
  • The k8s lookup now warns when ENABLE_TURBO_MODE is set but the cloud.common collection is not installed, instead of silently falling back to the standard lookup base (PR #1242).
  • The waiter gains a job_complete predicate to support waiting for Job resources to reach the Complete or Failed condition (issue #1201).

Action groups and internal cleanup

  • helm_plugin and helm_plugin_info have been added to the helm action group, and k8s_taint has been added to the k8s action group, so that module_defaults set on those groups now applies to them as well (PR #1216).
  • The remaining ansible.module_utils.six import has been removed in favor of the Python standard library equivalent, avoiding deprecation warnings (PR #1197).
  • collections.abc is now used instead of the deprecated ansible.module_utils.common._collections_compat (PR #1057).

Deprecated Features

FeatureReplacementRemoval VersionReference
ENABLE_TURBO_MODE (Ansible Turbo mode)n/a (depends on retiring cloud.common)8.0.0PR #1242
helm return value status.valuesstatus.release_values8.0.0issue #1239
helm parameter wait_timeouttimeout7.0.0issue #1239
helm_info return value status.valuesstatus.release_values8.0.0issue #1239

Users relying on ENABLE_TURBO_MODE, status.values, or wait_timeout should start planning a migration path, since these will be removed in upcoming major releases (7.0.0 and 8.0.0).

How to Test

Install or upgrade the collection from Ansible Galaxy and confirm the version:

# Install kubernetes.core 6.6.0 explicitly
ansible-galaxy collection install kubernetes.core:==6.6.0

# Or upgrade to the latest available version
ansible-galaxy collection install kubernetes.core --upgrade

# Verify the installed version
ansible-galaxy collection list kubernetes.core

# Inspect the documentation for the new options
ansible-doc -t module kubernetes.core.helm
ansible-doc -t module kubernetes.core.k8s_cp
ansible-doc -t module kubernetes.core.k8s_info

A quick way to exercise the new helm options in a playbook:

---
- hosts: localhost
  gather_facts: false
  tasks:
    - name: Deploy release, wait for jobs and clean up on failure
      kubernetes.core.helm:
        name: myrelease
        chart_ref: mychart
        release_namespace: default
        wait: true
        wait_for_jobs: true
        cleanup_on_fail: true

After installing, review the full changelog fragment in the collection's CHANGELOG.rst or on the Galaxy release page to confirm which fixes and minor changes apply to the environment before rolling this update out to production automation.