There are 2 hard problems in computer science: cache invalidation, naming things, and off-by-1 errors. -- Leon Bambrick
In Kubernetes, a DeploymentIn Kubernetes, a Deployment is an object which describes how an application is deployed. A Deployment defines the images to launch, how to configure them, and how they should be deployedRead More... is an object which describes how an application is deployed. It consists of a few basic pieces of data, including some metadata like the name of your deployment (for example one of ours is "nginx", but the name is arbitrary), a selector, which is a set of arbitrary labels, and a template, which defines the Pods in this deployment.
Deployments are one of the core building blocks in Kubernetes, and is suitable for almost all application hosting needs, but the term "deployment" can be confusing and a bit overused - so it's important to understand that you do not need to create a new Deployment to deploy new code! Take an example nginx server:
Should we want to upgrade to
nginx:1.16, we simply update the
image string on the deployment! You can do this on the command-line with:
kubectl edit deployment DEPLOYMENT_NAME
or more directly
kubectl set image deployment nginx nginx=nginx:1.16
You might have noticed
replicas: 1, which gives a hint at some of the ways you can ensure that the upgrade we just performed is done safely, with zero downtime, and no compromises.
Some of our favorite resources for learning more about Deployments in Kubernetes:
Here is a real-world example of our API's DeploymentIn Kubernetes, a Deployment is an object which describes how an application is deployed. A Deployment defines the images to launch, how to configure them, and how they should be deployedRead More... definition - not every option in the Deployment API is used, but many of these options help us accomplish truly zero-downtime deployments!
At KubeSail we're working hard to build tools that will enable you to rapidly iterate on Kubernetes Deployments. If you have any thoughts or requests, please join our chat!