Jenkins or CI CD interview questions.
- In order to achieve the cicd process, we use Jenkins as an orchestrator and various tools like Maven, Sonar, Appscan, Argo CD, and Kubernetes.
- Argo CD automatically deploys new versions of the application using Helm.
- Jenkins can be notified of code changes on GitHub using web hooks.
- Use GitHub webhooks for efficient Jenkins execution and backup Jenkins using rsync or external database backups
- Handling secrets in Jenkins is crucial for security.
- Jenkins is a popular tool for CI/CD
- Using Jenkins with Docker agents for multi-language applications
- Configuring Jenkins with auto scaling groups for automatically scaling EC2 instances
- Using CLI to install plugins in Jenkins
- Jenkins jnlp is used to remotely launch and manage agents
Today's topic is about Jenkins or CI CD interview questions.
- The answers differ from tool to tool, but some are common.
- Focus on one thing and answer questions based on that.
- Many people use Jenkins, so let's take it into consideration.
- The interview questions are scenario-based.
In order to achieve the CI/CD process, we use Jenkins as an orchestrator and various tools like Maven, Sonar, Appscan, Argo CD, and Kubernetes.
- Jenkins is used to pull code from the source code repository and initiate the pipeline.
- Maven is used to build the application.
- Code quality and security testing are performed using tools like Sonar and Appscan.
- Argo CD is used to promote the application to the Dev environment.
- Kubernetes is the platform used in the Dev environment.
- Argo CD continuously monitors the git repository for changes.
Argo CD automatically deploys new versions of the application using Helm.
- The Jenkins pipeline example demonstrates the step-by-step approach.
- The build process includes checking out the code, building a Docker image, and pushing artifacts to GitHub.
- The application is deployed to a Kubernetes cluster using a shell script.
- Argo CD continuously monitors the GitHub repository and updates the deployment manifest with new tags.
- Different deployment strategies can be used based on the organization's needs.
Jenkins can be notified of code changes on GitHub using web hooks.
- Build triggers and policium are alternatives, but web hooks are better.
- Build triggers and policium require periodic checks, which is costly and can cause delays.
- Web hooks send a JSON payload to Jenkins whenever a code change is made on GitHub.
- The JSON payload contains information about the code committer, pull request, assignee, etc.
- Web hooks need to be configured in the GitHub settings section.
Use GitHub webhooks for efficient Jenkins execution and backup Jenkins using rsync or external database backups
- Configure GitHub Jenkins webhooks to execute Jenkins pipeline using the API and payload
- Backup Jenkins by taking the backup of the .Jenkins folder using rsync
- Backup external databases used to store Jenkins information
Handling secrets in Jenkins is crucial for security.
- Jenkins provides multiple options for handling secrets.
- It is recommended to use security tools like Hashicorp Vault.
- Integrating Jenkins with Hashicorp Vault allows secure storage and usage of sensitive information.
- Knowing the latest version of Jenkins is important in interviews.
Jenkins is a popular tool for CI/CD
- Stay updated with the latest versions and plugins of Jenkins
- Shared modules allow code reuse across teams in an organization
- Jenkins can be used to build applications with multiple programming languages and agents in different stages
Using Jenkins with Docker agents for multi-language applications
- Jenkins can efficiently handle multi-language applications by using Docker agents in different stages of the pipeline.
- This approach saves computer resources and eliminates the need to configure anything on worker nodes.
- Auto scaling groups in Jenkins are used when Docker agents cannot be utilized, such as for organizations with large applications.
- During peak usage periods, additional worker nodes can be added to handle the extra load.
Configuring Jenkins with auto scaling groups for automatically scaling EC2 instances
- Explaining the concept and advantages of auto scaling
- Steps to create auto scaling groups in Jenkins
- Adding a new worker node in Jenkins
- Installing plugins in Jenkins
Using CLI to install plugins in Jenkins
- You can use the Jenkins CLI to install plugins in Jenkins
- This is useful when you don't have UI access or need to install multiple plugins
- You can write a shell script and use a Java command to install the plugin
- Make sure the plugin is available in the plugin section of Jenkins or upload it manually
Jenkins jnlp is used to remotely launch and manage agents
- Agents connect to Jenkins master and receive build tasks
- Prepare a list of common Jenkins plugins for interviews