-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #294 from DevMadhup/master
Added tasks from day30 to day90 in 2024 directory
- Loading branch information
Showing
67 changed files
with
2,245 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
## Day 30 Task: Kubernetes Architecture | ||
|
||
<p align="center"><img align="center" src="https://kubernetes.io/images/kubernetes-horizontal-color.png" /></p> | ||
|
||
## Kubernetes Overview | ||
|
||
With the widespread adoption of [containers](https://cloud.google.com/containers) among organizations, Kubernetes, the container-centric management software, has become a standard to deploy and operate containerized applications and is one of the most important parts of DevOps. | ||
|
||
Originally developed at Google and released as open-source in 2014. Kubernetes builds on 15 years of running Google's containerized workloads and the valuable contributions from the open-source community. Inspired by Google’s internal cluster management system, [Borg](https://research.google.com/pubs/pub43438.html), | ||
|
||
## Tasks | ||
|
||
1. What is Kubernetes? Write in your own words and why do we call it k8s? | ||
|
||
2. What are the benefits of using k8s? | ||
|
||
3. Explain the architecture of Kubernetes, refer to [this video](https://youtu.be/FqfoDUhzyDo) | ||
|
||
4. What is Control Plane? | ||
|
||
5. Write the difference between kubectl and kubelets. | ||
|
||
6. Explain the role of the API server. | ||
|
||
Kubernetes architecture is important, so make sure you spend a day understanding it. [This video](https://youtu.be/FqfoDUhzyDo) will surely help you. | ||
|
||
_Happy Learning :)_ | ||
|
||
[← Previous Day](../day29/README.md) | [Next Day →](../day31/README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
## Day 31 Task: Launching your First Kubernetes Cluster with Nginx running | ||
|
||
### Awesome! You learned the architecture of one of the top most important tool "Kubernetes" in your previous task. | ||
|
||
## What about doing some hands-on now? | ||
|
||
Let's read about minikube and implement _k8s_ in our local machine | ||
|
||
1. **What is minikube?** | ||
|
||
_Ans_:- Minikube is a tool which quickly sets up a local Kubernetes cluster on macOS, Linux, and Windows. It can deploy as a VM, a container, or on bare-metal. | ||
|
||
Minikube is a pared-down version of Kubernetes that gives you all the benefits of Kubernetes with a lot less effort. | ||
|
||
This makes it an interesting option for users who are new to containers, and also for projects in the world of edge computing and the Internet of Things. | ||
|
||
2. **Features of minikube** | ||
|
||
_Ans_ :- | ||
|
||
(a) Supports the latest Kubernetes release (+6 previous minor versions) | ||
|
||
(b) Cross-platform (Linux, macOS, Windows) | ||
|
||
(c) Deploy as a VM, a container, or on bare-metal | ||
|
||
(d) Multiple container runtimes (CRI-O, containerd, docker) | ||
|
||
(e) Direct API endpoint for blazing fast image load and build | ||
|
||
(f) Advanced features such as LoadBalancer, filesystem mounts, FeatureGates, and network policy | ||
|
||
(g) Addons for easily installed Kubernetes applications | ||
|
||
(h) Supports common CI environments | ||
|
||
## Task-01: | ||
|
||
## Install minikube on your local | ||
|
||
For installation, you can Visit [this page](https://minikube.sigs.k8s.io/docs/start/). | ||
|
||
If you want to try an alternative way, you can check [this](https://k8s-docs.netlify.app/en/docs/tasks/tools/install-minikube/). | ||
|
||
## Let's understand the concept **pod** | ||
|
||
_Ans:-_ | ||
|
||
Pods are the smallest deployable units of computing that you can create and manage in Kubernetes. | ||
|
||
A Pod (as in a pod of whales or pea pod) is a group of one or more containers, with shared storage and network resources, and a specification for how to run the containers. A Pod's contents are always co-located and co-scheduled, and run in a shared context. A Pod models an application-specific "logical host": it contains one or more application containers which are relatively tightly coupled. | ||
|
||
You can read more about pod from [here](https://kubernetes.io/docs/concepts/workloads/pods/) . | ||
|
||
## Task-02: | ||
|
||
## Create your first pod on Kubernetes through minikube. | ||
|
||
We are suggesting you make an nginx pod, but you can always show your creativity and do it on your own. | ||
|
||
**Having an issue? Don't worry, adding a sample yaml file for pod creation, you can always refer that.** | ||
|
||
_Happy Learning :)_ | ||
|
||
[← Previous Day](../day30/README.md) | [Next Day →](../day32/README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: nginx | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: nginx:1.14.2 | ||
ports: | ||
- containerPort: 80 | ||
|
||
|
||
# After creating this file , run below command: | ||
# kubectl apply -f <yaml file name> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: todo-app | ||
labels: | ||
app: todo | ||
spec: | ||
replicas: 2 | ||
selector: | ||
matchLabels: | ||
app: todo | ||
template: | ||
metadata: | ||
labels: | ||
app: todo | ||
spec: | ||
containers: | ||
- name: todo | ||
image: rishikeshops/todo-app | ||
ports: | ||
- containerPort: 3000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
## Day 32 Task: Launching your Kubernetes Cluster with Deployment | ||
|
||
### Congratulation ! on your learning on K8s on Day-31 | ||
|
||
## What is Deployment in k8s | ||
|
||
A Deployment provides a configuration for updates for Pods and ReplicaSets. | ||
|
||
You describe a desired state in a Deployment, and the Deployment Controller changes the actual state to the desired state at a controlled rate. You can define Deployments to create new replicas for scaling, or to remove existing Deployments and adopt all their resources with new Deployments. | ||
|
||
## Today's task let's keep it very simple. | ||
|
||
## Task-1: | ||
|
||
**Create one Deployment file to deploy a sample todo-app on K8s using "Auto-healing" and "Auto-Scaling" feature** | ||
|
||
- add a deployment.yml file (sample is kept in the folder for your reference) | ||
- apply the deployment to your k8s (minikube) cluster by command | ||
`kubectl apply -f deployment.yml` | ||
|
||
Let's make your resume shine with one more project ;) | ||
|
||
**Having an issue? Don't worry, adding a sample deployment file , you can always refer that or wathch [this video](https://youtu.be/ONrbWFJXLLk)** | ||
|
||
Happy Learning :) | ||
|
||
[← Previous Day](../day31/README.md) | [Next Day →](../day33/README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Day 33 Task: Working with Namespaces and Services in Kubernetes | ||
|
||
### Congrats🎊🎉 on updating your Deployment yesterday💥🙌 | ||
|
||
## What are Namespaces and Services in k8s | ||
|
||
In Kubernetes, Namespaces are used to create isolated environments for resources. Each Namespace is like a separate cluster within the same physical cluster. Services are used to expose your Pods and Deployments to the network. Read more about Namespace [Here](https://kubernetes.io/docs/concepts/workloads/pods/user-namespaces/) | ||
|
||
# Today's task: | ||
|
||
## Task 1: | ||
|
||
- Create a Namespace for your Deployment | ||
|
||
- Use the command `kubectl create namespace <namespace-name>` to create a Namespace | ||
|
||
- Update the deployment.yml file to include the Namespace | ||
|
||
- Apply the updated deployment using the command: | ||
`kubectl apply -f deployment.yml -n <namespace-name>` | ||
|
||
- Verify that the Namespace has been created by checking the status of the Namespaces in your cluster. | ||
|
||
## Task 2: | ||
|
||
- Read about Services, Load Balancing, and Networking in Kubernetes. Refer official documentation of kubernetes [Link](https://kubernetes.io/docs/concepts/services-networking/) | ||
|
||
Need help with Namespaces? Check out this [video](https://youtu.be/K3jNo4z5Jx8) for assistance. | ||
|
||
Keep growing your Kubernetes knowledge💥🙌 | ||
|
||
Happy Learning! :) | ||
|
||
[← Previous Day](../day32/README.md) | [Next Day →](../day34/README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Day 34 Task: Working with Services in Kubernetes | ||
|
||
### Congratulation🎊 on your learning on Deployments in K8s on Day-33 | ||
|
||
## What are Services in K8s | ||
|
||
In Kubernetes, Services are objects that provide stable network identities to Pods and abstract away the details of Pod IP addresses. Services allow Pods to receive traffic from other Pods, Services, and external clients. | ||
|
||
## Task-1: | ||
|
||
- Create a Service for your todo-app Deployment from Day-32 | ||
- Create a Service definition for your todo-app Deployment in a YAML file. | ||
- Apply the Service definition to your K8s (minikube) cluster using the `kubectl apply -f service.yml -n <namespace-name>` command. | ||
- Verify that the Service is working by accessing the todo-app using the Service's IP and Port in your Namespace. | ||
|
||
## Task-2: | ||
|
||
- Create a ClusterIP Service for accessing the todo-app from within the cluster | ||
- Create a ClusterIP Service definition for your todo-app Deployment in a YAML file. | ||
- Apply the ClusterIP Service definition to your K8s (minikube) cluster using the `kubectl apply -f cluster-ip-service.yml -n <namespace-name>` command. | ||
- Verify that the ClusterIP Service is working by accessing the todo-app from another Pod in the cluster in your Namespace. | ||
|
||
## Task-3: | ||
|
||
- Create a LoadBalancer Service for accessing the todo-app from outside the cluster | ||
- Create a LoadBalancer Service definition for your todo-app Deployment in a YAML file. | ||
- Apply the LoadBalancer Service definition to your K8s (minikube) cluster using the `kubectl apply -f load-balancer-service.yml -n <namespace-name>` command. | ||
- Verify that the LoadBalancer Service is working by accessing the todo-app from outside the cluster in your Namespace. | ||
|
||
Struggling with Services? Take a look at this video for a step-by-step [guide](https://youtu.be/OJths_RojFA). | ||
|
||
Need help with Services in Kubernetes? Check out the Kubernetes [documentation](https://kubernetes.io/docs/concepts/services-networking/service/) for assistance. | ||
|
||
Happy Learning :) | ||
|
||
[← Previous Day](../day33/README.md) | [Next Day →](../day35/README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Day 35: Mastering ConfigMaps and Secrets in Kubernetes🔒🔑🛡️ | ||
|
||
### 👏🎉 Yay! Yesterday we conquered Namespaces and Services 💪💻🔗🚀 | ||
|
||
## What are ConfigMaps and Secrets in k8s | ||
|
||
In Kubernetes, ConfigMaps and Secrets are used to store configuration data and secrets, respectively. ConfigMaps store configuration data as key-value pairs, while Secrets store sensitive data in an encrypted form. | ||
|
||
- _Example :- Imagine you're in charge of a big spaceship (Kubernetes cluster) with lots of different parts (containers) that need information to function properly. | ||
ConfigMaps are like a file cabinet where you store all the information each part needs in simple, labeled folders (key-value pairs). | ||
Secrets, on the other hand, are like a safe where you keep the important, sensitive information that shouldn't be accessible to just anyone (encrypted data). | ||
So, using ConfigMaps and Secrets, you can ensure each part of your spaceship (Kubernetes cluster) has the information it needs to work properly and keep sensitive information secure! 🚀_ | ||
- Read more about [ConfigMap](https://kubernetes.io/docs/concepts/configuration/configmap/) & [Secret](https://kubernetes.io/docs/concepts/configuration/secret/). | ||
|
||
## Today's task: | ||
|
||
## Task 1: | ||
|
||
- Create a ConfigMap for your Deployment | ||
- Create a ConfigMap for your Deployment using a file or the command line | ||
- Update the deployment.yml file to include the ConfigMap | ||
- Apply the updated deployment using the command: `kubectl apply -f deployment.yml -n <namespace-name>` | ||
- Verify that the ConfigMap has been created by checking the status of the ConfigMaps in your Namespace. | ||
|
||
## Task 2: | ||
|
||
- Create a Secret for your Deployment | ||
- Create a Secret for your Deployment using a file or the command line | ||
- Update the deployment.yml file to include the Secret | ||
- Apply the updated deployment using the command: `kubectl apply -f deployment.yml -n <namespace-name>` | ||
- Verify that the Secret has been created by checking the status of the Secrets in your Namespace. | ||
|
||
Need help with ConfigMaps and Secrets? Check out this [video](https://youtu.be/FAnQTgr04mU) for assistance. | ||
|
||
Keep learning and expanding your knowledge of Kubernetes💥🙌 | ||
|
||
[← Previous Day](../day34/README.md) | [Next Day →](../day36/README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: todo-app-deployment | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: todo-app | ||
template: | ||
metadata: | ||
labels: | ||
app: todo-app | ||
spec: | ||
containers: | ||
- name: todo-app | ||
image: rishikeshops/todo-app | ||
ports: | ||
- containerPort: 8000 | ||
volumeMounts: | ||
- name: todo-app-data | ||
mountPath: /app | ||
volumes: | ||
- name: todo-app-data | ||
persistentVolumeClaim: | ||
claimName: pvc-todo-app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Day 36 Task: Managing Persistent Volumes in Your Deployment 💥 | ||
|
||
🙌 Kudos to you for conquering ConfigMaps and Secrets in Kubernetes yesterday. | ||
|
||
🔥 You're on fire! 🔥 | ||
|
||
## What are Persistent Volumes in k8s | ||
|
||
In Kubernetes, a Persistent Volume (PV) is a piece of storage in the cluster that has been provisioned by an administrator. A Persistent Volume Claim (PVC) is a request for storage by a user. The PVC references the PV, and the PV is bound to a specific node. Read official documentation of [Persistent Volumes](https://kubernetes.io/docs/concepts/storage/persistent-volumes/). | ||
|
||
⏰ Wait, wait, wait! 📣 Attention all #90daysofDevOps Challengers. 💪 | ||
|
||
Before diving into today's task, don't forget to share your thoughts on the #90daysofDevOps challenge 💪 Fill out our feedback form (https://lnkd.in/gcgvrq8b) to help us improve and provide the best experience 🌟 Your participation and support is greatly appreciated 🙏 Let's continue to grow together 🌱 | ||
|
||
## Today's tasks: | ||
|
||
### Task 1: | ||
|
||
Add a Persistent Volume to your Deployment todo app. | ||
|
||
- Create a Persistent Volume using a file on your node. [Template](https://github.com/LondheShubham153/90DaysOfDevOps/blob/94e3970819e097a5b8edea40fe565d583419f912/2023/day36/pv.yml) | ||
|
||
- Create a Persistent Volume Claim that references the Persistent Volume. [Template](https://github.com/LondheShubham153/90DaysOfDevOps/blob/94e3970819e097a5b8edea40fe565d583419f912/2023/day36/pvc.yml) | ||
|
||
- Update your deployment.yml file to include the Persistent Volume Claim. After Applying pv.yml pvc.yml your deployment file look like this [Template](https://github.com/LondheShubham153/90DaysOfDevOps/blob/94e3970819e097a5b8edea40fe565d583419f912/2023/day36/Deployment.yml) | ||
|
||
- Apply the updated deployment using the command: `kubectl apply -f deployment.yml` | ||
|
||
- Verify that the Persistent Volume has been added to your Deployment by checking the status of the Pods and Persistent Volumes in your cluster. Use this commands `kubectl get pods` , | ||
|
||
`kubectl get pv` | ||
|
||
⚠️ Don't forget: To apply changes or create files in your Kubernetes deployments, each file must be applied separately. ⚠️ | ||
|
||
### Task 2: | ||
|
||
Accessing data in the Persistent Volume, | ||
|
||
- Connect to a Pod in your Deployment using command : `kubectl exec -it <pod-name> -- /bin/bash | ||
|
||
` | ||
|
||
- Verify that you can access the data stored in the Persistent Volume from within the Pod | ||
|
||
Need help with Persistent Volumes? Check out this [video](https://youtu.be/U0_N3v7vJys) for assistance. | ||
|
||
Keep up the excellent work🙌💥 | ||
|
||
Happy Learning :) | ||
|
||
[← Previous Day](../day35/README.md) | [Next Day →](../day37/README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: v1 | ||
kind: PersistentVolume | ||
metadata: | ||
name: pv-todo-app | ||
spec: | ||
capacity: | ||
storage: 1Gi | ||
accessModes: | ||
- ReadWriteOnce | ||
persistentVolumeReclaimPolicy: Retain | ||
hostPath: | ||
path: "/tmp/data" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: pvc-todo-app | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 500Mi |
Oops, something went wrong.