ExamGecko
Question list
Search
Search

List of questions

Search

Question 26 - CKA discussion

Report
Export

Create a nginx pod with label env=test in engineering namespace

A.
See the solution below.
Answers
A.
See the solution below.
Suggested answer: A

Explanation:

kubectl run nginx --image=nginx --restart=Never --labels=env=test --namespace=engineering --dryrun

-o yaml > nginx-pod.yaml

kubectl run nginx --image=nginx --restart=Never --labels=env=test --namespace=engineering --dryrun

-o yaml | kubectl create -n engineering -f –

YAML File:

apiVersion: v1

kind: Pod

metadata:

name: nginx

namespace: engineering

labels:

env: test

spec:

containers:

- name: nginx

image: nginx

imagePullPolicy: IfNotPresent

restartPolicy: Never

kubectl create -f nginx-pod.yaml

asked 18/09/2024
Benito Gonzalez
36 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first