0% found this document useful (0 votes)
18 views6 pages

Devops Interview

The document provides detailed answers to various technical questions related to Docker, Kubernetes, CI/CD, and microservices architecture. It covers topics such as Dockerfile instructions, environment setup, application deployment, and monitoring tools. Additionally, it discusses the use of programming languages, frameworks, and database types in a cloud-based infrastructure context.

Uploaded by

poojanandish1993
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views6 pages

Devops Interview

The document provides detailed answers to various technical questions related to Docker, Kubernetes, CI/CD, and microservices architecture. It covers topics such as Dockerfile instructions, environment setup, application deployment, and monitoring tools. Additionally, it discusses the use of programming languages, frameworks, and database types in a cloud-based infrastructure context.

Uploaded by

poojanandish1993
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Here’s a detailed response to your list of questions:

1) What is a Dockerfile?
 A Dockerfile is a script containing a series of instructions used to
automate the process of building a Docker image. It includes
commands like FROM, COPY, RUN, CMD, EXPOSE, etc., which define how the
Docker image will be built, including the environment setup,
dependencies, and application code.

2) Give a brief on the environment which you are working


in?
 My work environment typically involves cloud-based infrastructure (like
AWS, Azure, or GCP), containerization (using Docker), orchestration
(using Kubernetes or EKS), CI/CD pipelines (using Jenkins, GitLab CI, or
GitHub Actions), Infrastructure as Code (using Terraform or
CloudFormation), and monitoring tools (Prometheus, Grafana, ELK
stack). It’s a microservices architecture, with a focus on scalability,
high availability, and security.

3) Explain the architecture which you are using in the


environment.
 The architecture usually follows a Microservices pattern, with
services deployed on Kubernetes (EKS) clusters. Each service is
containerized using Docker and managed using Helm for Kubernetes
deployments. The services are behind Application Load Balancers
(ALBs) and communicate with AWS RDS for database management.
CloudWatch is used for monitoring and logging. We also use CI/CD
pipelines for automated deployments and Terraform for
infrastructure management.

4) What is the full form of JAR and WAR?


 JAR: Java Archive. A package file format for storing multiple Java class
files and associated metadata (often used for libraries).

 WAR: Web Application Archive. A package file format used for web
applications, which includes servlets, JSPs, HTML files, etc.

5) Which language do you use in your current company?


 Common languages I work with are Java, Python, JavaScript (for
front-end development with Angular), and Go (for microservices and
infrastructure automation).
6) Write a sample Dockerfile and explain the things you
will copy and the command you enter in CMD.
DockerfileCopyEdit# Use the official Java base image
FROM openjdk:11-jre-slim

# Set the working directory


WORKDIR /app

# Copy the application JAR file into the container


COPY target/myapp.jar /app/myapp.jar

# Expose port (not mandatory, but useful for documentation)


EXPOSE 8080

# Define the command to run the application


CMD ["java", "-jar", "myapp.jar"]

 FROM: Specifies the base image (OpenJDK 11).

 WORKDIR: Sets the working directory inside the container.

 COPY: Copies the built JAR file into the container.

 EXPOSE: Specifies the port the container will listen on (for


documentation).

 CMD: Specifies the command to run when the container starts (in this
case, running the JAR file).

7) What will EXPOSE do in the Dockerfile?


 EXPOSE is used to document the port on which the container listens at
runtime. It doesn’t actually bind the port or open it; it’s just for
communication between containers or for documentation purposes.

8) Difference between mvn install and mvn deploy?


 mvn install: Builds the application and installs the artifact (like JAR,
WAR) into your local Maven repository.

 mvn deploy: Does everything install does but additionally uploads the
artifact to a remote Maven repository (e.g., Nexus, Artifactory).
9) If your project is Java-based, do you use Angular or
Spring Boot?
 Spring Boot is commonly used for building Java-based back-end
services in microservices architectures, while Angular (or React, Vue)
would be used for front-end development.

