├── Devops_Best_Practises.md
├── Devops_mock_interview_1.md
├── Devops_mock_interview_2.md
├── Devops_mock_interview_3.md
├── Devops_mock_interview_4.md
├── Devops_mock_interview_5.md
├── Devops_mock_interview_6.md
├── Devops_mock_interview_7.md
├── Devops_mock_interview_8.md
└── Devops_mock_interview_8
└── shell_script
├── color.sh
├── color2.sh
├── dependency_managment
├── README.md
├── addition
│ ├── pom.xml
│ ├── src
│ │ ├── main
│ │ │ └── java
│ │ │ │ └── App.java
│ │ └── test
│ │ │ └── AppTest.java
│ └── target
│ │ ├── addition-1.0.jar
│ │ ├── classes
│ │ └── com
│ │ │ └── apple
│ │ │ └── com
│ │ │ └── App.class
│ │ ├── maven-archiver
│ │ └── pom.properties
│ │ └── maven-status
│ │ └── maven-compiler-plugin
│ │ └── compile
│ │ └── default-compile
│ │ ├── createdFiles.lst
│ │ └── inputFiles.lst
├── pom.xml
├── project.status
└── substraction
│ ├── pom.xml
│ ├── src
│ ├── main
│ │ └── java
│ │ │ └── App.java
│ └── test
│ │ └── AppTest.java
│ └── target
│ ├── classes
│ └── com
│ │ └── apple
│ │ └── com
│ │ └── App.class
│ ├── maven-archiver
│ └── pom.properties
│ ├── maven-status
│ └── maven-compiler-plugin
│ │ └── compile
│ │ └── default-compile
│ │ ├── createdFiles.lst
│ │ └── inputFiles.lst
│ └── substraction-1.0.jar
├── function.sh
├── maven.sh
├── project.list
├── sample_java
├── pom.xml
├── pom_eff.xml
├── src
│ ├── main
│ │ └── java
│ │ │ └── App.java
│ └── test
│ │ └── AppTest.java
└── target
│ └── site
│ ├── css
│ ├── maven-base.css
│ ├── maven-theme.css
│ ├── print.css
│ └── site.css
│ ├── dependencies.html
│ ├── dependency-info.html
│ ├── images
│ ├── close.gif
│ ├── collapsed.gif
│ ├── expanded.gif
│ ├── external.png
│ ├── icon_error_sml.gif
│ ├── icon_info_sml.gif
│ ├── icon_success_sml.gif
│ ├── icon_warning_sml.gif
│ ├── logos
│ │ ├── build-by-maven-black.png
│ │ ├── build-by-maven-white.png
│ │ └── maven-feather.png
│ └── newwindow.png
│ ├── index.html
│ ├── plugin-management.html
│ ├── plugins.html
│ ├── project-info.html
│ └── summary.html
└── shift.sh
/Devops_Best_Practises.md:
--------------------------------------------------------------------------------
1 | ## Shell scripting
2 | 1. **Use Indentation**
3 | ```
4 | Indentation is an important part of making your code more readable and understandable.
5 | It can help you see the structure of your code at a glance and make it easier to follow.
6 | ```
7 | 2. **Use Meaningful Variable Names**
8 | ```
9 | Using meaningful variable names can help make your code more readable and understandable.
10 | It also makes it easier for others to maintain your code if they need to modify it in the future.
11 | ```
12 | 3. **Dont hard code the same values multiple times in the script, Instead use Variables to store the value and refer it where ever its required**
13 | ```
14 | When creating shell scripts for automation, avoid hardcoding values such as IP addresses, file paths, or other system-specific details.
15 | Instead, use variables or configuration files to store and reference this information.
16 | This will make the script more portable and easier to maintain in the future.
17 | ```
18 | 4. **Use Functions**
19 | ```
20 | Functions are blocks of code that can be called multiple times from within a script.
21 | They help to keep the code organized and make it easier to maintain.
22 | ```
23 | 5. **Use Error Checking**
24 | ```
25 | error checking is an important part of shell scripting, especially for DevOps automation.
26 | It helps you catch errors early on and prevent them from causing problems down the line.
27 | ```
28 | 6. **Dont have many prompts, Instead use parameters**
29 | ```
30 | Users will be annoyed if you have too many prompts, instaed of that ask user to send it as parameters.
31 | By using $1,$2,$3..$n you can easily access them in any part of the script
32 | ```
33 | 7. **Use $() instead of backticks, to evaluate command and store o/p in variable**
34 | ```
35 | if you have backticks in the script, it will very hard to read.
36 | $() increases the readability and has many other advantages too
37 | ```
38 | ----------------
39 |
40 | ## Docker
41 |
42 | 1. **Understand Build context and dockerignore**
43 | ```
44 | The “.” parameter in docker build instruction is the build context.
45 | So never run Dockerfile in a folder where so many files exists it will try to copy everything , Instead create empty folder to build or build Dockerfile where only required files exists
46 | Also, create a .dockerignore file to explicitly exclude files and directories.
47 | ```
48 |
49 | 2. **Rootless containers**
50 | ```
51 | Never run ENTRYPOINT/CMD instructions with root user, by default it run's with root user.
52 | However, it is a Dockerfile best practice to avoid doing that.
53 | There are very few use cases where the container needs to execute as root, so don’t forget to include the USER instruction to change the default effective UID to a non-root user.
54 | ```
55 | 3. **Multistage Dockerfiles**
56 | ```
57 | In a multistage build, you create an intermediate container – or stage – with all the required tools to compile or produce your final artifacts (i.e., the final executable).
58 | Then, you copy only the resulting artifacts to the final image, without additional development dependencies, temporary build files, etc.
59 |
60 | A well crafted multistage build includes only the minimal required binaries and dependencies in the final image, and not build tools or intermediate files.
61 | This images size drastically, reduces the attack surface & decreasing vulnerabilities.
62 | ```
63 | 4. **Use trusted base images**
64 | ```
65 | Carefully choose the base for your images (the FROM instruction).
66 |
67 | Building on top of untrusted or unmaintained images will inherit all of the problems and vulnerabilities from that image into your containers.
68 | ```
69 | 5. **Use smaller base images like alpine version, buster versions if possible**
70 | ```
71 | By which we can create smaller images and small images are faster to pull over the network and faster to load into memory when starting containers or services.
72 | ```
73 |
74 | ## Kubernetes
75 | 1. **Use Namespaces**
76 | ```
77 | Namespaces are very important in organizing your Kubernetes cluster and keeping it secured from other teams working on the same cluster.
78 | If your Kubernetes cluster is large (hundreds of nodes) and multiple teams are working on it, you need to have separate namespaces for each team.
79 | ```
80 | 2. **Use Proper labels**
81 | ```
82 | A Kubernetes cluster includes multiple elements like services, pods, containers, networks, etc.
83 | Maintaining all of these resources and keeping track of how they interact with each other in a cluster is cumbersome.
84 | This is where labels come in. Kubernetes labels are key-value pairs that organize your cluster resources.
85 | ```
86 | 3. **Readiness and Liveness Probes**
87 | ```
88 | Readiness and liveness probes are strongly recommended; it is almost always better to use them than to forego them. These probes are essentially health checks.
89 |
90 | - Readiness probe
91 | Ensures a given pod is up-and-running before allowing the load to get directed to that pod.
92 | If the pod is not ready, the requests are taken away from your service until the probe verifies the pod is up.
93 |
94 | - Liveness probe
95 | Verifies if the application is still running or not.
96 | This probe tries to ping the pod for a response from it and then check its health.
97 | If there is no response, then the application is not running on the pod.
98 | The liveness probe launches a new pod and starts the application on it if the check fails.
99 | ```
100 | 4. **Set Resource Requests & Limits**
101 | ```
102 | Occasionally deploying an application to a production cluster can fail due limited resources available on that cluster.
103 | This is a common challenge when working with a Kubernetes cluster and it’s caused when resource requests and limits are not set.
104 | Without resource requests and limits, pods in a cluster can start utilizing more resources than required.
105 | If the pod starts consuming more CPU or memory on the node, then the scheduler may not be able to place new pods, and even the node itself may crash.
106 |
107 | Resource requests specify the minimum amount of resources a container can use
108 | Resource limits specify the maximum amount of resources a container can use.
109 | ```
110 |
111 | 5. **Don’t Run as Root**
112 | ```
113 | The UID (the Kubernetes systems-generated string that uniquely identifies objects) of the user running a container maps directly to the host. If the container runs as UID 0 (root), it will also appear as root on the node it’s running on.
114 |
115 | Kubernetes has built-in protections to prevent escalation of privileges with this mechanism, However, there’s always a chance that security issues could allow for escalating privileges. Avoid the situation by not running run your containers as root. Instead, modify the Dockerfile for your built containers to create and use a user with a known UID.
116 | ```
117 |
118 | ## Jenkins
119 | 1. **Cleaning up old Jenkins builds**
120 | ```
121 | As a Jenkins administrator, removing old or unwanted builds keeps the Jenkins controller running efficiently. When you do not remove older builds, there are less resources for more current and relevant builds. This video reviews using the buildDiscarder directive in individual Pipeline jobs. The video also reviews the process to keep specific historical builds.
122 | ```
123 | 2. **Never hardcode secrets or credentials in pipeline**
124 | ```
125 | if you hard code in pipeline as its CICD tool many people will have access to pipeline code or build logs, so there might be a chance to mis-usage of the secrets.
126 | Use credntials by which you can secure secret values
127 | ```
128 | 3. **Install only required plugins**
129 | ```
130 | dont install plugins unnecessarily it might createissues with the security, storage or restart of jenkins.
131 | ```
132 | 4. **Executor count in node configuration**
133 | ```
134 | Use as less executors as possible, if the value is high then node will used for executing multiple builds. Pipeline execution time will be increased because it should share resources.
135 | If value is high sometimes nodes will become unresponsive.
136 | ```
137 | 5. **Use parallel execution of stages when stages are not dependent on each other**
138 | ```
139 | This makes pipeline to execute faster and nodes can serve other pipeline runs
140 | ```
141 |
142 | ## Ansible
143 |
144 | 1. **Use roles to keep playbooks well-organized**
145 | ```
146 | Roles keep ansible playbook organized,easier maintanance & increases reusabilty.
147 | ```
148 |
149 | 2. **make use ansible vault in case if you have any secrets**
150 | ```
151 | The more you use Ansible, more tasks become automated. You will reach a point, that things such as SSL configuration, database passwords needs to be automated.
152 | This is where Ansible provides the vault module so you could safely save these data and automate it without any risks.
153 | ```
154 |
155 | 3. **Turn on Gather Facts only when required**
156 | ```
157 | When a playbook is executed, Ansible starts collecting facts (data that is stored into variables) about the remote host prior execution. These details include variables from the remote host such as network configuration variables, hostnames so you could use it in your playbook.
158 |
159 | This is a time-consuming process, in order to speed up the execution of the playbook we turn gathering facts off.
160 | ```
161 |
162 |
163 |
--------------------------------------------------------------------------------
/Devops_mock_interview_1.md:
--------------------------------------------------------------------------------
1 | - Mock interview video - https://youtu.be/i7YJesoeWFI
2 | - Mock interview Answers - https://youtu.be/5w8qVukxXXY
3 |
4 | GIT
5 | ---------------------------------------------------------------------------------------------------------------------------------
6 | 1. Why we need git? What makes git unique from other tools like SVN?
7 | 2. Let's say i have maven repo cloned on to my local, did some changes and i have build the code now target folder will be generated. So now when i do git operations like git add, git commit or any other git operations target folder should not be considered, how would you achieve the same?
8 | 3. difference between git pull and git fetch?
9 | 4. How to clone specific branch in git?
10 |
11 | Maven
12 | --------------------------------------------------------------------------------------------------------------------------
13 | 5. when i issue mvn install what all things happen in background?
14 | 6. what are the settings you need to do before running mvn deploy?
15 | 7. why maven takes much time for 1st execution and from 2nd execution it will take less time?
16 |
17 | Unix and Shell Scripting
18 | --------------------------------------------------------------------------------------------------------
19 | 8. How to get present working folder?
20 | 9. How to copy files from local windows machine to cloud based Linux machine?
21 | 10. A shell script named test.sh can accept 4 parameters i.e, a,b,c,d. the parameters wont be supplied in order always and number of parameters might also vary( only 2 parameters user might supply sometimes), how to identify position of letter c?
22 |
23 | Ansible
24 | ---------------------------------------------------------------------------------------------------------------------
25 | 11. Why we need ad-hoc ansible commands, scenario where you have used ansible ad-hoc command?
26 | 12. When i need detailed logs on executing ansible playbook what option i need to use?
27 | 13. what is ansible.cfg file?
28 | 14. what are the modules have you worked on? which module will you use for getting the file from node to master?
29 | 15. Lets say i have a playbook which has 5 tasks in playbook, first 2 tasks should run on local machine and other 3 tasks should run on node?
30 |
31 | Jenkins
32 | -----------------------------------------------------------------------------------------------------------------------
33 | 16. How to save only last 5 builds of jenkins job?
34 | 17. Have you worked on Jenknsfile? can we use docker container as a node in Jenkinsfile? Who will handle docker container creation and deletion? If i am building a maven project always docker container is fresh instance it will try to download dependency from repository, what measures you will take to reduce build time?
35 | 18. Why we need multi branch pipeline?
36 | 19. If you forget Jenkins password, how would you login back?
37 |
38 | Docker
39 | ------------------------------------------------------------------------------------------------------------------------------
40 | 20. Any 3 best practices of docker?
41 | 21. Difference between docker stop and docker kill?
42 | 22. Command to list conatiners which state is exited?
43 | 23. command to clean-up docker host ( deleting stopped conatiners, dangling images and unused networks)?
44 | 24. What version of docker you have used? Specific reason to use that particular version?
45 | 25. Can we have multiple CMD in Dockerfile?
46 | 26. Have you worked on docker swarm and docker compose?
47 |
48 | Kubernetes
49 | --------------------------------------------------------------------------------------------------------------------------------------
50 | 27. Can we have multiple conatiners in a pod? Can we have similar conatiners in a pod? Lets say i have 4 conatiners, one of them has failed how would you check which container has failed?
51 | 28. What is liveness and readiness probe? Why we need them?
52 | 29. Have you worked on kubernetes monitoring? Which tools you have used?
53 | 30. Can we deploy a pod on particular node?
54 |
--------------------------------------------------------------------------------
/Devops_mock_interview_2.md:
--------------------------------------------------------------------------------
1 | - Mock interview video - https://youtu.be/lXGAJElFxaA
2 | - Mock interview Answers - https://youtu.be/7WJ31VFk1_Y
3 |
4 |
5 | GIT
6 | ---------------------------------------------------------------------------------------------------------------------------------
7 | 1. Lets say your organization has github and bitbucket to store code, you have cloned a repo onto your local and changed directory name. after some days one of your team members asks you to share clone link, how would you provide the same?
8 | 2. I have shell script to delete particular dependency ( repo is maven project ). before running the script i need to clone repo to my local, here point to note i should only clone master branch and only last commit ( last commit has all the code ) how would you do this?
9 | 3. what is submodule and why we need submodule?
10 | 4. Lets say you have changed 5 files a,b,c,d and e in a repo and you did git add ., now all the files are in staging area, now i decided not to commit file d. how would delete it from staging area?
11 |
12 | Maven
13 | --------------------------------------------------------------------------------------------------------------------------
14 | 5. what is multi module project in maven and what are the setting you want to do in multi module parent and child project? what is dependency management?
15 | 6. what is transitive dependency?
16 |
17 | Jenkins
18 | --------------------------------------------------------------------------------------------------------
19 | 7. Have you worked on commit based job in jenkins? what settings you need to do in jenkins and github to setup commit based job?
20 | 8. you want to create 50 freestyle jobs with same configurations, but only change is job name. how would you achieve the same?
21 | 9. How can you copy job from your local jenkins instance to other local jenkins instance?
22 |
23 | Unix and Shell scripting
24 | ---------------------------------------------------------------------------------------------------------------------
25 | 10. write a script which accepts file or folder, if its folder delete it else print "this is a file"?
26 | 11. How to check whether particular port is already in use or not?
27 | 12. Logic for checking whether supplied string for a script is palindrome or not? what are all the commands you will use?
28 | 13. command to get number of lines in a file?
29 |
30 | Ansible
31 | -----------------------------------------------------------------------------------------------------------------------
32 | 14. Lets say i have 4 machines consider 1 as ansible master other 3 as nodes, what are the basic setup you need to do for ansible cluster?
33 | 15. what are ansible roles? why we need ansible roles? have you worked on ansible galaxy?
34 | 16. What are ansible facts?
35 | 17. Can we have windows machine as ansible master? as node?have you worked on any windows modules? can you list few?any extra configuration do we need to do?
36 |
37 | Docker
38 | ------------------------------------------------------------------------------------------------------------------------------
39 | 18. Have you worked on multi-stage dockerfile and why we need that?
40 | 19. Lets say i have container which is attached with a volume, if container crashes what happens to volume?
41 | 20. can you copy a file form local to run container?
42 |
43 |
44 | Kubernetes
45 | --------------------------------------------------------------------------------------------------------------------------------------
46 | 21. what is init container and side-car container?can you give simple scenario where we use these conatiners?
47 | 22. which one is default deployment strategy? how it works?
48 | 23. command to check the container logs in pod?
49 | 24. what are the types of services present in kubernetes?
50 | 25. What is the link between pod and service?
51 |
--------------------------------------------------------------------------------
/Devops_mock_interview_3.md:
--------------------------------------------------------------------------------
1 | - Mock interview video - https://youtu.be/IrIF9IjOwgs
2 | - Mock interview Answers -
3 |
4 |
5 | GIT
6 | ---------------------------------------------------------------------------------------------------------------------------------
7 | 1. What is git-cherry-pick? why we use it?
8 | 2. Let’s say you’re working on new feature in some branch, now your manager says stop working on that and change few other things on old code. Here after changing the old code, I need to work on new code, so I need to place my new changes some place How would handle this scenario?
9 | 3. What is a conflict in git?
10 | 4. command to list all branches in a repo?
11 |
12 |
13 | Maven
14 | --------------------------------------------------------------------------------------------------------------------------
15 | 5. .m2 is local repository for maven, now I don’t want to use .m2 folder as my local repository I want to use some other folder as my local, is it possible in maven? If yes, how would you do that?
16 |
17 | ```
18 | mvn install -Dmaven.repo.local=/alternate/repo/location
19 | ```
20 | 6. maven follows convention over configuration that means it assumes code should be there under src/main/java, test cases under src/tests and many more.Here my requirement is I don’t want to follow that conventions I need to use different folder structure is that possible in maven?
21 | ```
22 | mvn help:effective-pom -Doutput=pom_eff.xml
23 | ```
24 | 7. What are dependency and plugin in maven? Give one example for each?
25 | 8. What are 3 build life cycles in maven?
26 | 9. In Which tag we will mention output artifact type( like jar, war or any other)?
27 |
28 | Unix and Shell scripting
29 | ---------------------------------------------------------------------------------------------------------------------
30 | 10. In a file I have ip addresses , I want list unique ip addresses with number of times its present in file?
31 | ```
32 | grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}" logfile | sort | uniq -c | sort -nr
33 | ```
34 | 11. What is exit status in UNIX?
35 | 12. Lets say I have shell script name magic.sh when I execute. It gives “This is from magic.sh”, so now if I change file name to magic-test.sh I should get “This is from magic-test.sh” basically as name of file chages my output should also change?
36 | 13. What is shebang ? Why it is used?
37 |
38 |
39 | Jenkins
40 | --------------------------------------------------------------------------------------------------------
41 | 14. How to Downgrade plugins in Jenkins?
42 | 15. Have you worked on Jenkinsfile? Can we use different nodes for each stage?
43 | 16. Can you list few ways by which we can trigger our build in Jenkins? What is the difference between Build Periodically and Poll SCM?
44 |
45 | AWS
46 | -------------------------------------------------------------------------------------------------------------
47 | 17. What are roles and policies in AWS IAM?
48 | 18. Lets say I have 50 users , for all 50 users I need to provide same privileges how do it?
49 | 19. I want to give programmatic access means They can access AWS services via api’s But should not be access AWS web console
50 | 20. As AMI is region specific I want create Machine with AMI which there in other Region is that possible?
51 | 21. Why we need security groups? By default what is outbound rules?
52 | 22. What is VPC? Give a brief about VPC?
53 | 23. Have you worked on Load balancers? If Yes, tell which load balancers you have used?
54 | 24. Lets say I have created auto scaling rule when ever Load goes more than 60% create a new instance Currently I have 3 machines, 1st machine load is 62% , 2nd machine 30% and 3rd also 30%. Now will auto scale rule creates new machine ?
55 |
56 | Ansible
57 | -----------------------------------------------------------------------------------------------------------------------
58 | 25. What is the best method to make your ansible YAML files reusable?
59 | 26. What is ansible vault and ansible tower?
60 | 27. Lets say I have playbook need to be run with Root user how would you do this?
61 | 28. Difference between copy and fetch module?
62 |
63 | Docker
64 | ------------------------------------------------------------------------------------------------------------------------------
65 | 29. Lets say I have 1 GB file that has to be sent to docker daemon, as its 1GB it will take muchtime and network too. By which option while building dockerfile we can send the fileIn better manner?
66 | 30. What is the difference between ADD and COPY docker instructions in Dockerfile?
67 | 31. Command to remove to stopped and running Containers?
68 | 32. Inside the container I did many changes like Creating, modifying and deleting file but I Wanted to check which files has been changed And what action has been taken what is the Command we need to use ?
69 |
70 |
71 | Kubernetes
72 | --------------------------------------------------------------------------------------------------------------------------------------
73 | 33. List objects you know in kubernetes?Give a brief about each object?
74 | 34. Command to list pods and deployments
75 |
76 |
--------------------------------------------------------------------------------
/Devops_mock_interview_4.md:
--------------------------------------------------------------------------------
1 | GIT
2 | ---------------
3 | 1. What is git reset ? Types of reset ?
4 | 2. How to delete local branch and remote branch in git ?
5 | 3. Difference between git diff and git status ?
6 | 4. What are hooks in git?
7 |
8 | MAVEN
9 | --------
10 | 5. What are things you need to set, if you want download dependency from private repository ?
11 | 6. What are the issues you faced while working on maven projects?
12 | 7. Command to skip the test cases in maven
13 |
14 | JENKINS
15 | ----------
16 | 8. How to set Jenkins build to fail based specific word in console output ?
17 | 9. What are active and reactive parameters (Dynamic parameterization) in Jenkins ?
18 | 10. How to customize the build number display to something else in Jenkins job page?
19 | 11. What are multi branch pipeline?
20 | 12. What is shared library in Jenkins ?
21 |
22 |
23 | UNIX & SHELL SCRIPTING
24 | -----------
25 | 13. Command to find empty files in a given directory?
26 | 14. Commands you will use it for configuring ssh connectivity between 2 machines and what files will be present in .ssh folder?
27 | 15. How to schedule a shell script in unix machines?
28 | 16. Command to get load average ?
29 | 17. Need to identify ip addresses in log file and count of ip addresses in log file?
30 |
31 | ANSIBLE
32 | ------------
33 | 18. Why ansible ? What makes ansible powerful than other tools like chef and puppet?
34 | 19. 5 modules that you have worked on? Can we create custom module ?
35 | 20. What is dynamic inventory in ansible?
36 | 21. Lets say I have both Ubuntu and centos machines as nodes I want install application tree using same playbook, how would you approach this scenario?
37 | 22. How to handle prompts with ansible playbook?
38 |
39 | DOCKER
40 | ----------
41 | 23. What does ONBUILD instruction do in Dockerfile?
42 | 24. What is the use of .dockerignore file?
43 | 25. I have dockerfile that accepts arguments, if I supply value as “1” then it should use maven 2.x version for base image and if I supply “2” then it should take maven latest as base image
44 | 26. What are docker compose and docker swarm?
45 |
46 | KUBERNETES
47 | ---------
48 | 27. Components in kubernetes architecture?
49 | 28. What are stateful sets in kuberentes?
50 | 29. Command to find which container has failed in pod and command to get logs of container
51 | 30. Tools to maintain kubernetes log files
52 |
53 | AWS
54 | -----
55 | 31. Services used AWS and tasks performed in AWS
56 |
--------------------------------------------------------------------------------
/Devops_mock_interview_5.md:
--------------------------------------------------------------------------------
1 | Git
2 | ------
3 | 1. what is the importance .git directory?
4 | 2. what are the branches, diff between remote and local branches?
5 | 3. what Branching strategy that you are familier with?
6 | 4. What PR (Pull request) is? whats the importance of PR?
7 |
8 | Unix & Shell scripting
9 | -----------
10 | 5. what is command for checking the running process? how to get PID of process?
11 | 6. Command to get whether certain port is listing or not?
12 | 7. How to indentify the number of params that has been sent to shell script?
13 | 8. command to delete empty line in a file?
14 |
15 | Helm
16 | ---
17 | 9. what is the need for helm charts?
18 | 10. what version helm your using? what difference between helm 2 & helm3?
19 |
20 | Kubernetes
21 | -----
22 | 11. What is Pod?
23 | 12. Creation of cluster for k8s, can we have multi master and multi nodes cluster?
24 | 13. On what basis the pod will be deployed on a specific node?
25 | 14. Can we deploy pod on master node?
26 | 15. What are steps that you might take to make one node into maintance?
27 | 16. In the kubeadm setup the control plane components are created as pods, where the defination those pods will be defined?
28 |
29 | Docker
30 | -----
31 | 17. How to configure docker private registry?
32 | 18. Types of network in docker? if you dont specify network to deploy on which network the conatiner will be created?
33 | 19. Explain a sample dockerfile that you have used in your project?
34 | 20. Can we launch linux conatiners windows and viceversa?
35 |
36 | Maven
37 | ----
38 | 21. what is multi module project?
39 | 22. what is the importance of dependency managment?
40 | 23. what are the settings that you need to do for mvn deploy ( to push artifcats to repository )?
41 | 24. mvn version that you have used?
42 |
43 | Jenkin
44 | ---
45 | 25. what is the need of CICD tools?
46 | 26. What type of Jenkinsfile you have worked on?
47 | 27. In master slave setup if I want run job on specific node is is possible?
48 | 28. what is the importance of Jenkins secrets?
49 |
50 | Monitoring
51 | ----
52 | 29. If given a chance to setup monitoring solution for project what are tools that you use?
53 |
--------------------------------------------------------------------------------
/Devops_mock_interview_6.md:
--------------------------------------------------------------------------------
1 | General questions
2 | ---
3 | 1. What do you mean by continues integration, continues delivery and continues deployment
4 |
5 | Git
6 | ---
7 | 2. Which version of git you have used?
8 | 3. Difference between git merge and git rebase?
9 | 4. What is git squash?
10 | 5. Branching strategy used in your project?
11 | 6. Command to list all commits?
12 |
13 | Maven
14 | ---
15 | 7. Tell me 3 build lifecycle in maven? What does mvn site does?
16 | 8. Is there way by which we can set local repository as some other custom directory, other than .m2?
17 | 9. Settings that you make for mvn deploy?
18 | 10. What is the default value of packaging tag? What other values for other artifact types?
19 | 11. What are GAV's?
20 |
21 | Jenkins
22 | ---
23 | 12. What are types jobs you have worked on??
24 | 13. Can we have job for pr and once merge is done the source branch should be deleted?
25 | 14. How do you take Jenkins backup?
26 | 15. Can you tell me importance of post block??
27 |
28 | Docker
29 | ---
30 | 16. Why we need docker compose and docker swarm
31 | 17. What's the difference between docker volume and docker mounting
32 | 18. What is the importance of .dockerigonre file, can name docker file with any other name?
33 | 19. I need to delete all stopped containers and unused images command for that?
34 | 20. How do you monitor docker in production
35 | 21. Is it good to use docker compose in production
36 |
37 | Aws
38 | ---
39 | 22. Services that you have worked on?
40 | 23. Roles in IAM?
41 | 24. I have 3 tier application, configure it with private and public subnet?
42 | 25. How to replicate or create same machine with same configuration?
43 | 26. Explain auto scalling in aws?
44 |
45 | Kubernetes
46 | ---
47 | 27. Why pods are not scheduled on master
48 | 28. Why config maps are used
49 | 29. What is the default deployment strategy
50 | 30. Have you faced any issues while working k8s
51 | 31. What is service account, role, role binding and namespace
52 | 32. Why we need helm
53 |
54 | Scripting
55 | ----
56 | 33. You need to identify unused fields In values.yaml how would you approach this?
57 | 34. What is exit status?
58 | 35. Given machine, how will you identify which machine it is?
59 |
60 | Ansible
61 | ----
62 | 36. What is ansible galaxy
63 | 37. What are handlers and notify in ansible playbook
64 | 38. What are adhoc commands
65 |
--------------------------------------------------------------------------------
/Devops_mock_interview_7.md:
--------------------------------------------------------------------------------
1 | Git & Github
2 | ---
3 | 1. Branching strategy?
4 | 2. Need a script which identify inactive branches ( no commits since 2 months )?
5 | 3. How to set configs globally in git?
6 |
7 | Maven
8 | ---
9 | 1. what are the tags that you came across in pom.xml?
10 | 2. Explain maven life cycle?
11 | 3.
12 |
--------------------------------------------------------------------------------
/Devops_mock_interview_8.md:
--------------------------------------------------------------------------------
1 | Unix & Shell
2 | ---
3 | 1. Lets say you have a script that will take more than a day to execute, in this case how do you run that script. Also as user you might not able to keep machine in interactive mode for longer period.
4 | 3. is it possible to store a commands output, either success or failure to the same file?
5 | 4. what is debug mode in shell script?
6 | 5. set of commands executed at multiples places in shell script, want to standardize that is it possible something like to define function?
7 | 6. In shell script can we supply parameters to functions?
8 | 7. what is the use of shift command?
9 | 10. difference between break and exit 0 in shell script?
10 | 11. delete files which are older than 10 days?
11 | 12. delete empty files in a given directory?
12 |
13 |
14 |
15 | Monitoring
16 | -----
17 | 13. what is the importance of monitoring?
18 | 14. difference between metrics monitoring and log monitoring, give example for both type of monitoring?
19 | 15. how do we configure endpoint in promethus to scrape the data?
20 | 16. what is the use of node exporter and alert manager in prometheus?
21 | 17. Can we monitor jenkins using prometheus? Also can we send mailer when jenkins is down?
22 | 18. what are metric types that prometheus can accept?
23 |
24 | kubernetes
25 | ----
26 | 19. explain any 4 different types of pod statuses and also the reasons that why pod might go into that state?
27 | 20. what are operators and give one example where we can use operator?
28 | 21. what is the importance of kubeconfig file? Also lets say when you login to kuberenets by default it will pointed to default namespace, if i want list any objects which are other namespace need concate -n option for all the kubectl commands, is there a way we can set the namaspace to aviod -n option in all the commands?
29 | 22. given a object how do we find api version and kind with respect to cluster?
30 | 23. any work around to bring one pod out of rotation, when multiple replicas has been deployed?
31 |
32 | Jenkins
33 | ----
34 | 24. list of best practices to follow while writing Jenkins pipeline?
35 | 25. Is it possible to run each stage on different agaent?
36 | 26. Is it possible to change success or error message that we see in console ouput ?
37 | 27. Have list of command that has to executed in certain directory in the code, is it possible to do the same?
38 | 28. Can we have versioning on Jenkins freestyle job?
39 |
40 | Ansible
41 | ---
42 | 29. Is it possible to set fact using ansible playbook?
43 | 30. can we concate line to exsisting file in remote server, example exporting env variable in bashrc? ( also imporatnt when the playbook runs again if the value exsists then you should not insert)
44 | 31. Difference between copy and template module?
45 | 32. In one of the template file need to use remote machine ip, how do we read the machine ip value?
46 |
47 | Devops General Interview Questions
48 | ---
49 | - Daily activites of devops engineer
50 | - challenges that you have faced while working devops
51 | - what are the envirnments which are there in the organization
52 | - How the deployents move from one env to other env
53 |
--------------------------------------------------------------------------------
/Devops_mock_interview_8/shell_script/color.sh:
--------------------------------------------------------------------------------
1 | #! /bin/sh
2 | RED='\033[0;31m'
3 | GREEN='\033[0;32m'
4 | YELLOW='\033[0;33m'
5 | NC='\033[0m'
6 |
7 | if [ $# -eq 2 ]
8 | then
9 | sum=$(( $1 + $2 ))
10 | diff=`expr $1 - $2`
11 | echo "${GREEN}sum of $1 and $2 = $sum "
12 | echo "diff of $1 and $2 = $diff ${NC}"
13 | elif [ $# -lt 2 ]
14 | then
15 | echo "${RED}args are too less"
16 | echo "the script execution is not correct"
17 | echo "ex - sh test.sh number1 number2 ${NC}"
18 | elif [ $# -gt 2 ]
19 | then
20 | echo "${YELLOW} args are too many"
21 | echo "the script execution is not correct"
22 | echo "ex - sh test.sh number1 number2 ${NC}"
23 | fi
24 |
--------------------------------------------------------------------------------
/Devops_mock_interview_8/shell_script/color2.sh:
--------------------------------------------------------------------------------
1 | red=`tput setaf 1`
2 | green=`tput setaf 2`
3 | reset=`tput sgr0`
4 | echo "${red}red text ${green}green text${reset} no color"
5 |
--------------------------------------------------------------------------------
/Devops_mock_interview_8/shell_script/dependency_managment/README.md:
--------------------------------------------------------------------------------
1 | https://maven.apache.org/pom.html
2 |
--------------------------------------------------------------------------------
/Devops_mock_interview_8/shell_script/dependency_managment/addition/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:
62 |GroupId | 65 |ArtifactId | 66 |Version | 67 |Type | 68 |Licenses |
---|---|---|---|---|
javax.servlet | 71 |servlet-api | 72 |2.5 | 73 |jar | 74 |- |
org.apache.maven.plugins | 77 |maven-jdeprscan-plugin | 78 |3.0.0-alpha-1 | 79 |jar | 80 |Apache License, Version 2.0 |
org.apache.maven.surefire | 83 |surefire-junit4 | 84 |2.19.1 | 85 |jar | 86 |Apache License, Version 2.0 |
The following is a list of test dependencies for this project. These dependencies are only required to compile and run unit tests for the application:
90 |GroupId | 93 |ArtifactId | 94 |Version | 95 |Type | 96 |Licenses |
---|---|---|---|---|
junit | 99 |junit | 100 |3.8.1 | 101 |jar | 102 |Common Public License Version 1.0 |
The following is a list of transitive dependencies for this project. Transitive dependencies are the dependencies of the project dependencies.
106 |The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:
109 |GroupId | 112 |ArtifactId | 113 |Version | 114 |Classifier | 115 |Type | 116 |Licenses |
---|---|---|---|---|---|
org.apache.commons | 119 |commons-lang3 | 120 |3.5 | 121 |- | 122 |jar | 123 |Apache License, Version 2.0 |
org.apache.maven | 126 |maven-artifact | 127 |3.0 | 128 |- | 129 |jar | 130 |The Apache Software License, Version 2.0 |
org.apache.maven | 133 |maven-core | 134 |3.0 | 135 |- | 136 |jar | 137 |The Apache Software License, Version 2.0 |
org.apache.maven | 140 |maven-model | 141 |3.0 | 142 |- | 143 |jar | 144 |The Apache Software License, Version 2.0 |
org.apache.maven | 147 |maven-model-builder | 148 |3.0 | 149 |- | 150 |jar | 151 |The Apache Software License, Version 2.0 |
org.apache.maven | 154 |maven-plugin-api | 155 |3.0 | 156 |- | 157 |jar | 158 |The Apache Software License, Version 2.0 |
org.apache.maven | 161 |maven-repository-metadata | 162 |3.0 | 163 |- | 164 |jar | 165 |The Apache Software License, Version 2.0 |
org.apache.maven | 168 |maven-settings | 169 |3.0 | 170 |- | 171 |jar | 172 |The Apache Software License, Version 2.0 |
org.apache.maven | 175 |maven-settings-builder | 176 |3.0 | 177 |- | 178 |jar | 179 |The Apache Software License, Version 2.0 |
org.apache.maven.surefire | 182 |surefire-api | 183 |2.19.1 | 184 |- | 185 |jar | 186 |Apache License, Version 2.0 |
org.codehaus.plexus | 189 |plexus-classworlds | 190 |2.2.3 | 191 |- | 192 |jar | 193 |The Apache Software License, Version 2.0 |
org.codehaus.plexus | 196 |plexus-component-annotations | 197 |1.5.5 | 198 |- | 199 |jar | 200 |The Apache Software License, Version 2.0 |
org.codehaus.plexus | 203 |plexus-interpolation | 204 |1.14 | 205 |- | 206 |jar | 207 |The Apache Software License, Version 2.0 |
org.codehaus.plexus | 210 |plexus-utils | 211 |3.1.0 | 212 |- | 213 |jar | 214 |Apache License, Version 2.0 |
org.sonatype.aether | 217 |aether-api | 218 |1.7 | 219 |- | 220 |jar | 221 |The Apache Software License, Version 2.0 |
org.sonatype.aether | 224 |aether-impl | 225 |1.7 | 226 |- | 227 |jar | 228 |The Apache Software License, Version 2.0 |
org.sonatype.aether | 231 |aether-spi | 232 |1.7 | 233 |- | 234 |jar | 235 |The Apache Software License, Version 2.0 |
org.sonatype.aether | 238 |aether-util | 239 |1.7 | 240 |- | 241 |jar | 242 |The Apache Software License, Version 2.0 |
org.sonatype.plexus | 245 |plexus-cipher | 246 |1.4 | 247 |- | 248 |jar | 249 |Apache Public License 2.0 |
org.sonatype.plexus | 252 |plexus-sec-dispatcher | 253 |1.3 | 254 |- | 255 |jar | 256 |Apache Public License 2.0 |
org.sonatype.sisu | 259 |sisu-guice | 260 |2.1.7 | 261 |noaop | 262 |jar | 263 |The Apache Software License, Version 2.0 |
org.sonatype.sisu | 266 |sisu-inject-bean | 267 |1.4.2 | 268 |- | 269 |jar | 270 |The Apache Software License, Version 2.0 |
org.sonatype.sisu | 273 |sisu-inject-plexus | 274 |1.4.2 | 275 |- | 276 |jar | 277 |The Apache Software License, Version 2.0 |
The following is a list of runtime dependencies for this project. These dependencies are required to run the application:
281 |GroupId | 284 |ArtifactId | 285 |Version | 286 |Type | 287 |Licenses |
---|---|---|---|---|
org.apache.maven | 290 |maven-aether-provider | 291 |3.0 | 292 |jar | 293 |The Apache Software License, Version 2.0 |
Apache Public License 2.0: Plexus Cipher: encryption/decryption Component, Plexus Security Dispatcher Component
624 |Unknown: calculator_addition, servlet-api
625 |Apache License, Version 2.0: Apache Commons Lang, Apache Maven JDeprScan Plugin, Plexus Common Utilities, SureFire API, SureFire JUnit4 Runner
626 |Common Public License Version 1.0: JUnit
627 |The Apache Software License, Version 2.0: Aether :: API, Aether :: Implementation, Aether :: SPI, Aether :: Utilities, Maven Aether Provider, Maven Artifact, Maven Core, Maven Model, Maven Model Builder, Maven Plugin API, Maven Repository Metadata Model, Maven Settings, Maven Settings Builder, Plexus :: Component Annotations, Plexus Classworlds, Plexus Interpolation API, Sisu - Guice, Sisu - Inject (JSR330 bean support), Sisu - Inject (Plexus bean support)
Filename | 633 |Size | 634 |Entries | 635 |Classes | 636 |Packages | 637 |Java Version | 638 |Debug Information |
---|---|---|---|---|---|---|
servlet-api-2.5.jar | 641 |105.1 kB | 642 |68 | 643 |42 | 644 |2 | 645 |1.5 | 646 |Yes |
junit-3.8.1.jar | 649 |121.1 kB | 650 |119 | 651 |100 | 652 |6 | 653 |1.1 | 654 |Yes |
commons-lang3-3.5.jar | 657 |479.9 kB | 658 |284 | 659 |260 | 660 |12 | 661 |1.6 | 662 |Yes |
maven-aether-provider-3.0.jar | 665 |51.2 kB | 666 |38 | 667 |21 | 668 |1 | 669 |1.5 | 670 |Yes |
maven-artifact-3.0.jar | 673 |51.9 kB | 674 |57 | 675 |32 | 676 |11 | 677 |1.5 | 678 |Yes |
maven-core-3.0.jar | 681 |527 kB | 682 |406 | 683 |332 | 684 |39 | 685 |1.5 | 686 |Yes |
maven-model-3.0.jar | 689 |164.7 kB | 690 |67 | 691 |50 | 692 |3 | 693 |1.5 | 694 |Yes |
maven-model-builder-3.0.jar | 697 |148 kB | 698 |142 | 699 |109 | 700 |16 | 701 |1.5 | 702 |Yes |
maven-plugin-api-3.0.jar | 705 |48.9 kB | 706 |46 | 707 |25 | 708 |6 | 709 |1.5 | 710 |Yes |
maven-repository-metadata-3.0.jar | 713 |30.1 kB | 714 |25 | 715 |7 | 716 |2 | 717 |1.5 | 718 |Yes |
maven-settings-3.0.jar | 721 |46.7 kB | 722 |33 | 723 |17 | 724 |2 | 725 |1.5 | 726 |Yes |
maven-settings-builder-3.0.jar | 729 |37.8 kB | 730 |49 | 731 |28 | 732 |5 | 733 |1.5 | 734 |Yes |
maven-jdeprscan-plugin-3.0.0-alpha-1.jar | 737 |30 kB | 738 |25 | 739 |7 | 740 |2 | 741 |1.7 | 742 |Yes |
surefire-api-2.19.1.jar | 745 |196.1 kB | 746 |162 | 747 |116 | 748 |14 | 749 |1.5 | 750 |Yes |
surefire-junit4-2.19.1.jar | 753 |75.4 kB | 754 |74 | 755 |23 | 756 |5 | 757 |1.5 | 758 |Yes |
plexus-classworlds-2.2.3.jar | 761 |46.1 kB | 762 |51 | 763 |36 | 764 |5 | 765 |1.4 | 766 |Yes |
plexus-component-annotations-1.5.5.jar | 769 |4.2 kB | 770 |15 | 771 |3 | 772 |1 | 773 |1.5 | 774 |No |
plexus-interpolation-1.14.jar | 777 |61.1 kB | 778 |60 | 779 |44 | 780 |6 | 781 |1.4 | 782 |Yes |
plexus-utils-3.1.0.jar | 785 |261.6 kB | 786 |129 | 787 |104 | 788 |9 | 789 |1.6 | 790 |Yes |
aether-api-1.7.jar | 793 |74.2 kB | 794 |102 | 795 |82 | 796 |11 | 797 |1.5 | 798 |Yes |
aether-impl-1.7.jar | 801 |106.3 kB | 802 |72 | 803 |58 | 804 |2 | 805 |1.5 | 806 |Yes |
aether-spi-1.7.jar | 809 |13.5 kB | 810 |31 | 811 |16 | 812 |4 | 813 |1.5 | 814 |Yes |
aether-util-1.7.jar | 817 |107.9 kB | 818 |101 | 819 |78 | 820 |13 | 821 |1.5 | 822 |Yes |
plexus-cipher-1.4.jar | 825 |13.5 kB | 826 |20 | 827 |6 | 828 |1 | 829 |1.4 | 830 |Yes |
plexus-sec-dispatcher-1.3.jar | 833 |28.6 kB | 834 |31 | 835 |13 | 836 |3 | 837 |1.4 | 838 |Yes |
sisu-guice-2.1.7-noaop.jar | 841 |471.7 kB | 842 |416 | 843 |402 | 844 |8 | 845 |1.5 | 846 |Yes |
sisu-inject-bean-1.4.2.jar | 849 |153 kB | 850 |165 | 851 |138 | 852 |13 | 853 |1.5 | 854 |Yes |
sisu-inject-plexus-1.4.2.jar | 857 |201.7 kB | 858 |199 | 859 |156 | 860 |26 | 861 |1.5 | 862 |Yes |
Total | 865 |Size | 866 |Entries | 867 |Classes | 868 |Packages | 869 |Java Version | 870 |Debug Information |
28 | 873 |3.7 MB | 874 |2987 | 875 |2305 | 876 |228 | 877 |1.7 | 878 |27 |
compile: 26 | 881 |compile: 3.5 MB | 882 |compile: 2830 | 883 |compile: 2184 | 884 |compile: 221 | 885 |- | 886 |compile: 25 |
test: 1 | 889 |test: 121.1 kB | 890 |test: 119 | 891 |test: 100 | 892 |test: 6 | 893 |- | 894 |test: 1 |
runtime: 1 | 897 |runtime: 51.2 kB | 898 |runtime: 38 | 899 |runtime: 21 | 900 |runtime: 1 | 901 |- | 902 |runtime: 1 |
<dependency> 62 | <groupId>calculator</groupId> 63 | <artifactId>addition</artifactId> 64 | <version>1.0</version> 65 | </dependency>
<dependency org="calculator" name="addition" rev="1.0"> 74 | <artifact name="addition" type="jar" /> 75 | </dependency>
GroupId | 61 |ArtifactId | 62 |Version |
---|---|---|
org.apache.maven.plugins | 65 |maven-antrun-plugin | 66 |1.7 |
org.apache.maven.plugins | 69 |maven-assembly-plugin | 70 |2.4.1 |
org.apache.maven.plugins | 73 |maven-dependency-plugin | 74 |2.8 |
org.apache.maven.plugins | 77 |maven-release-plugin | 78 |2.3.2 |
GroupId | 61 |ArtifactId | 62 |Version |
---|---|---|
org.apache.maven.plugins | 65 |maven-clean-plugin | 66 |2.5 |
org.apache.maven.plugins | 69 |maven-compiler-plugin | 70 |3.2 |
org.apache.maven.plugins | 73 |maven-deploy-plugin | 74 |2.7 |
org.apache.maven.plugins | 77 |maven-install-plugin | 78 |2.5.2 |
org.apache.maven.plugins | 81 |maven-jar-plugin | 82 |2.4 |
org.apache.maven.plugins | 85 |maven-project-info-reports-plugin | 86 |3.0.0 |
org.apache.maven.plugins | 89 |maven-resources-plugin | 90 |2.6 |
org.apache.maven.plugins | 93 |maven-site-plugin | 94 |3.7.1 |
org.apache.maven.plugins | 97 |maven-surefire-plugin | 98 |2.17 |
org.codehaus.mojo | 101 |tidy-maven-plugin | 102 |1.1.0 |
GroupId | 108 |ArtifactId | 109 |Version |
---|---|---|
org.apache.maven.plugins | 112 |maven-project-info-reports-plugin | 113 |3.0.0 |
This document provides an overview of the various documents and links that are part of this project's general information. All of this content is automatically generated by Maven on behalf of the project.
59 |Document | 64 |Description |
---|---|
Dependencies | 67 |This document lists the project's dependencies and provides information on each dependency. |
Dependency Information | 70 |This document describes how to to include this project as a dependency using various dependency management tools. |
About | 73 |There is currently no description associated with this project. |
Plugin Management | 76 |This document lists the plugins that are defined through pluginManagement. |
Plugins | 79 |This document lists the build plugins and the report plugins used by this project. |
Summary | 82 |This document lists other related information of this project |