EX280 Demo
EX280 Demo
EX280 Exam
Red Hat Certified OpenShift
https://validquestions.com/exam/ex280-questions/
Questions & Answers PDF Page 2
Question: 1
You are tasked with deploying a highly available application in OpenShift. Create a Deployment using
YAML to deploy the nginx container with three replicas, ensuring that it runs successfully. Verify that the
Deployment is active, all replicas are running, and the application can serve requests properly. Provide a
complete walkthrough of the process, including necessary commands to check deployment status.
Solution:
1. Create a Deployment YAML file named nginx-deployment.yaml with the following content:
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:latest
ports:
- containerPort: 80
www.validquestions.com
Questions & Answers PDF Page 3
5. Use the NodePort and cluster IP to confirm that the application is serving requests.
Explanation:
Deployments provide a scalable and declarative way to manage applications. YAML manifests ensure
the configuration is consistent, while NodePort services expose the application for testing. Verifying
replicas ensures that the application is running as expected and resilient.
Question: 2
Your team requires an application to load specific configuration data dynamically during runtime. Create
a ConfigMap to hold key-value pairs for application settings, and update an existing Deployment to use
this ConfigMap. Provide a complete YAML definition for both the ConfigMap and the updated
Deployment, and demonstrate how to validate that the configuration is applied correctly.
Solution:
apiVersion: v1
kind: ConfigMap
metadata:
name: app-config
data:
APP_ENV: production
APP_DEBUG: "false"
apiVersion: apps/v1
kind: Deployment
metadata:
name: app-deployment
spec:
replicas: 1
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
www.validquestions.com
Questions & Answers PDF Page 4
spec:
containers:
- name: app-container
image: nginx:latest
env:
- name: APP_ENV
valueFrom:
configMapKeyRef:
name: app-config
key: APP_ENV
- name: APP_DEBUG
valueFrom:
configMapKeyRef:
name: app-config
key: APP_DEBUG
Explanation:
ConfigMaps decouple configuration data from the application code, enabling environment-specific
settings without altering the deployment logic. Using environment variables from ConfigMaps ensures
flexibility and reduces maintenance complexity.
Question: 3
Perform a rolling update of an application to upgrade the nginx image from 1.19 to 1.21. Ensure zero
downtime during the update and verify that all replicas are running the new version.
Solution:
www.validquestions.com
Questions & Answers PDF Page 5
Explanation:
Rolling updates replace pods incrementally, ensuring that applications remain available during the
update process. Monitoring confirms the successful rollout.
Question: 4
Deploy an application across multiple namespaces using a common Deployment YAML file. Include
steps to create the namespaces, apply the deployment, and verify that the pods are running in each
namespace.
Solution:
1. Create namespaces:
apiVersion: apps/v1
kind: Deployment
metadata:
name: multi-namespace-app
spec:
replicas: 2
selector:
matchLabels:
app: sample-app
template:
metadata:
labels:
app: sample-app
spec:
containers:
- name: app-container
image: nginx:latest
www.validquestions.com
Questions & Answers PDF Page 6
Explanation:
Deploying across namespaces ensures workload isolation while reusing common configurations.
Verification confirms that resources are created and operational.
Question: 5
Configure an Ingress resource to expose an application using a custom domain name. Include steps to
create the Ingress YAML and validate that the domain resolves to the application.
Solution:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: app-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- host: custom-domain.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: app-service
port:
number: 80
4. Verify accessibility:
curl http://custom-domain.example.com
Explanation:
www.validquestions.com
Questions & Answers PDF Page 7
Ingress provides an HTTP(S) layer to expose services using custom domains, offering centralized traffic
management.
Question: 6
Configure a StatefulSet to deploy a MySQL database with persistent storage. Include steps to define the
StatefulSet, create a PersistentVolume (PV) and PersistentVolumeClaim (PVC), and verify the database
is running correctly.
Solution:
apiVersion: v1
kind: PersistentVolume
metadata:
name: mysql-pv
spec:
capacity:
storage: 5Gi
accessModes:
- ReadWriteOnce
hostPath:
path: /data/mysql
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mysql-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: mysql
spec:
serviceName: "mysql"
replicas: 1
www.validquestions.com
Questions & Answers PDF Page 8
selector:
matchLabels:
app: mysql
template:
metadata:
labels:
app: mysql
spec:
containers:
- name: mysql
image: mysql:5.7
ports:
- containerPort: 3306
env:
- name: MYSQL_ROOT_PASSWORD
value: rootpassword
volumeMounts:
- name: mysql-data
mountPath: /var/lib/mysql
volumeClaimTemplates:
- metadata:
name: mysql-data
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 5Gi
Explanation:
StatefulSets ensure stable identities for applications requiring persistent data, like databases. Coupling
them with PVs and PVCs ensures data persistence across restarts.
Question: 7
Diagnose and fix an issue where a Deployment fails due to exceeding the configured ResourceQuota.
www.validquestions.com
Questions & Answers PDF Page 9
Solution:
resources:
requests:
cpu: "100m"
memory: "128Mi"
Explanation:
ResourceQuotas ensure fair resource distribution. Adjusting Deployment configurations avoids conflicts
and ensures compliance.
Question: 8
Set up and validate OpenShift pod affinity to ensure that pods are scheduled on the same node.
Solution:
affinity:
podAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- my-app
topologyKey: "kubernetes.io/hostname"
www.validquestions.com
Questions & Answers PDF Page 10
Explanation:
Pod affinity ensures co-location of related workloads, optimizing resource usage and inter-pod
communication.
Question: 9
Solution:
Explanation:
Horizontal scaling adds replicas, ensuring applications handle increased traffic effectively.
Question: 10
Update an existing Deployment to add a readiness probe. Validate that the readiness probe works
correctly.
Solution:
readinessProbe:
httpGet:
path: /
port: 80
initialDelaySeconds: 5
periodSeconds: 10
www.validquestions.com
Questions & Answers PDF Page 11
Explanation:
Readiness probes ensure that only fully initialized and functional pods receive traffic, improving
application reliability.
www.validquestions.com
Thank You for trying EX280 PDF Demo
https://validquestions.com/exam/ex280-questions/
[Limited Time Offer] Use Coupon " SAVE20 " for extra 20%
discount the purchase of PDF file. Test your
EX280 preparation with actual exam questions
www.validquestions.com