New release of the Ansible Content Collection for Kubernetes
Red Hat’s Ansible team has pushed out version 2.0 of its Content Collection for Kubernetes, which sees the project getting a new home, becoming less dependent on the OpenShift client, and improving on performance and patching.
The Collection is meant to provide Ansible users with plugins and modules to manage applications running on OpenShift or Kubernetes clusters, as well as facilitate cluster provisioning and maintenance.
Since it started off as a community initiative but is now supported by Red Hat, the company decided to use the 2.0 release to move the Collection somewhere more official-sounding to reflect this change. It can now be found in the kubernetes.core sub-repo of the collections repository, as opposed to the community.kubernetes namespace.
Teams referencing the old repository in their playbooks are encouraged to make their adjustments — though the community.kubernetes namespace is planned to redirect to the new home soon anyway.
Here we will highlight some of the new changes in version 2.0 of this collection.
A New Name
Development on the kubernetes.core Collection had historically taken place in the community.kubernetes GitHub repository, which was built off community contributions before Red Hat supported it. That code base served as the source for both Collections. With this release, it's been shifted all development to the kubernetes.core GitHub repository. Moving forward, the community.kubernetes namespace will simply redirect to the kubernetes.core Collection.
Forward-looking Changes
One of the main objectives of 2.0 release was to better align the kubernetes.core Collection with the latest technologies and communal efforts. This is reflected by the stance to drop support for Python 2 in this release. With the end-of-life of Python 2 as of January 1, 2020, this enabled to focus on Python 3 to better support new features and improvements to the Collection. This release also introduces the replacement of the OpenShift client with the official Kubernetes Python client.
Performance Improvements
This latest release takes the kubernetes.core Collection to the next level by improving performance of large automation tasks. The focus was not just to deliver a Collection with Kubernetes templating capabilities but to also enhance the experience with Ansible when automating changes across a large number of resources.
Turbo mode: Ansible turbo mode focuses on improving the performance of Ansible Playbooks that manipulate many Kubernetes objects. This change is primarily intended for cases where you are manipulating hundreds of objects; it likely won’t provide any noticeable improvements for managing just a handful of objects.
You can enable Ansible turbo mode in your environment by simply installing the cloud.common Collection.
Improved Patching
This release brings some important changes to how the k8s module handles patching the existing objects. It's been added the ability to control whether the k8s module should create an existing object if it doesn’t exist, or should only patch an existing object.
As the adoption of containers and Kubernetes increases to drive application modernization, IT organizations must find ways to easily deploy and manage multiple Kubernetes clusters across regions, both residing in the public cloud and/or on-premises, and all the way to the edge. If you need to improve the management of applications on Kubernetes clusters and existing IT environments with faster iterations and easier maintenance, contact us and tell us about your project.
Sources: RedHat Ansible