APIServer dry-run and kubectl diff

APIServer dry-run and kubectl diff

  • January 23, 2019
Table of Contents

APIServer dry-run and kubectl diff

Declarative configuration management, also known as configuration-as-code, is one of the key strengths of Kubernetes. It allows users to commit the desired state of the cluster, and to keep track of the different versions, improve auditing and automation through CI/CD pipelines. The Apply working-group is working on fixing some of the gaps, and is happy to announce that Kubernetes 1.13 promoted server-side dry-run and kubectl diff to beta.

These two features are big improvements for the Kubernetes declarative model. A few pieces are still missing in order to have a seamless declarative experience with Kubernetes, and we tried to address some of these: While compilers and linters do a good job to detect errors in pull-requests for code, a good validation is missing for Kubernetes configuration files. The existing solution is to run kubectl apply –dry-run, but this runs a local dry-run that doesn’t talk to the server: it doesn’t have server validation and doesn’t go through validating admission controllers.

As an example, Custom resource names are only validated on the server so a local dry-run won’t help. It can be difficult to know how your object is going to be applied by the server for multiple reasons:Defaulting will set some fields to potentially unexpected values,Mutating webhooks might set fields or clobber/change some values. Patch and merges can have surprising effects and result in unexpected objects.

For example, it can be hard to know how lists are going to be ordered once merged.

Source: kubernetes.io

Share :
comments powered by Disqus

Related Posts

Running Kubernetes in the Federal Government

Running Kubernetes in the Federal Government

Tackling security compliance is a long and challenging process for agencies, systems integrators, and vendors trying to launch new information systems in the federal government. Each new information system must go through the Risk Management Framework (RMF) created by the National Institute of Standards and Technology (NIST) in order to obtain authority to operate (ATO). This process is often long and tedious and can last for over a year.

Read More
Deployment strategies for the Jaeger Agent

Deployment strategies for the Jaeger Agent

If you’ve been following the evolution of the Kubernetes templates for Jaeger, you might have noticed an important change recently: the Jaeger Agent is not being deployed as a DaemonSet anymore. Instead, instructions are now being provided on how to deploy it as a “Sidecar”. The Agent component was developed to act as a “buffer” between the tracer and the collector.

Read More
Kubernetes Failure Stories

Kubernetes Failure Stories

I started to compile a list of public failure/horror stories related to Kubernetes. It should make it easier for people tasked with operations to find outage reports to learn from. Since we started with Kubernetes at Zalando in 2016, we collected many internal postmortems.

Read More