Skip to content

Commit 9b90693

Browse files
committed
Added k8s.md
1 parent e6e8bda commit 9b90693

4 files changed

Lines changed: 286 additions & 5 deletions

File tree

docs/devops.md

Lines changed: 89 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
## DevOps
22

33
- What do you know about DevOps?
4-
Your answer must be simple and straightforward. Begin by explaining the growing importance of DevOps in the IT industry. Discuss how such an approach aims to synergize the efforts of the development and operations teams to accelerate the delivery of software products, with a minimal failure rate. Include how DevOps is a value-added practice, where development and operations engineers join hands throughout the product or service lifecycle, right from the design stage to the point of deployment.
4+
5+
Your answer must be simple and straightforward. Begin by explaining the growing importance of DevOps in the IT industry. Discuss how such an approach aims to synergize the efforts of the development and operations teams to accelerate the delivery of software products, with a minimal failure rate.
6+
7+
Include how DevOps is a value-added practice, where development and operations engineers join hands throughout the product or service lifecycle, right from the design stage to the point of deployment.
58

69
- Why has DevOps gained prominence over the last few years?
7-
Before talking about the growing popularity of DevOps, discuss the current industry scenario. Begin with some examples of how big players such as Netflix and Facebook are investing in DevOps to automate and accelerate application deployment and how this has helped them grow their business. Using Facebook as an example, you would point to Facebook’s continuous deployment and code ownership models and how these have helped it scale up but ensure the quality of experience at the same time. Hundreds of lines of code are implemented without affecting quality, stability, and security.
10+
Before talking about the growing popularity of DevOps, discuss the current industry scenario. Begin with some examples of how big players such as Netflix and Facebook are investing in DevOps to automate and accelerate application deployment and how this has helped them grow their business.
11+
12+
Using Facebook as an example, you would point to Facebook’s continuous deployment and code ownership models and how these have helped it scale up but ensure the quality of experience at the same time. Hundreds of lines of code are implemented without affecting quality, stability, and security.
13+
14+
Your next use case should be Netflix. This streaming and on-demand video company follow similar practices with fully automated processes and systems. Mention the user base of these two organizations: Facebook has 2 billion users while Netflix streams online content to more than 100 millions users worldwide.
815

9-
Your next use case should be Netflix. This streaming and on-demand video company follow similar practices with fully automated processes and systems. Mention the user base of these two organizations: Facebook has 2 billion users while Netflix streams online content to more than 100 millions users worldwide. These are great examples of how DevOps can help organizations to ensure higher success rates for releases, reduce the lead time between bug fixes, streamline and continuous delivery through automation, and an overall reduction in manpower costs.
16+
These are great examples of how DevOps can help organizations to ensure higher success rates for releases, reduce the lead time between bug fixes, streamline and continuous delivery through automation, and an overall reduction in manpower costs.
1017

