First Deploy
Namespace
First Deploy
Let's launch an application that generates and outputs a hash every 5 seconds or so.
I have prepared one here, you can test it with docker run jakousa/dwk-app1
.
Deployment
What is a Deployment?
A Deployment resource takes care of deployment. It's a way to tell Kubernetes what container you want, how they should be running and how many of them should be running.
While we created the Deployment we also created a ReplicaSet object. ReplicaSets are used to tell how many replicas of a Pod you want. It will delete or create Pods until the number of Pods you wanted are running. ReplicaSets are managed by Deployments and you should not have to manually define or modify them. If you want to manage the number of replicas, you can edit the Deployment and it will take care of modifying the ReplicaSet.
Scaling up
Things start to get really cumbersome. It is hard to imagine how someone in their right mind could be maintaining multiple applications like that. Thankfully we will now use a declarative approach where we define how things should be rather than how they should change. This is more sustainable in the long term than the iterative approach and will let us keep our sanity.
Before redoing the previous steps via the declarative approach, let's take the existing deployment down.