Ready to Pass Your Certification Test

Ready to guarantee a pass on the certification that will elevate your career? Visit this page to explore our catalog and get the questions and answers you need to ace the test.

Exam contains 260 questions

Page 15 of 44
Question 85 🔥

Configure a DeploymentConfig to use resource quotas for image builds and validate enforcement. ee the Solution below. Solution: 1. Create a ResourceQuota: apiVersion: v1 kind: ResourceQuota metadata: name: build -quota spec: hard: requests.cpu: "2" requests.memory: "2Gi" 2. Apply the ResourceQuota to the namespace: oc apply -f resourcequota.yaml 3. Create a BuildConfig that exceeds the quota: oc create buildconfig app -build --image -stream=my -app-image 4. Validate enforcement: oc describe quota build -quota Explanation: Resource quotas ensure that build resources are allocated fairly and prevent a single process from consuming excessive resources. Set up a DeploymentConfig to include a liveness probe and validate that failed containers are restarted automatically. ee the Solution below. Solution: 1. Add a liveness probe to the DeploymentConfig: spec: containers: - name: app -container

Question 86 🔥

livenessProbe: httpGet: path: / port: 80 initialDelaySeconds: 5 periodSeconds: 10 2. Apply the DeploymentConfig: oc apply -f deploymentconfig.yaml 3. Simulate a failure and validate the pod restart: oc exec <pod -name> -- mv /usr/share/nginx/html/index.html /tmp/ oc get pods Explanation: Liveness probes ensure failed containers are restarted, maintaining application availability and reliability. Use an ImageStream to switch traffic between two application versions using traffic splitting. Validate the behavior. ee the Solution below. Solution: 1. Deploy two versions of the application (v1 and v2) using ImageStreams: oc apply -f app -v1.yaml oc apply -f app -v2.yaml 2. Use a Route to split traffic: spec: to: kind: Service name: app -v1 alternateBackends: - kind: Service name: app-v2 weight: 50 3. Validate traffic distribution: curl http://<app -url>

Question 87 🔥

Following official documentation ensures that cluster upgrades adhere to recommended practices, minimizing risks and maintaining system stability. 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. ee the Solution below. Solution: 1. Create namespaces: kubectl create namespace ns1 kubectl create namespace ns2 2. Create a Deployment YAML file app-deployment.yaml: 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 3. Apply the deployment in each namespace: kubectl apply -f app-deployment.yaml -n ns1 kubectl apply -f app -deployment.yaml -n ns2 4. Verify the pods: kubectl get pods -n ns1 kubectl get pods -n ns2

Question 88 🔥

Explanation: Traffic splitting with ImageStreams and Routes allows controlled transitions between application versions, enabling safe upgrades. Simulate a failed build due to insufficient resources and resolve it by updating the ResourceQuota. ee the Solution below. Solution: 1. Trigger a build that exceeds the current ResourceQuota: oc start -build app -build 2. Validate the failure: oc get builds 3. Update the ResourceQuota: spec: hard: requests.cpu: "4" requests.memory: "4Gi" oc apply -f resourcequota.yaml 4. Retry the build: oc start -build app -build Explanation: Updating ResourceQuotas ensures that sufficient resources are allocated for builds, enabling successful completion. Create a DeploymentConfig that integrates with a ConfigMap and updates the deployment dynamically when the ConfigMap changes. Validate the update behavior. ee the Solution below. Solution:

Question 89 🔥

1. Create a ConfigMap: oc create configmap app -config --from-literal=APP_ENV=production 2. Update the DeploymentConfig to use the ConfigMap: envFrom: - configMapRef: name: app-config 3. Change the ConfigMap and validate: oc create configmap app-config --from-literal=APP_ENV=staging -o yaml --dry-run=client | oc apply -f - oc get pods Explanation: Dynamic integration between ConfigMaps and DeploymentConfigs allows seamless configuration changes without restarting pods. Configure the HTPasswd identity provider for user authentication in OpenShift. Validate by creating a user and logging in. ee the Solution below. Solution: 1. Create an HTPasswd file and add a user: htpasswd -c /etc/origin/htpasswd admin 2. Configure the HTPasswd identity provider in the cluster: apiVersion: config.openshift.io/v1 kind: OAuth metadata: name: cluster spec: identityProviders: - name: htpasswd -provider mappingMethod: claim type: HTPasswd htpasswd: fileData: name: htpasswd -secret

Question 90 🔥

Solution: 1. Create a Headless Service YAML file: apiVersion: v1 kind: Service metadata: name: headless -service spec: clusterIP: None selector: app: my-stateful -app ports: - protocol: TCP port: 80 2. Apply the Service and verify DNS resolution: kubectl apply -f headless -service.yaml kubectl exec <pod -name> -- nslookup headless -service Explanation: Headless Services provide direct access to individual pod IPs, which is essential for StatefulSet workloads. Deploy an application using a Kubernetes CronJob that runs every 5 minutes. Validate its execution. ee the Solution below. Solution: 1. Create a CronJob YAML file cronjob.yaml: apiVersion: batch/v1 kind: CronJob metadata: name: my-cronjob spec: schedule: "*/5 * * * *" jobTemplate: spec: template: spec: containers: - name: my -container

Lorem ipsum dolor sit amet consectetur. Eget sed turpis aenean sit aenean. Integer at nam ullamcorper a.

© 2024 Exam Prepare, Inc. All Rights Reserved.
EX280 questions • Exam prepare