1118
- Which are some of the most popular DevOps tools? Do you have experience working with any of these tools?
1219
The more popular DevOps tools include:
@@ -17,4 +24,82 @@ The more popular DevOps tools include:
1724
4. Git
1825
5. Jenkins
1926
6. Ansible
20-
7. Docker
27+
7. Docker
28+
29+
Thoroughly describe any tools that you are confident about, what it’s abilities are and why you prefer using it. For example, if you have expertise in Git, you would tell the interviewer that Git is a distributed Version Control System (VCS) tool that allows the user to track file changes and revert to specific changes when required. Discuss how Git’s distributed architecture gives it an added edge where developers make changes locally and can have the entire project history on their local Git repositories, which can be later shared with other team members.
30+
31+
Now that you have mentioned VCS, be ready for the next obvious question.
32+
33+
- What is version control and why should VCS be used?
34+
35+
Define version control and talk about how this system records any changes made to one or more files and saves them in a centralized repository. VCS tools will help you recall previous versions and perform the following:
36+
37+
- Go through the changes made over a period of time and check what works versus what doesn’t.
38+
- Revert specific files or specific projects back to an older version.
39+
- Examine issues or errors that have occurred due to a particular change
40+
41+
Using VCS gives developers the flexibility to simultaneously work on a particular file and all modifications can be logically combined later.
42+
43+
- Is there a difference between Agile and DevOps? If yes, please explain.
44+
45+
As a DevOps engineer, interview questions like this are quite expected. Start by describing the obvious overlap between DevOps and Agile. Although the implementation of DevOps is always in sync with Agile methodologies, there is a clear difference between the two. The principles of Agile are associated with seamless production or development of a piece of software. On the other hand, DevOps deals with the development, followed by deployment of the software, ensuring faster turnaround time, minimum errors, and reliability
46+
47+
2. Why are configuration management processes and tools important?
48+
49+
Talk about multiple software builds, releases, revisions, and versions for each software or testware that is being developed. Move on to explain the need for storing and maintaining data, keeping track of development builds and simplified troubleshooting. Don’t forget to mention the key CM tools that can be used to achieve these objectives. Talk about how tools like Puppet, Ansible, and Chef help in automating software deployment and configuration on several servers.
50+
51+
3. How is Chef used as a CM tool?
52+
53+
The chef is considered to be one of the preferred industry-wide CM tools. Facebook migrated its infrastructure and backend IT to the Chef platform, for example. Explain how Chef helps you to avoid delays by automating processes. The scripts are written in Ruby. It can integrate with cloud-based platforms and configure new systems. It provides many libraries for infrastructure development that can later be deployed within a software. Thanks to its centralized management system, one Chef server is enough to be used as the center for deploying various policies.
54+
55+
4. How would you explain the concept of “Infrastructure as Code”(IaC)?
56+
57+
It is a good idea to talk about IaC as a concept, which is sometimes referred to as a programmable infrastructure, where infrastructure is perceived in the same way as any other code. Describe how the traditional approach to managing infrastructure is taking a back seat and how manual configurations, obsolete tools, and custom scripts are becoming less reliable. Next, accentuate the benefits of IaC and how changes to IT infrastructure can be implemented in a faster, safer and easier manner using IaC. Include the other benefits of IaC like applying regular unit testing and integration testing to infrastructure configurations, and maintaining up-to-date infrastructure documentation.
58+
59+
If you have completed a certification on Amazon Web Services (AWS), and are interviewing for niche roles such as AWS-certified DevOps engineer, here are some AWS DevOps interview questions that you must be prepared for:
60+
61+
5. What is the role of AWS in DevOps?
62+
63+
When asked this question in an interview, get straight to the point by explaining that AWS is a cloud-based service provided by Amazon that ensures scalability through unlimited computing power and storage. AWS empowers IT enterprises to develop and deliver sophisticated products and deploy applications on the cloud. Some of its key services include Amazon CloudFront, Amazon SimpleDB, Amazon Relational Database Service, and Amazon Elastic Computer Cloud. Discuss the various cloud platforms and emphasize any big data projects that you have handled in the past using cloud infrastructure.
64+
65+
6. How is IaC implemented using AWS?
66+
67+
Start by talking about the age-old mechanisms of writing commands onto script files and testing them in a separate environment before deployment and how this approach is being replaced by IaC. Similar to the codes written for other services, with the help of AWS, IaC allows developers to write, test, and maintain infrastructure entities in a descriptive manner, using formats such as JSON or YAML. This enables easier development and faster deployment of infrastructure changes.
68+
69+
As a DevOps engineer, an in-depth knowledge of processes, tools, and relevant technology are essential. You must also have a holistic understanding of the products, services, and systems in place. If your answers matched the answers we’ve provided above, you’re in great shape for future DevOps interviews. Good luck! If you’re looking for answers to specific DevOps interview questions that aren’t addressed here, ask them in the comments below. Our DevOps experts will help you craft the perfect answer.
70+
71+
- Culture
72+
- Automation
73+
- Measurement
74+
- Sharing
75+
76+
- People over process over tools
77+
- continuous delivery
78+
- Lean management
79+
- visible ops change control
80+
- infrastructure as code
81+
82+
10 practises for devops success
83+
- Incident command system
84+
- developers on call
85+
- public status pages
86+
- blameless post mortem
87+
- embedded teams
88+
- the cloud
89+
- andon cords
90+
- dependency injection
91+
- blue/green deployment
92+
- chaos monkey
93+
94+
tool criteai
95+
- programmable
96+
- verifible
97+
- well behaved
98+
-
99+
100+
Teams:
101+
developers
102+
sysadmins
103+
dba
104+
noc
105+
soc

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## Python Concepts
22

33
[DevOps](devops.md)
4+
[k8s](k8s.md)
45

56
# What is Python? Executive Summary
67
- Python is an interpreted, object-oriented, high-level programming language with dynamic semantics.

docs/k8s.md

Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
### Kubernetes
2+
3+
Website kubernetes.io
4+
Type Cluster management software and container orchestration
5+
Repository https://github.com/kubernetes/kubernetes
6+
7+
8+
9+
-What is Kubernetes
10+
11+
- Kubernetes (commonly stylized as K8s)
12+
- Kubernetes is an open-source system for automating deployment, scaling, and management of containerized applications.
13+
- It groups containers that make up an application into logical units for easy management and discovery.
14+
- Platform for automating deployment, scaling, and operations of application containers across clusters of hosts
15+
- Originally developed by Google in 2014, now maintained by Cloud Native Computing Foundation(CNCF)
16+
- Implemented in Go.
17+
- Works with a range of container tools, including Docker.
18+
- help to shape the evolution of technologies that are container-packaged, dynamically-scheduled and microservices-oriented
19+
20+
21+
22+
# Architecture
23+
24+
sites :
25+
1. https://thenewstack.io/kubernetes-an-overview/
26+
2. https://x-team.com/blog/introduction-kubernetes-architecture/
27+
3. https://medium.com/@abhaydiwan/kubernetes-introduction-and-twelve-key-features-cdfe8a1f2d21
28+
4. https://medium.com/jorgeacetozi/kubernetes-master-components-etcd-api-server-controller-manager-and-scheduler-3a0179fc8186
29+
30+
- Kubernetes follows the master-slave architecture
31+
32+
I] Kubernetes Master
33+
- Kubernetes Masters act as the control unit for a cluster.
34+
- Manages its workload and directs communication across the system.
35+
- A cluster needs 1 or more Masters to run
36+
37+
- API Server
38+
- The API server provides endpoints for developers and operators to interact with the cluster
39+
- Key component and serves the Kubernetes API using JSON over HTTP, provides both the internal and external
40+
interface to Kubernetes.
41+
- Processes and validates REST requests and updates state of the API objects in etcd
42+
43+
- Controller Manager
44+
- Controller Manager manages controllers that work to bring Kubernetes to the desired state.
45+
- This include scheduling controllers and Replication controllers.
46+
- Is the process in which the core Kubernetes controllers like DaemonSet Controller and Replication Controller run.
47+
- It communicate with the API server to create, update and delete the resources they manage (pods, service
48+
endpoints, etc.)
49+
50+
- Scheduler
51+
- Scheduler is responsible for actually doing the resource management of pods based.
52+
- Process that actually assigns workloads to specifc nodes in the cluster is the scheduler.
53+
- It manages on which node an unscheduled pod should run on based on resource availability
54+
55+
- etcd
56+
- To store confguration data that can be accessed by each of the nodes in cluster.
57+
- Stores cluster state and confguration in the form of key-value
58+
59+
-----------
60+
61+
# II] Kubernetes Nodes
62+
- The Node, also known as Worker or Minion
63+
- Kubernetes Nodes actually run the workloads(containers).
64+
- Kubernetes needs at least 1 node to run.
65+
- In small setups, the node and the master can be the same.
66+
67+
- Kubelet
68+
- Kubelet is an agent that runs on each node that receives the instructions from the Master about what to do
69+
on the node.
70+
- Is responsible for the running state of each node.
71+
- Ensures all containers on the node are healthy.
72+
- Takes cares of Containers(POD) lifecycle management.
73+
74+
- cAdvisor
75+
- cAdvisor collects telemetry about the pods running on the nodes such as network, CPU and RAM usage.
76+
- Is the agent that monitors and gathers resource usage and performance metrics of containers on each node.
77+
78+
- Kube-Proxy
79+
- Is an implementation of a network proxy and a load balancer for the pods running on the node
80+
- It supports the service abstraction along with other networking operation.
81+
- It is responsible for routing trafc to the appropriate container based on IP and port number of the incoming request.
82+
- It uses linux ip tables in backend to perform its operation.
83+
84+
- POD
85+
- POD is collection of one or more container(s).
86+
- smallest deplyable unit
87+
- Small group of tightly coupled containers
88+
- shared network and data volumes
89+
- routable IP address
90+
- The containers in the pod share resources such as storage, CPU and RAM
91+
- Network resources are connected to the pod
92+
- Containers is the lowest level of microservice which holds the running application, libs or their dependancies.
93+
94+
- Plugin Network
95+
- Plugin Network uses a driver to create an overlay network between Kubernetes Nodes.
96+
- This allows pods to communicate seamlessly between nodes on a Kubernetes Cluster.
97+
- eg. Flannel (Flannel is a very simple overlay network that satisfies the Kubernetes requirements. Many people have reported success with Flannel and Kubernetes.) or weave-net or calico.
98+
99+
100+
# Services
101+
102+
https://medium.com/google-cloud/kubernetes-nodeport-vs-loadbalancer-vs-ingress-when-should-i-use-what-922f010849e0
103+
104+
- services provide permanent virtual IP and DNS name
105+
- It is an exposure of pods, replica set, controllers etc. on a port through kube-proxy
106+
- Types of Services:
107+
- ClusterIP
108+
- NodePort
109+
- ExternalIP
110+
- ExternalName
111+
112+
1. ClusterIP
113+
- A ClusterIP service is the default Kubernetes service.
114+
- Service gets virtual IP which only used to communicate within the cluster.
115+
- It gives you a service inside your cluster that other apps inside your cluster can access. There is no external access.
116+
117+
2. NodePort
118+
- Derives properties of ClusterIP.
119+
- Makes a service accessible from outside the cluster
120+
- In addition, it gets port from range 30000-32767 mapped with all nodes in cluster
121+
122+
123+
124+
125+
# Tools
126+
127+
1. Kubeadm
128+
- A administration tool for setting up and managing kubernetes clusters. Kubeadm runs on the Kubernetes host.
129+
130+
2. Kubectl
131+
- The command line interface for interacting with a Kubernetes clusters
132+
133+
134+
135+
136+
# Kubernetes Features
137+
138+
1. Automatic binpacking
139+
Automatically places containers based on their resource requirements and other constraints, while not sacrificing availability. Mix critical and best-effort workloads in order to drive up utilization and save even more resources.
140+
141+
2. Horizontal scaling
142+
Scale your application up and down with a simple command, with a UI, or automatically based on CPU usage.
143+
144+
3. Automated rollouts and rollbacks
145+
Kubernetes progressively rolls out changes to your application or its configuration, while monitoring application health to ensure it doesn't kill all your instances at the same time. If something goes wrong, Kubernetes will rollback the change for you. Take advantage of a growing ecosystem of deployment solutions.
146+
147+
4. Storage orchestration
148+
Automatically mount the storage system of your choice, whether from local storage, a public cloud provider such as GCP or AWS, or a network storage system such as NFS, iSCSI, Gluster, Ceph, Cinder, or Flocker.
149+
150+
5. Self-healing
151+
Restarts containers that fail, replaces and reschedules containers when nodes die, kills containers that don't respond to your user-defined health check, and doesn't advertise them to clients until they are ready to serve.
152+
153+
6. Service discovery and load balancing
154+
No need to modify your application to use an unfamiliar service discovery mechanism. Kubernetes gives containers their own IP addresses and a single DNS name for a set of containers, and can load-balance across them.
155+
156+
7. Secret and configuration management
157+
Deploy and update secrets and application configuration without rebuilding your image and without exposing secrets in your stack configuration.
158+
159+
8. Batch execution
160+
In addition to services, Kubernetes can manage your batch and CI workloads, replacing containers that fail, if desired.
161+
162+
163+
164+
165+
# Creating a single master cluster with kubeadm
166+
167+
Sites :
168+
1. https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/
169+
2. https://kubernetes.io/docs/tasks/tools/install-kubeadm/
170+
171+
# Steps :
172+
173+
- Installing kubeadm, kubelet and kubectl
174+
175+
1. vim /etc/yum.repos.d/kubernetes.repo
176+
- Add this
177+
[kubernetes]
178+
name=Kubernetes
179+
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
180+
enabled=1
181+
gpgcheck=1
182+
repo_gpgcheck=1
183+
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
184+
185+
2. setenforce 0
186+
3. yum install -y kubelet kubeadm kubectl
187+
4. systemctl enable kubelet && systemctl start kubelet
188+
189+
5. vim /etc/sysctl.d/k8s.conf
190+
- Add this
191+
net.bridge.bridge-nf-call-ip6tables = 1
192+
net.bridge.bridge-nf-call-iptables = 1
193+
194+
6. sysctl --system
195+

pythoncache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,4 @@ def size(self):
6666
value = ''.join([random.choice(s) for i in range(20)])
6767
cache.update(key, value)
6868
print("#%s iterations, #%s cached entries" % (i+1, cache.size))
69-
print
69+
print

0 commit comments

Comments
 (0)