Deployed 1f92693 with MkDocs version: 1.1.2

This commit is contained in:
github-actions 2022-09-25 13:54:31 +00:00
parent a90a6a5cf0
commit 5f558dc3f7
4 changed files with 6 additions and 8 deletions

View File

@ -2227,13 +2227,13 @@ Docker images are present as layers on top of the base layer. These layers are t
<p><a href="https://github.com/docker/labs/blob/master/beginner/chapters/webapps.md">Creating and containerizing a basic Flask app</a></p>
</li>
</ol>
<p>Here is another <a href="https://www.katacoda.com/courses/docker/2">beginner level lab</a> from Katacoda for dockerizing a node js application. You dont even need a local setup for this and its easy to follow along.</p>
<p>Here is another <a href="https://github.com/docker/awesome-compose/tree/master/react-express-mongodb">beginner level lab</a> for dockerizing a MERN (Mongo + React + Express) application and its easy to follow along.</p>
<h2 id="advanced-features-of-docker">Advanced features of Docker</h2>
<p>While we have covered the basics of containerization and how a standalone application can be dockerized, processes in the real world need to communicate with each other. This need is particularly prevalent in applications which follow a microservice architecture. </p>
<p><strong>Docker networks</strong></p>
<p>Docker networks facilitate the interaction between containers running on the same hosts or even different hosts. There are several options provided through docker network command which specifies how the container interacts with the host and with other containers. The <code>host</code> option allows sharing of network stack with the host, <code>bridge</code> allows communication between containers running on the same host but not external to the host, <code>overlay</code> facilitates interaction between containers across hosts attached to the same network and <code>macvlan</code> which assigns a separate MAC address to a container for legacy containers are some important types of networks supported by Docker. This however is outside the scope of this module. The official documentation on <a href="https://docs.docker.com/network/">docker networks</a> itself is a good place to start.</p>
<p><strong>Volumes</strong></p>
<p>Apart from images, containers and networks, Docker also provides the option to create and mount volumes within containers. Generally, data within docker containers is non-persistent i.e once you kill the container the data is lost. Volumes are used for storing persistent data in containers. This <a href="https://www.katacoda.com/courses/docker/persisting-data-using-volumes">KataKoda lab</a> is a great place to start playing with volumes.</p>
<p>Apart from images, containers and networks, Docker also provides the option to create and mount volumes within containers. Generally, data within docker containers is non-persistent i.e once you kill the container the data is lost. Volumes are used for storing persistent data in containers. This <a href="https://dockerlabs.collabnix.com/beginners/volume/creating-volume-mount-from-dockercli.html">Docker lab</a> is a great place to start playing with volumes.</p>
<p><a href="https://linkedin.github.io/school-of-sre/level102/containerization_and_orchestration/orchestration_with_kubernetes/">In the next section</a> we see how container deployments are orchestrated with Kubernetes.</p>

View File

@ -2306,8 +2306,8 @@
</ul>
<h2 id="lab">LAB</h2>
<h3 id="prerequisites">Prerequisites</h3>
<p>The best way to start this exercise is to use a <a href="https://www.katacoda.com/courses/kubernetes/playground">Katacoda kubernetes playground</a>. A single node kubernetes cluster is already set up for you here for quick experimentation. You can also use this to play with docker.</p>
<p>The environment gets torn down after 10 mins. So make sure that you save your files if you want to resume them. For persistent kubernetes clusters, you can set it up either in your local (using <a href="https://minikube.sigs.k8s.io/docs/start/">minikube</a>) or you can create a <a href="https://docs.microsoft.com/en-us/azure/aks/kubernetes-walkthrough-portal">kubernetes cluster in Azure</a>, GCP or any other cloud provider.</p>
<p>The best way to start this exercise is to use a <a href="https://labs.play-with-k8s.com/">Play with kubernetes lab</a>. </p>
<p>The environment gets torn down after 4 hours. So make sure that you save your files if you want to resume them. For persistent kubernetes clusters, you can set it up either in your local (using <a href="https://minikube.sigs.k8s.io/docs/start/">minikube</a>) or you can create a <a href="https://docs.microsoft.com/en-us/azure/aks/kubernetes-walkthrough-portal">kubernetes cluster in Azure</a>, GCP or any other cloud provider.</p>
<p>Knowledge of YAML is nice to have for understanding the manifest files.</p>
<h3 id="hands-on">Hands-on</h3>
<h4 id="lab-1">Lab 1:</h4>
@ -2364,7 +2364,6 @@ spec: #[6]
</li>
</ul>
<p>A container is created within the pod but the pod is the same. You can verify by checking the pod start time in describe command. It would show a much older time.</p>
<p>You can actually see the nginx container by doing <code>docker ps</code> on the node01 terminal (if youre using Katacoda).</p>
<p>What if we want to change the image to 1.20.1 for 1000 nginx pods? Stepping a little back, what if we want to create 1000 nginx pods. Of course, we can write a script but Kubernetes already offers a resource type called “deployment” to manage large scale deployments better.</p>
<hr />
<h4 id="lab-2">Lab 2:</h4>
@ -2425,8 +2424,7 @@ Also, the labels in matchLabels should be the same as labels under <code>#[4]</c
<p>It is possible to have a public IP instead (i.e an actual external load balancer) by creating a Service of type <a href="https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/">LoadBalancer</a>. Do feel free to play around with it!</p>
<p>The above exercises a pretty good exposure to using Kubernetes to manage large scale deployments. Trust me, the process is very similar to the above for operating 1000 deployments and containers too! While a Deployment object is good enough for managing stateless applications, Kuberenetes provides other resources like Job, Daemonset, Cronjob, Statefulset etc. to manage special use cases. </p>
<p><strong>eAdditional labs:</strong>
https://www.katacoda.com/lizrice/scenarios/kube-web
https://www.katacoda.com/courses/kubernetes (Huge number of free follow-along exercises to play with Kubernetes)</p>
https://kubernetes.courselabs.co/ (Huge number of free follow-along exercises to play with Kubernetes)</p>
<h2 id="advanced-topics">Advanced topics</h2>
<p>Most often than not, microservices orchestrated with Kubernetes contain dozens of instances of resources like deployment, services and configs. The manifests for these applications can be auto- generated with Helm templates and passed on as Helm charts. Similar to how we have PiPy for python packages there are remote repositories like Bitnami where Helm charts (e.g for setting up a production-ready Prometheus or Kafka with a single click) can be downloaded and used. <a href="https://www.digitalocean.com/community/tutorials/an-introduction-to-helm-the-package-manager-for-kubernetes">This is a good place to begin</a>.</p>
<p>Kuberenetes provides the flexibility to create our custom resources (similar to Deployment or the Pod which we saw). For instance, if you want to create 5 instances of a resource with kind as SchoolOfSre you can! The only thing is that you have to write your custom resource for it. You can also build a custom operator for your custom resource to take certain actions on the resource instance. You can check <a href="https://www.redhat.com/en/topics/containers/what-is-a-kubernetes-operator">here</a> for more information.</p>

File diff suppressed because one or more lines are too long

Binary file not shown.