Skip to main content

Posts

aws&Devops Interview questions and answers

 1.How to mount unmount  a disk ? First we can check disk partition fdisk -l or lsblk  * we can create a directory where we want mount    sudo mkdir /mnt/mydisk *we can use mount command to mount the disk    sudo mount /dev/sdXn /mnt/mydisk *To unmount disk     sudo umount /mnt/mydisk 2. How to unlock the username? *If a user account is locked due to multiple failed login attempts Then we can use below command  sudo passwd -u username 3.How to set user to NO LOGIN *If we don't require interactive logins. Then we can use below command sudo usermod --shell /usr/sbin/nologin username The usermod command can be used to modify user account properties 4.what are the process states in linux The Linux process states are many *Running (R).   : we are executing instructions on CPU *Sleeping(S)    : Sleeping processes are not using CPU resources * Stopped (T).  : A stopped process can be resumed or terminated. *Zombie (Z): ...

aws Devops course content

   aws 1.EC2 2.Installing nginx ,httpd,tomcat and jenkins on top redhat ec2 machine     security group   How we can connect to machine   Linux basic commands 3.vpc 4.s3 bucket 5.IAM 6.ROUTE53 7.Autoscalling 8.Load balacner     _____-Infra as a code----------------- Terraform a. ec2 machine creation b. Packer - creating our own AMI c.s3 bucket ,vpc and IAM we can up by using terraform   Task:Terraform Integration  with jenkins  ---------------------------Cloudformation----- services how we can up in aws How we can deploy war file inside s3 bucket after building maven project in jenkins ------------------------------------------     DevOps SCM  ----Git  All git commands Webhoks concept with jenkins ---------  Jenkins -------------------- Ansible   (Configuration management tool) 1.How we can create ec2 machine by using anible playbook 2.how we can install httpd on ec2 machine by playbook 3.In tw...

shell scripting and important linux questions and answers

 1.echo $0 what it means?     It will show the name of the currently running process Example: prepare test.sh #!/bin/bash echo $0 Then run test.sh after giving permission to chmod 700 test.sh root@ip-172-31-15-196:~# chmod 700 test.sh root@ip-172-31-15-196:~# ./test.sh ./test.sh 2.How to create 100 empty files at a time? touch file-{001..100} 3.What is hardlink and softlink and how it will be work and what is the difference between them? Hard link:  1.If we delete original file our data will be available 2.Inode number of both original file and hard link file both are same 3.Hard links are fast . Soft link: 1.If we delete original file our data will not be available 2.inode of original file and soft link file are different 3.Soft links are slower. 4.soft links can be used for linking directories 5.soft links will work across file systems. 6.File permissions are different. Creating sof link creating a file1.txt [root@ip-172-31-43-210 linux]# echo "ashwika tech" >...

Listout aws ec2 machines.

 1. aws ec2 describe-instances --filters "Name=instance-type,Values=t2.micro" --query "Reservations[].Instances[].InstanceId" 2. aws ec2 describe-instances --filters "Name=instance-type,Values=t2.medium" --query "Reservations[].Instances[].InstanceId" 3.To list out security groups  aws ec2 describe-security-groups --group-ids

How to copy files from one server to another server by using ansible copy module

 We have two servers 1.master 2.worker1 create playbook example: play.yml ---   - hosts: all     tasks:     - name: Ansible copy file to remote server       copy:        src: ~/kube-cluster        dest: /root Run ansible playbook  ansible-playbook play.yml

Jenkins with sonarqube and nexus

 Jenkins installation on redhat machine installation of java on   yum install wget -y  yum install java-1.8.0-openjdk-devel.x86_64 Jenkins nstallation ----------------------- i.  sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo ii. sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key iii.sudo yum install jenkins iv. service jenkins start  service jenkins status ====================sonarqube setup========== Sonarqube on amazon linux ec2 machine Install docker on amazonlinux ec2 then run below command docker run -d --name sonarqube -e SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true -p 9000:9000 sonarqube:latest =====Integration of sonarqube and jenkins================================ -----In jenkins we need to install SonarQube Scanner plugin--- Then go to manage jenkins and click on configure system In middle we have SonarQube servers option will be there clcik on Add sonar give name and url http://44.192...

How to enable kubernetes ingress

1.First install ingress on kubernetes cluster 2.Then take which deployment you want to expose outside  Here i was taken apple and banana deployment

How to install apache and Tomcat on both master and worker same time by running ansible play book on master machine

Follow the steps Step-1 1.Take two ubuntu 16.04 machines and enable ssh between them 2.Update host file information on master machine 3.Then do ping test between master and worker machine 4. create apache2.yml playbook --- - hosts: servers  #server host or group name   sudo: yes   tasks:     - name: install apache2       apt: name=apache2 update_cache=yes state=latest     - name: enabled mod_rewrite       apache2_module: name=rewrite state=present       notify:         - restart apache2   handlers:     - name: restart apache2       service: name=apache2 state=restarted Then run ansible play book on master machine then check on both master and worker machine public ip on browser to confirm apache was installed or not . Installing Tomcat After this run play book Then you can check on browser of ...