10) What are the frameworks you use for frontend and
backend in your application?
 Frontend: Angular, React, or Vue.js.

 Backend: Spring Boot, Express.js, or Django.

11) How do you build an image from a Dockerfile?


 Use the following command to build a Docker image from a Dockerfile:

bashCopyEditdocker build -t myimage .

 -t myimage: Assigns a name to the image.

 .: Specifies the context (current directory).

12) If your source port inside the WAR is pointing to 8080


but in the YAML file, it’s pointing to 8090, and the pod
deployment fails, how would you troubleshoot?
 Check if there’s a port mismatch between the WAR file (application
port) and the Kubernetes deployment YAML file.

 Inspect logs using kubectl logs <pod_name>.

 Use kubectl describe pod <pod_name> to check events and error


messages.

13) When you deploy the pod, what all will be recorded in
the pod logs?
 Application logs (from stdout and stderr).

 Kubernetes-related logs like container start/stop events, health check


status, and resource usage.

14) When we deploy the pod, what components are


present in the kubectl describe pod output?
 The output includes:

o Pod Name, Namespace, Node.

o Containers (container name, image, status, ports).


o Events (for example, pull, start, or failed).

o Conditions (like PodScheduled, Ready, etc.).

15) Types of errors the pod might fail with?


 Image Pull Error: Unable to pull the container image.

 CrashLoopBackOff: The container keeps crashing.

 ImageNotFound: Container image doesn’t exist.

 Port Conflict: Incorrect port binding in the deployment YAML file.

16) Types of services in Kubernetes?


 ClusterIP: Default, exposes the service within the cluster.

 NodePort: Exposes the service on a static port on each node.

 LoadBalancer: Exposes the service externally via a cloud load


balancer.

 ExternalName: Maps the service to an external DNS name.

17) Explain the ingress route YAML file and how to add a
path.
yamlCopyEditapiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: my-ingress
spec:
rules:
- host: myapp.example.com
http:
paths:
- path: /api
pathType: Prefix
backend:
service:
name: my-api-service
port:
number: 8080

 This YAML defines an ingress rule where HTTP requests to


myapp.example.com/api are routed to my-api-service on port 8080.
18) Explain the architecture diagram on how your present
company functions and how many microservices you use?
 The company uses a microservices architecture. Each service is
containerized using Docker and orchestrated with Kubernetes
(EKS). Services communicate via REST or gRPC. We use API Gateway
(like Kong or AWS API Gateway) to route traffic. For HA, we have
services replicated in multiple availability zones and managed using
Helm.

19) What type of databases do you use in your


environment?
 Relational Databases: AWS RDS (PostgreSQL, MySQL).

 NoSQL Databases: DynamoDB, MongoDB.

 Caching: Redis.

20) EKS Cluster with 2 nodes, 10 max nodes, and


deploying 5 pods—How are nodes created?
 Kubernetes Scheduler communicates with the control plane to
assess resource requirements.

 Cluster Autoscaler detects the need for additional nodes and triggers
node creation in AWS via Auto Scaling Groups.

21) Monitoring tools in your environment:


 Prometheus & Grafana: For monitoring and visualization.

 CloudWatch: For AWS resource monitoring.

 ELK Stack: For logging and log analysis.


 Datadog: For observability and performance monitoring.

22) How do you mention ports for a particular POD in the


YAML file?
yamlCopyEditspec:
containers:
- name: my-container
image: my-image
ports:
- containerPort: 8080

 The containerPort is where the application inside the container will


listen for requests.
23) Recent work using Terraform?
 I’ve worked on infrastructure provisioning (VPC, EC2, RDS), EKS
cluster setup, IAM roles and policies, and CI/CD pipeline
configurations.

24) How will you handle CI/CD in your environment?


 We use Jenkins for CI/CD, integrating with GitHub or GitLab. Jenkins
pipelines automate the build, test, and deployment processes to EKS
and AWS infrastructure, ensuring fast and reliable application delivery.

Let me know if you need more details on any of the answers!

You might also like