
Today, Wednesday, the next release of Kubernetes - 1.16. According to the tradition for our blog, for the tenth time now, we are discussing the most significant changes in the new version.
The information used to prepare this material was taken from , and the corresponding issues, pull requests, as well as Kubernetes Enhancement Proposals (KEP). So, let's get started!..
Nodes
A truly large number of notable innovations (in alpha status) is presented on the node side of K8s clusters (Kubelet).
First of all, the so-called «» (Ephemeral Containers), designed to simplify debugging processes in pods.The new mechanism allows you to launch special containers that start in the namespace of existing pods and live for a short time. Their purpose is to interact with other pods and containers to solve problems and debug. For this capability, a new command has been implemented, kubectl debug, similar in essence to kubectl exec: but instead of launching a process in the container (as with exec), it launches a container in the pod. For example, such a command will connect a new container to the pod:
kubectl debug -c debug-shell --image=debian target-pod -- bashDetails about ephemeral containers (and examples of their usage) can be found in the . The current implementation (in K8s 1.16) is in alpha version, and among the criteria for its transition to beta is "testing the Ephemeral Containers API for at least 2 releases [Kubernetes]."
NB: In essence and even in name, the feature resembles the already existing plugin , which we . It is assumed that with the emergence of ephemeral containers, the development of a separate external plugin will cease.
Another innovation is , designed to provide a mechanism for calculating overhead for pods, which can vary significantly depending on the runtime environment used. As an example, the authors cite Kata Containers, which require the launch of a guest kernel, kata agent, init systems, etc. When the overhead becomes so significant, it cannot be ignored, and thus - a way to account for it is needed for further quota management, scheduling, etc. For its implementation in PodSpec , a field has been added Overhead *ResourceList (corresponding to the data in RuntimeClass, if used).
Another notable innovation is the Node Topology Manager. (Node Topology Manager), aimed at standardizing the approach to fine-tuning resource distribution across various components in Kubernetes. This initiative is driven by the increasing demand from diverse modern systems (in telecommunications, machine learning, financial services, etc.) for high-performance parallel computing and minimizing delays during operation executions, leveraging advanced CPU capabilities and hardware acceleration. Such optimizations in Kubernetes have been achieved through disparate components (CPU manager, Device manager, CNI), and now a unified internal interface will be introduced to standardize the approach and simplify the integration of new similar topology-aware components on the Kubelet side. More details can be found in .

Topology Manager Component Diagram
The next feature is container checks during their startup (). As is known, it's often challenging to obtain the current status for containers that take a long time to start: they are either 'killed' before truly starting to function or they end up in a deadlock for a long time. The new check (enabled via a feature gate called StartupProbeEnabled) defers — rather than cancels — the execution of any other checks until the pod has completed its startup. For this reason, the feature was initially dubbed . For pods that take a long time to start, health checks can be conducted at relatively short intervals.
Additionally, an improvement for RuntimeClass is introduced directly in beta status, adding support for 'heterogeneous clusters'. With , it is no longer necessary for each node to support every RuntimeClass: for pods, one can select a RuntimeClass without considering the cluster's topology. Previously, to ensure that pods landed on nodes with support for all their required needs, corresponding rules had to be assigned to NodeSelector and tolerations. In discusses use cases and, of course, implementation details.
Network
Two significant networking features that first appeared (in alpha) in Kubernetes 1.16 are:
- dual-stack networking — IPv4/IPv6 — and its corresponding "understanding" at the level of pods, nodes, and services. It includes IPv4-to-IPv4 and IPv6-to-IPv6 interactions among pods, from pods to external services, reference implementations (within the Bridge CNI, PTP CNI, and Host-Local IPAM plugins), as well as backward compatibility with Kubernetes clusters operating solely on IPv4 or IPv6. Implementation details are in .
An example output of IP addresses of two types (IPv4 and IPv6) in the list of pods:
kube-master# kubectl get pods -o wide NAME READY STATUS RESTARTS AGE IP NODE nginx-controller 1/1 Running 0 20m fd00:db8:1::2,192.168.1.3 kube-minion-1 kube-master# - New API for Endpoint — . It addresses the performance/scalability issues of the existing Endpoint API affecting various components in the control plane (apiserver, etcd, endpoints-controller, kube-proxy). The new API will be added to the Discovery API group and will support tens of thousands of backend endpoints on each service in a cluster consisting of thousands of nodes. For this purpose, each Service maps to N objects
EndpointSlice, each of which by default has no more than 100 endpoints (this value is configurable). The EndpointSlice API will also provide capabilities for its future development: supporting multiple IP addresses for each pod, new states for endpoints (not onlyReadyandNotReady), dynamic subsetting for endpoints.
The introduced , named service.kubernetes.io/load-balancer-cleanup , attached to each service of type LoadBalancer. Upon the deletion of such a service, it prevents the actual deletion of the resource until the "cleanup" of all relevant load balancer resources is completed.
API Machinery
A true "milestone stabilization" has been recorded in the area of the Kubernetes API server and its interaction. Much of this has happened thanks to the transition to stable status of not requiring special handling (CRD), which had beta status since the distant Kubernetes 1.7 (that is, June 2017!). The same stabilization came to related features:
- with
/statusand/scaleversions for CRD, based on an external webhook; - recently introduced (in K8s 1.15) defaulting values
- applying OpenAPI v3 schema for creating and publishing OpenAPI documentation, used for server-side validation of CRD resources. (defaulting) and automatic field removal (pruning) versions for CRD, based on an external webhook;
- using the OpenAPI v3 schema to create and publish OpenAPI documentation for validating CRD resources on the server side.
Another mechanism that has long become familiar for Kubernetes administrators: — had also long been in beta status (since K8s 1.9) and is now declared stable.
Two other features have reached beta status: and .
The only significant innovation in the alpha version became from SelfLink — a special URI representing the specified object and part of ObjectMeta and ListMeta (i.e., part of any object in Kubernetes). Why is it being abandoned? The motivation "simply put" like the absence of any real (insurmountable) reasons for this field to still exist. More formal reasons include optimizing performance (by removing an unnecessary field) and simplifying the operation of the generic-apiserver, which has to handle such a field in a special way (this is the only field set just before object serialization). The actual "deprecation" (within the beta version) SelfLink will happen by Kubernetes version 1.20, and final deprecation will be in 1.21.
Data Storage
The main work in the storage area, as in previous releases, is observed in the area of . The main changes here include:
- for the first time (in the alpha version) support for CSI plugins for Windows worker nodes: the current way to work with storage here will replace in-tree plugins in the Kubernetes core and FlexVolume plugins from Microsoft based on Powershell;