How to create a user in kubernetes cluster and assign read only permissions

root@ip-172-31-16-42:~# kubectl get secrets NAME                  TYPE                                  DATA   AGE default-token-2m258   kubernetes.io/service-account-token   3      48m root@ip-172-31-16-42:~ # kubectl create serviceaccount readonlyuser serviceaccount/readonlyuser created root@ip-172-31-16-42:~# kubectl create clusterrole readonlyuser --verb=get --verb=list --verb=watch --resource=pods clusterrole.rbac.authorization.k8s.io/readonlyuser created root@ip-172-31-16-42:~ # kubectl create clusterrolebinding readonlyuser --serviceaccount=default:readonlyuser --clusterrole=readonlyuser clusterrolebinding.rbac.authorization.k8s.io/readonlyuser created root@ip-172-31-16-42:~# TOKEN=$(kubectl describe secrets "$(kubectl describe serviceaccount readonlyuser | grep -i Tokens | awk '{print $2}')" | g...

Openshift commands

oc comands 1. oc get pods 2.oc describe pod nginx-78f5d695bd-7x4xm 3. oc get all 4. oc get svc 5.oc delete pod mysql-1-deploy -n myproject --grace-period=0 --force 6. Oc Dashboard

Grafana with Prometheus database

1.After adding Prometheus database with Grafana it showing successfully all the namespaces and related pods.

Docker with jenkins troubleshooting

1.When a docker machine is integrated with jenkins after running a build it shows unstable for that how you can make trouble shoot? To avoid these permission issues run the following command sudo chmod 666 /var/run/docker.sock 2.What is docker? Docker it is a tool designed to make it easier to create, deploy, and run applications by using containers. 3.What is docker file? A Dockerfile is a text document it contains all the commands a user could call on the command line to assemble an image.  4.what is docker image? Docker images are executable packages that include everything needed to run an application — the code, a runtime, libraries, environment variables, and configuration files. 5.what is container? container it is nothing but a running state of image 6.Docker commands

Build and release interview questions and answer

1. What challenges you have faced in your experience    A)Faced issue while setting up HA(High availability kubernetes cluster) by using kubespray to setup master and worker nodes    B)Uploading microservices dashboards in to grafana .    c)After build deploying war file in to s3 bucket   2. What type of build failure you have seen and how u fixed ?    when doing maven project build was failled due to maven version not supported after fixing the maven version Build was success and job was stable 3. Same question for deployment how u fixed deployment issues    In kubernetes when i am going to deploy elasticsearch in kubernetes cluster i fixed the limit and       requests count i.e GB then finally deployment was success. 4. What type of automation scripts you have written    For automation purpose we written groovy script according to that we made different stages build ,   test an...

Linux commands

1. netstat --listen To check which ports are in listening in Linux Server 2.lsof lsof  means List of file, we can know which file is opened by which process. 3.systemctl status To check status of the service 4.  ps -ef | grep httpd To check process 5. top By this top command to determine which processes are running and how much memory and CPU they are consuming. 6.df    df stands for display free disk space we  can use df command to troubleshoot disk space issues. 7.df -h  This command show free space on mounted file systems.     8.fdisk -l  fdisk -I command show disks partitions sizes and types. 9.free - h free  command gives you a summary of the memory usage with our computer. It does this for both the main Random Access Memory (RAM) and swap memory also. 10. kill kill  command allows you to terminate a process from the command line...

Jenkins interview questions and answers

1. In Jenkins I have a 3 jobs like env , uat , prod Case 1 If trigger a job 'env', based on condition it go-to 'uat 'job and trigger job Case2 trigger a job 'env', based on condition it go-to 'prod' job and trigger job How to write job freestyle or pipeline? A. Install build pipe line plugin Then click on plus symbol in that view name give Buildpipelinetest select .Build Pipeline View then click on ok. under select Upstream / downstream config   Select Initial Job as env Then next select similarly uat and next prod then these three will be chain linked and each one build one by one if one becomes success.

Kubernetes interview questions and answers

1.H ow to setup kubernetes dashboard on ubuntu16.04 cluster? To create kubernetes dashboard follow below link https://docs.aws.amazon.com/eks/latest/userguide/dashboard-tutorial.html To deploy the Metrics Server kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.3.6/components.yaml kubectl get deployment metrics-server -n kube-system Deploy the dashboard kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-beta8/aio/deploy/recommended.yaml root@ip-172-31-43-76:~# kubectl get svc -n kubernetes-dashboard NAME                        TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)         AGE dashboard-metrics-scraper   ClusterIP   10.102.6.123   <none>        8000/TCP        120m kubernetes-dashboard  ...