BASE
EXAM DUMPS
REDHAT
EX280
28% OFF Automatically For You
Red Hat Certified OpenShift Administrator exam
,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.
Answer:
See the Solution below.
Solution:
2. Create a Deployment YAML file named nginx-deployment.yaml with the following
content:
apiVersion: apps/v1
kind: Deployment
ng
metadata:
ni
ar
name: nginx-deployment
Le
r
labels:
fo
s
app: nginx
al
eri
spec:
at
M
replicas: 3 si
ve
selector:
en
matchLabels:
eh
pr
app: nginx
om
template:
-C
)
metadata:
02
8.
labels:
(V
ps
app: nginx
um
spec:
D
m
containers:
xa
E
- name: nginx image: nginx:latest ports:
0
28
- containerPort: 80
X
E
at
H
3. Deploy the file using the command: kubectl apply -f nginx-deployment.yaml
ed
R
4. Check the status of the deployment: kubectl get deployments
kubectl get pods
5. Test the application by exposing the Deployment:
kubectl expose deployment nginx-deployment --type=NodePort --port=80 kubectl get
svc
6. 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.
7.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.
Answer:
See the Solution below.
Solution:
ng
ni
ar
8. Create a ConfigMap YAML file named app-config.yaml:
Le
r
apiVersion: v1
fo
s
kind: ConfigMap
al
eri
metadata:
at
M
name: app-config si
ve
data:
en
APP_ENV: production
eh
pr
APP_DEBUG: "false"
om
-C
)
9. Apply the ConfigMap using: kubectl apply -f app-config.yaml
02
8.
(V
ps
10. Update the Deployment YAML to reference the ConfigMap:
um
apiVersion: apps/v1
D
m
kind: Deployment
xa
E
metadata:
0
28
name: app-deployment
X
E
spec:
at
H
replicas: 1
ed
R
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
spec:
containers:
- name: app-container image: nginx:latest env:
- name: APP_ENV valueFrom: