Home Blog

Git Main commands

0

𝗴𝗶𝘁 𝗰𝗹𝗼𝗻𝗲 <𝗿𝗲𝗽𝗼> : To work on an existing project, you’ll want to clone (copy) it to your local machine. This command does that.

𝗴𝗶𝘁 𝗰𝗵𝗲𝗰𝗸𝗼𝘂𝘁 -b <𝗯𝗿𝗮𝗻𝗰𝗵𝗻𝗮𝗺𝗲> : If you want to switch to a different branch, use this command.

𝗴𝗶𝘁 𝗮𝗱𝗱 <𝗳𝗶𝗹𝗲𝗻𝗮𝗺𝗲> : After you’ve made some changes to your files, you’ll want to stage them for a commit. This command adds a specific file to the stage.

𝗴𝗶𝘁 𝗮𝗱𝗱 . 𝗼𝗿 𝗴𝗶𝘁 𝗮𝗱𝗱 -𝗔 : Instead of adding files one by one, you can add all your changed files to the stage with one command.

𝗴𝗶𝘁 𝗰𝗼𝗺𝗺𝗶𝘁 -𝗺 “𝗖𝗼𝗺𝗺𝗶𝘁 𝗺𝗲𝘀𝘀𝗮𝗴𝗲” : Now that your changes are staged, you can commit them with a descriptive message.

𝗴𝗶𝘁 𝗽𝘂𝘀𝗵 𝗼𝗿𝗶𝗴𝗶𝗻 <𝗯𝗿𝗮𝗻𝗰𝗵𝗻𝗮𝗺𝗲> : This command sends your commits to the remote repository.

Git is an extremely powerful tool with plenty more commands and options.

However, this guide gives you a good start and reference point as you continue to explore and leverage Git for your version control needs.

Cohort-Based DevOps & Cloud Course on Azure & AWS

0

Beginner to Intermediate level

TopicTools
Introduction to DevOpsTheory Concepts and examples, Jira, confluence
Linux Operating SystemsUbantu,Linux
Basic Linux CommandsTop commands used as DevOps Engineer.
Shell Scripting 10 Exercise practice
Version ControlGit, Github,Azure repos, Bitbucket, GitLab
Docker EssentialsTop 15 Commands
Build Automation for microservicesBuild and deploy 3 tier architecture
AWS/Azure ServicesHands on provisioning
Container Tools/OrchestrationDocker, Kubernetes, helm
CICD toolsJenkins, Azure DevOps
Infrastructure as Code with TerraformBuild and deploy industry standard 4 applications.
Configuration Management with AnsibleBuild and deploy industry standard 2 applications.

Intermediate level to Pro Level

Topic
Creating Design & Implementing the best practices
Architecting & Provisioning Hub & Spoke model
Creating Landing Zone
End 2 End Application deployment
Troubleshooting & SRE related day 2 day tasks
Securing our complete infra structure.
Monitoring & Observability
Threat Model
Disaster recovery
High Availability

Kubernetes Pod Scheduling Workflow

0

Curious about how Kubernetes gets things done effortlessly? 🤔 Discover the magic behind scheduling Pods in this fascinating sequence diagram! 📈

🔑 Key Takeaways:

👉📝 The user creates a Pod via the API Server ✨🖥️

📥 The API server writes it to etcd 📝🔒

🔍 The scheduler notices an “unbound” Pod and decides which node to run that Pod on 🧭🏃‍♀️

📝 Scheduler writes that binding back to the API Server 🖊️🔙

🔄 The Kubelet notices a change in the set of Pods that are bound to its node 🔄🔧

🐳 Kubelet, in turn, runs the container via the container runtime (i.e. Docker) 🚢🏃‍♂️

👀 The Kubelet monitors the status of the Pod via the container runtime 🕵️‍♂️💬

🔄 As things change, the Kubelet will reflect the current status back to the API Server 🔄🔄💡

🌟 Dive into the orchestration magic of Kubernetes! 🚀 Embrace the containerized journey with ease! 🎯 #KubernetesWorkflow #ContainerMagic #DevOpsTech 🌐

By using the API Server as a central coordination point, Kubernetes is able to have a set of components interact with each other in a loosely coupled manner.

Kubernetes Control Plane

API Server

The API server is a component of the Kubernetes control plane that exposes the Kubernetes API. 

The API server is the front end for the Kubernetes control plane.

The main implementation of a Kubernetes API server is kube-apiserver

kube-apiserver is designed to scale horizontally—that is, it scales by deploying more instances. 

You can run several instances of kube-apiserver and balance traffic between those instances.

ETCD

Consistent and highly-available key value store.

It is used as Kubernetes’ backing store for all cluster data.

Backup and restore is a must.

Scheduler

Control plane component that watches for newly created Pods with no assigned node

And selects a node for them to run on.

Factors taken into account for scheduling decisions include: 

1.Individual and collective resource requirements, 

2.Hardware/software/policy constraints, 

3.Affinity and anti-affinity specifications, 

4.Data locality, 

5.Inter-workload interference, and deadlines. 

Kubernetes Node

Kubelet

An agent that runs on each node in the cluster. 

It makes sure that containers are running in a Pod.

The kubelet takes a set of PodSpecs that are provided through various mechanisms and ensures that the containers described in those PodSpecs are running and healthy. 

The kubelet doesn’t manage containers which were not created by Kubernetes.

Docker

Is an open source DevOps tool designed to help developers & operations guys to streamline application development and deployment.

By dockerizing an application means deploying and running an application using containers.

Containers allow a developer to package up an application with all of the parts it needs, such as libraries and other dependencies, and deploy it as one package.

Now, we need YOUR support to spread the word! 🙌

#KubernetesAnimation #ContainerMagic #DevOpsCommunity #TechRevolution

#BeginnerAcademy #cloud #awscloud #AWS  #DevOps #CommunityBuilding #CloudEnthusiast #KnowledgeSharing #awscommunitybuilders #AWSCommunity #CloudComputing #CloudCommunity #AWSNetworking #awscommunitybuilder

#cncf

Kubernetes cluster From Scratch on AWS Cloud

0

Prerequisites :-

  • 2 Ubuntu 20.04 LTS Virtual Machines
  • 2 CPU, 4 GB RAM for Master node
  • 1 CPU, 2 GB RAM for Worker Node

Step1: Install Docker engine and kubeadm on Master and Worker Nodes

apt-get update  
apt-get install docker.io -y
service docker restart  
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -  
echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" >/etc/apt/sources.list.d/kubernetes.list
apt-get update
apt install kubeadm=1.20.0-00 kubectl=1.20.0-00 kubelet=1.20.0-00 -y

Step2: Joining Worker Node to the Master

On Master node run below command

kubeadm init --pod-network-cidr=192.168.0.0/16

Copy the token and use it into the worker node command

Step3: Run kubectl commands as non-root user On Master

mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config

Step4: Run below commands on master node to Deploy Calico network

curl https://raw.githubusercontent.com/projectcalico/calico/v3.25.0/manifests/calico.yaml -O
kubectl apply -f calico.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.49.0/deploy/static/provider/baremetal/deploy.yaml

Run commands mentioned in this doc to https://beginner.academy/kubernetes-shortcuts/ validate Kubernetes cluster & perform deployment verification test.

Jenkins – From Zero to Hero

0

Module 1: Introduction to Jenkins 🌟

• Understanding continuous integration and its benefits ✨

• Introduction to Jenkins and its features 🌈

• Jenkins installation and setup 🖥️

Module 2: Jenkins Basics 🏗️

• Exploring the Jenkins dashboard and user interface 📊

• Creating and configuring Jenkins projects/jobs ⚙️

• Working with Jenkins plugins 🧩 • Managing Jenkins nodes and agents 🌐

Module 3: Building Jobs 🏭

• Introduction to Groovy 🌱

• Fundamentals of Groovy scripting 📜

• Configuring source code repositories (Git, SVN, etc.) 📂

• Setting up build triggers ⏰

• Building and testing applications using Jenkins 🏗️✅

• Managing build artifacts 🗃️

Module 4: Jenkins Pipelines 🚦

• Introduction to Jenkins pipelines and their advantages 🌠

• Writing and executing scripted pipelines 📝

• Creating and running declarative pipelines 🎭

• Advanced pipeline concepts (parameters, stages, parallelization) 🚀🔁

Module 5: Jenkins Plugins and Integrations 🧩🔗

• Exploring popular Jenkins plugins for different purposes (testing, deployment, etc.) 📦

• Integrating Jenkins with external tools (JIRA, SonarQube, Slack, etc.) 🛠️

• Customising Jenkins with Groovy scripts 🎨

Module 6: Jenkins Security 🔒

• User management and authentication in Jenkins 👥🔑

• Securing Jenkins with access controls 🛡️

• Best practices for securing the Jenkins environment 🚧

Module 7: Jenkins Scaling and High Availability ⚖️🔁

• Configuring Jenkins for distributed builds 🌐

• Setting up Jenkins in a master-slave architecture 🏰

• Ensuring high availability and fault tolerance 🚀⚙️

Module 8: Monitoring and Troubleshooting 🕵️‍♀️🔧

• Monitoring Jenkins performance and resource usage 📊⚙️

• Troubleshooting common Jenkins issues ❗

• Log analysis and debugging techniques 📝🔍

Module 9: Jenkins Best Practices 🥇✨

• Best practices for efficient Jenkins usage 💡

• Implementing automated testing and code quality checks ✅🧪

• Continuous delivery and deployment strategies 🚀📦

Module 10: Jenkins in Real-World Scenarios 🌍📚

• Case studies and examples of Jenkins implementations 📂🔬

• Tips and tricks for optimising Jenkins for specific use cases 💡💪

• Q&A and discussions on real-world challenges and solutions 🗣️🤝

DevOps Q & A

0

What is DevOps?

The full form of DevOps is Development Operations.

DevOps is the union of people, process, and technology to continually provide value to costumers.

In simple terms DevOps speeds up the process of delivering applications and software services.

Kubernetes For Beginners

0

Kubernetes Main Resources

✔𝗡𝗼𝗱𝗲: A Node is a Kubernetes cluster’s worker computer. Either a physical or virtual machine may be used. The operating and management of the pods is done by the nodes.

✔𝗡𝗮𝗺𝗲𝘀𝗽𝗮𝗰𝗲: The cluster resources can be split up into virtual clusters using namespaces. It gives names a range and enables many teams or projects to share the same physical cluster while isolating their resources.

✔Deployment : simplifies the process of managing and controlling the lifecycle of applications in a Kubernetes cluster, making it easier to deploy and update applications with minimal downtime and manual intervention.

✔𝗥𝗲𝗽𝗹𝗶𝗰𝗮𝗦𝗲𝘁: ReplicaSets are Kubernetes objects that guarantee a certain number of pod replicas are always active. Scaling and managing the number of pods for a certain application are done using it.

✔Ingress: in Kubernetes is an API object that serves as an entry point for external traffic into the cluster, acting as a layer between the external world and the services running inside.

✔𝗦𝗲𝗿𝘃𝗶𝗰𝗲: A logical set of pods and a policy for accessing them are defined by a service, which is an abstraction. For the pods behind it, it offers a reliable network endpoint (IP address) and load balancing.

✔𝗣𝗼𝗱: A Pod is the smallest and most basic unit in Kubernetes. It represents a single instance of a running process or a set of tightly coupled processes running together on a node. Pods are scheduled and managed by Kubernetes.

✔Network policies: in Kubernetes are a set of rules that control the traffic flow between pods within a cluster. Network policies enhance security and provide granular control over network traffic within the cluster.

✔Persistent Volumes (PVs): Kubernetes are storage resources that provide durable and independent storage for applications. PVs enable data persistence and can be dynamically provisioned or statically allocated within the cluster.

✔Persistent Volume Claims : (PVCs) in Kubernetes are requests made by applications for storage resources. PVCs provide a convenient abstraction layer, allowing applications to request and access persistent storage without directly dealing with specific PVs.

✔Service Accounts: in Kubernetes are used to provide an identity and access control for pods within the cluster. Service Accounts facilitate secure communication and authorization between pods and the Kubernetes cluster.

✔Storage Classes : in Kubernetes are used to dynamically provision different types of storage volumes based on predefined configurations.It enable flexibility and scalability in allocating storage for applications within the cluster.

Kubernetes Shortcuts

kubectl get no
kubectl get ns
kubectl get deploy
kubectl get rs
kubectl get ing
kubectl get svc
kubectl get po
kubectl get netpol
kubectl get pv
kubectl get pvc
kubectl get sa
kubectl get sc

Beginner Academy

ResourceShortcutsCommand
Nodenokubectl get no
Namespacenskubectl get ns
Deployment deploykubectl get deploy
Replica Setrskubectl get rs
Ingressingkubectl get ing
Servicessvckubectl get svc
Podpokubectl get po
Network policiesnetpolkubectl get netpol
Persistent Volumespvkubectl get pv
Persistent Volume Claimspvckubectl get pvc
Service Accountssakubectl get sa
Storage Classessckubectl get sc

Kubernetes frequently used Commands

  1. kubectl get: Retrieve information about resources in the cluster.
    kubectl get pods: List all pods.
    kubectl get deployments: List all deployments.
    kubectl get services: List all services.
    kubectl get nodes: List all nodes in the cluster.
kubectl get pods
kubectl get deployments
kubectl get services
kubectl get nodes

