concept change in category kubernetes

This is an excerpt from Manning's book Learn Kubernetes in a Month of Lunches.
Figure 2.13 Applying a manifest sends the YAML file to the Kubernetes API which applies changes
![]()
We'll start with Deployments, and actually you've already done plenty of Deployment updates. Every time we've applied a change to an existing Deployment (something we do 10 times a chapter), Kubernetes has implemented that with a rollout. In a rollout the Deployment creates a new ReplicaSet and scales it up to the desired number of replicas, while scaling down the previous ReplicaSet to zero replicas. Figure 9.1 shows an update in progress.
Figure 9.1 Deployments control multiple ReplicaSets so they can manage rolling updates
![]()
Rollouts aren't triggered from every change to a Deployment - only from a change to the Pod spec. If you make a change which the Deployment can manage with the current ReplicaSet, like updating the number of replicas, that's done without a rollout.
# apply the change using the record flag: kubectl apply -f vweb/update/vweb-v11.yaml --record # check the ReplicaSets and their labels: kubectl get rs -l app=vweb --show-labels # see the current rollout status: kubectl rollout status deploy/vweb # and the rollout history: kubectl rollout history deploy/vweb # show the rollout revision for the ReplicaSets: kubectl get rs -l app=vweb -o=custom-columns=NAME:.metadata.name,REPLICAS:.status.replicas,REVISION:.metadata.annotations.deployment\.kubernetes\.io/revision

This is an excerpt from Manning's book Getting Started with Kubernetes.
#A This configuration binds the current directory to the container’s /app directory so that changes are sync’d.
Generally the benefit of this mapping is that your changes go to the container without a rebuild. But you can also use this to make changes *in* the container, and have them update your local directory. Let’s say you’re developing rails without rails even being installed on your machine (we’re doing everything through Docker, after all). Well if you have your folders mapped in this way, you can just exec into the container, and run a command like
gem update rails, which will update the Gemfile in your local directory. No longer do you need to have duplicate (and possibly different) versions of the environment installed locally.
Apply the changes with:

This is an excerpt from Manning's book GitOps and Kuberentes.
The developer creates a new branch and starts working on the changes. Once changes are ready, the developer sends a Pull Request and requests code review.
It is more difficult to manage changes to the resource over time, especially when the change is subtractive. Suppose you no longer wanted “organization” to be annotated on the deployment. Simply removing the “kubectl annotate” command from the scripted code would not help, since it would do nothing to remove the annotation from the existing deployment. A separate operation would be needed to remove it. On the other hand, with the declarative approach, you only need to remove the annotation line from the spec, and Kubernetes would take care of removing the annotation to reflect your desired state. It is more difficult to understand changes. If a team member sent a pull request modifying the script to do something differently, it would be like any other source code review. The reviewer would need to mentally walk through the script’s logic to verify the algorithm achieves the desired outcome. There can even be bugs in the script. On the other hand, a pull request which changes a declarative deployment specification clearly shows the change to the desired state of the system. It is simpler to review, as there is no logic to review, only a configuration change.

This is an excerpt from Manning's book Kubernetes in Action.
Monolithic applications consist of components that are all tightly coupled together and have to be developed, deployed, and managed as one entity, because they all run as a single OS process. Changes to one part of the application require a redeployment of the whole application, and over time the lack of hard boundaries between the parts results in the increase of complexity and consequential deterioration of the quality of the whole system because of the unconstrained growth of inter-dependencies between these parts.