The implementation scheme for CSI plugins in Kubernetes for Windows - of , introduced back in K8s 1.12, has matured to beta status;
- an equivalent "upgrade" (from alpha to beta version) was achieved with the use of CSI for creating local ephemeral volumes ().
The volume cloning feature that appeared in the previous version of Kubernetes DataSource for creating new PVCs) has also now reached beta status. Two notable changes in scheduling (both in alpha version):
Scheduler
EvenPodsSpreading
- to use pods instead of logical application units (like Deployment and ReplicaSet) for "fair distribution" of workloads and adjustment of this distribution (as a hard requirement or as a soft condition, i.e., a priority). This feature will expand the existing capabilities for scheduling pods, currently limited by the options PodAffinity PodAntiAffinity
PodAffinityandPodAntiAffinity, providing administrators with more nuanced control over this matter, which translates to better high availability and optimized resource consumption. Details can be found in . - Using BestFit Policy downward API support (simultaneously with this in RequestedToCapacityRatio Priority Function when planning pods, allowing applying ("container packing") for both primary resources (CPU, memory) and extended resources (like GPU). For more information, see .

Pod scheduling: before using the best fit policy (directly via the default scheduler) and with its use (through the scheduler extender)
Additionally, the ability to create custom plugins for the scheduler outside the main Kubernetes development tree (out-of-tree).
Other changes
Also notable in the Kubernetes 1.16 release is the initiative for existing metrics into full compliance, more specifically — in alignment with for K8s instrumentation. They largely rely on the relevant . Inconsistencies arose for various reasons (for instance, some metrics were simply created before the current instructions were available), and developers concluded that it was time to standardize everything, "in line with the rest of the Prometheus ecosystem." The current implementation of this initiative is in alpha status, which will progressively increase in subsequent Kubernetes versions to beta (1.17) and stable (1.18).
Additionally, the following changes can be noted:
- Enhancement of Windows support with of the Kubeadm utility for this OS (alpha version),
RunAsUserNamefor Windows containers (alpha version), Group Managed Service Account (gMSA) support to beta version, mount/attach for vSphere volumes. - data compression mechanism in API responses. Previously, an HTTP filter was used for this purpose, which imposed a number of restrictions that prevented it from being enabled by default. Now, "transparent request compression" works: clients sending
Accept-Encoding: gzipin the header receive a GZIP-compressed response if its size exceeds 128 KB. Clients in Go automatically support compression (send the necessary header), so they will immediately notice a reduction in traffic. (Other languages may require slight modifications.) - HPA scaling from/to zero pods based on external metricsIf scaling is based on objects/external metrics, you can automatically scale down to 0 replicas when workloads are idle to save resources. This feature should be particularly useful in cases where workers request GPU resources, and the number of different types of idle workers exceeds the number of available GPUs.
- New client — — for 'generic' access to objects. It is designed to easily retrieve metadata (i.e., subdivisions
metadata) from cluster resources and perform operations such as garbage collection and quota enforcement. - Gathering Kubernetes without deprecated ('in-tree') cloud providers (alpha version).
- In the kubeadm utility an experimental (alpha version) feature to apply kustomize patches during
init,joinandupgrade. For more information on using the flag--experimental-kustomize, see . - A new endpoint for the apiserver — , — allows exporting information about its readiness. The API server also has a flag
--maximum-startup-sequence-duration, allowing you to control its restarts. - Two features for Azure have been declared stable: support for (Availability Zones) and (RG). In addition, Azure has added:
- AAD and ADFS;
-
service.beta.kubernetes.io/azure-pip-nameto specify the public IP of the load balancer; - settings
LoadBalancerNameandLoadBalancerResourceGroup.
- AWS has introduced for EBS on Windows and API calls for EC2
DescribeInstances. - Kubeadm now automatically CoreDNS configuration when upgrading CoreDNS version.
- Binaries etcd in the corresponding Docker image are world-executable, allowing this image to be run without root privileges. Additionally, the migration image for etcd supports etcd2 version.
- In switched to using distroless as the base image, improved performance, and added new cloud providers (DigitalOcean, Magnum, Packet).
- Updates in the used/dependent software: Go 1.12.9, etcd 3.3.15, CoreDNS 1.6.2.
P.S.
Also read in our blog:
- «»;
- «»;
- «»;
- «».
Source: habr.com