2.kubectl describe: Provide detailed information about a specific resource.
kubectl describe pod <pod-name>: Get detailed information about a pod.
kubectl describe deployment <deployment-name>: Get detailed information about a deployment.
kubectl describe service <service-name>: Get detailed information about a service.

kubectl describe pod <pod-name>
kubectl describe deployment <deployment-name>
kubectl describe service <service-name>

3.kubectl create: Create a resource from a YAML or JSON file.
kubectl create -f <filename.yaml>: Create a resource from a YAML file.
kubectl create deployment <deployment-name> — image=<image-name>: Create a deployment using a specified image.

kubectl create -f <filename.yaml>
kubectl create deployment <deployment-name> - image=<image-name>

4.kubectl delete: Delete a resource.
kubectl delete pod <pod-name>: Delete a pod.
kubectl delete deployment <deployment-name>: Delete a deployment.
kubectl delete service <service-name>: Delete a service.

kubectl delete pod <pod-name>
kubectl delete deployment <deployment-name>
kubectl delete service <service-name>

5.kubectl scale: Scale the number of replicas in a deployment.
kubectl scale deployment <deployment-name> — replicas=<number>: Scale the number of replicas for a deployment.

kubectl scale deployment <deployment-name> - replicas=<number>

6.kubectl logs: Print the logs of a pod.
kubectl logs <pod-name>: Print the logs of a pod.

kubectl logs <pod-name>

7.kubectl exec: Execute a command on a pod.
kubectl exec -it <pod-name> — <command>: Execute a command on a pod interactively.

kubectl exec -it <pod-name> - <command>

8.kubectl apply: Apply changes to a resource defined in a YAML or JSON file.
kubectl apply -f <filename.yaml>: Apply changes to a resource using a YAML file.

kubectl apply -f <filename.yaml>

Beginners Tutorials for Azure DevOps

0

Introduction to Azure DevOps – Week1

  1. Overview of Azure DevOps
  2. History and evolution of Azure DevOps
  3. Azure DevOps services and their features
  4. Benefits of using Azure DevOps
  5. Azure DevOps pricing and plans

Getting Started with Azure DevOps – Week1

  1. Creating an Azure DevOps account
  2. Creating a project
  3. Adding users and setting permissions
  4. Configuring project settings
  5. Navigating the Azure DevOps interface

Azure Repos – Week2

  1. Creating and managing repositories
  2. Cloning and syncing repositories
  3. Branching and merging strategies
  4. Using Git commands
  5. Using pull requests and code reviews

Azure Pipelines – Week3 & Week4

  1. Creating and configuring CI/CD pipelines
  2. Creating build and release definitions
  3. Using YAML pipelines
  4. Managing pipeline triggers and schedules
  5. Integrating with other tools and services

Test Plans – Week5

  1. Creating and managing test cases
  2. Setting up and managing test plans and suites
  3. Running manual and automated tests
  4. Viewing and analysing test results
  5. Integrating with other testing tools and services

Azure Artifacts – Week6

  1. Creating and managing packages
  2. Setting up and managing feeds
  3. Publishing and consuming packages
  4. Configuring upstream sources and downstream consumers
  5. Integrating with other package managers

Integrating Azure DevOps with Other Tools – Week7

  1. Integrating with Jira and other issue trackers
  2. Integrating with Slack and other messaging platforms
  3. Integrating with Microsoft Teams and other collaboration tools
  4. Using webhooks and APIs for custom integrations
  5. Managing integrations and security settings

Azure Boards & Azure Wiki – Week8

  1. Creating and managing work items
  2. Setting up and managing sprints
  3. Using Kanban boards
  4. Customising boards and work item fields
  5. Creating queries and charts

Best Practices for Azure DevOps – Week8

  1. Creating effective work items and user stories
  2. Managing branches and pull requests effectively
  3. Setting up and managing pipelines for different scenarios
  4. Optimising pipelines for speed and efficiency
  5. Using Azure DevOps analytics and insights for continuous improvement

If you are a beginner or individual who wants to switch to/learn IT DevOps/cloud/Kubernetes. Then please join.

Linkedin: https://www.linkedin.com/in/sangamesh-kotni-4b92989/

Youtube: https://www.youtube.com/beginneracademy?sub_confirmation

Telegram: https://t.me/beginner_academy

Whatsapp: https://chat.whatsapp.com/Jj4OCwRdOq43JpfCIeWYAq

Facebook: https://www.facebook.com/groups/580314426414395/

Instagram: https://www.instagram.com/beginner.academy/

All the Social Media groups of BA can be found in  https://linktr.ee/beginner.academy

Introduction to Ansible

