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

Rate Limiting at the Edge

Rate Limiting at the Edge

I’m sure many of you have heard of the “Death Star Security” model—the hardening of the perimeter, without much attention paid to the inner core—and while this is generally considered bad form in the current cloud native landscape, there is still many things that do need to be implemented at edge in order to provide both operational and business logic support. One of these things is rate limiting. Modern applications and APIs can experience a burst of traffic over a short time period, for both good and bad reasons, but this needs to be managed well if your business model relies upon the successful completion of requests by paying customers.

Read More
A Crash Course For Running Istio

A Crash Course For Running Istio

At Namely we’ve been running with Istio for a year now. Yes, that’s pretty much when it first came out. We had a major performance regression with a Kubernetes cluster, we wanted distributed tracing, and used Istio to bootstrap Jaeger to investigate.

Read More
CVE-2018-18264 Privilege escalation through Kubernetes dashboard

CVE-2018-18264 Privilege escalation through Kubernetes dashboard

A recently disclosed vulnerability in Kubernetes dashboard (CVE-2018-18264) exposes secrets to unauthenticated users. In this blog post we’ll explore some key takeaways regarding monitoring privilege escalation on Kubernetes. The Kubernetes dashboard is a web based user interface that allows users to manage applications and resources within the cluster.

Read More