0
Table of Contents

What Is Ansible?

Ansible is NO.1 Configuration management tool

Ansible is an Open source IT Automation tool. Mainly used to automate configuration management activities.

If we want to install software/update patches in 1 machine then it is easy and may take 10 minutes to do this task. But think that, we need to do the same activity on 12 Machines, then it would take 2 hours of effort. If we automate the same task using ansible, we will save time and there is no scope of human error and our Infra configuration would be as code. We can modify and can reuse the same.

Using Ansible, we can automate almost all the regular IT tatsks/process.

  • Automate daily and repetitive tasks
  • Application deployments
  • Installation of softwares
  • Patching of softwares
  • Any configuration changes related to any Application or any softwares.
  • To improve security and compliance

Why Ansible is so popular?

  • It is an Open source, i.e. free to use
  • Easy to learn and automate.
  • It is agent less. Hence no headache of maintaining agents.
  • Easy to install, anyone can install and start working on ansible within short time compared to its competitors.
  • It has great community support, after ansible was acquired by redhat.

How to install Ansible on laptop?

Steps for Mac

Run below command to install it pip
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
$ python get-pip.py --user
Run below command to install Ansible
$ python -m pip install --user ansible

Or install Ansible using brew
brew install ansible

Steps for Linux

Below is the command to run on RHEL
sudo yum install ansible

Below is the command to run on Ubuntu
$ sudo apt update
$ sudo apt install software-properties-common
$ sudo add-apt-repository --yes --update ppa:ansible/ansible
$ sudo apt install ansible

Steps for Windows

As of now, Ansible cannot work natively on a Windows host. So there is no direct way to install Ansible on Windows OS. However, there are different ways to use Ansible on Windows for practice purposes.

  1. Using Cygwin and then installing ansible
  2. Using a Linux Virtual Machine via Virtual Box and then installing ansible.

What are all the basic commands of Ansible?

  • ansible localhost -m ping
    • This is to check if the Ansible installation is good.
    • This runs single command
    • It runs the ping command on the local host
  • ansible-playbook playbooks/PLAYBOOK_NAME.yml
    • The playbook is a list of plays, with each play performing multiple tasks.
  • ansible-playbook playbooks/PLAYBOOK_NAME.yml –tags firsttask
    • Used to run only specific tasks.
    • In this command it runs all tagged function by firsttask name.
  • ansible-playbook playbooks/PLAYBOOK_NAME.yml –skip-tags secondtask
    • Used to skip specific tasks.
    • This command skip all tagged tasks named secondtask.

Reference urls of Ansible

https://www.redhat.com/en/topics/automation/learning-ansible-tutorial

https://www.ansible.com/overview/how-ansible-works

https://docs.ansible.com/

DevOps for beginners

0

What Is DevOps?

The word “DevOps” is combination of Development + Operations , It is practice which helps both IT streams to work collaboratively rather than in silos.

Before DevOps, We had below respective responsibilities of each teams.

Development Team:- Use to build the take months together time to build application and once application is tested in their local environment, It used to handed over to operation team.

Operations Team:- Used to do deployment into test preprod and prod environment and support the application as well as the servers which has hosted these applications.

Problems faced before DevOps

There was always an issue with owning responsibility for any bugs raised in higher environments. Development team used to say this issues is not development issue and works fine in my local environment.

Operations Team is to complain, this issue wasn’t there in previous release. So debate used to happen for each release and direct impact is on the customers.

After DevOps

As part of DevOps culture, It bridges the gap between development and operations teams. This was missing before.

  • It brought all the teams involved in building and maintaining of application as one team
  • Rather than passing the ball/working in silos for any issue between these IT teams.
  • Each member of team came forward with mindset of “how can we help to fix this issue?”
  • This resulted in fixing issue in short period of time.
  • We release small features and make it live very frequently rather than going big bang release.
  • Automate as much as possible, so that there is no human errors and all the environments are identical.

Why DevOps is so popular??

  • Time to market is shortened.
  • Wherever it is possible Automation of all the tasks.Which resulted in less human errors.
  • Early detection of any issues in development cycle only.
  • Code quality checks at development stages only fixed.
  • DevOps creates efficiency.
  • Improved communication between teams.
  • DevOps establish a growth mindset. We will fail fast and incorporate learnings into their processes
  • Continually improving, increasing customer satisfaction
  • Accelerating innovation and market adaptability.

Reference urls of DevOps

https://azure.microsoft.com/en-gb/overview/what-is-devops/

https://aws.amazon.com/devops/what-is-devops/

https://cloud.google.com/devops