[2] Pod 생성하기

❓Pod 생성하기

실습

# 클러스터 변경
[user@console ~]$ kubectl config use-context k8s

# namespace 생성
[user@console ~]$ kubectl create namespace ecommerce

# 생성된 namespace 확인
[user@console ~]$ kubectl get namespaces

# pod 생성
# 엔터를 누르기 전에 --dry-run=client 옵션으로 해당 명령어가 문제없는 명령어인지 확인
[user@console ~]$ kubectl run eshop-main --image=nginx:1.17 --env=DB=mysql --namespace=ecommerce --dry-run=client

# 정상동작 확인 후 --dry-client 옵션 지운 후 명령어 실행
[user@console ~]$ kubectl run eshop-main --image=nginx:1.17 --env=DB=mysql --namespace=ecommerce

# Pod 생성됬는지 확인
[user@console ~]$ kubectl get pods --namespace ecommerce

기출문제 (2번)

Create 2 nginx image pods in which one of them is labelled with env=prod and another one labelled with env=dev and verify the same

기출문제 (3번)

Create an nginx pod and list the pod with different levels of verbosity

기출문제 (4번)

Create a pod with environment variables as var1=value1.Check the environment variable in pod

기출문제 (6번)

List "nginx-dev" and "nginx-prod" pod and delete those pods

기출문제 (8번)

Create a pod as follows:

The pod should launch in the staging namespace and the volume must not be persistent.

기출문제 (9번)

Create a pod with i traffic on port 80

기출문제 (11번)

Create a file: /opt/KUCC00302/kucc00302.txt that lists all pods that implement service baz in namespace development. The format of the file should be one pod name per line.

기출문제 (12번)

Create a pod named kucc8 with a single app container for each of the following images running inside (there may be between 1 and 4 images specified): nginx + redis + memcached.

기출문제 (18번)

Check the image version in pod name nginx without the describe command

기출문제 (19번)

Print pod name and start time to "/opt/pod-status" file

기출문제 (23번)

Get IP address of the pod "nginx-dev”

기출문제 (24번)

List all the pods sorted by name

기출문제 (26번)

List the nginx pod with custom columns POD_NAME and POD_STATUS

기출문제 (27번)

List all the pods sorted by created timestamp

기출문제 (29번)

Get list of all pods in all namespaces and write it to file "/opt/pods-list.yaml”

기출문제 (34번)

Get list of all the pods showing name and namespace with a jsonpath expression.

기출문제 (38번)

Create a busybox pod and add "sleep 3600" command

기출문제 (42번)

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

기출문제 (44번)

Check the Image version of nginx-dev pod using jsonpath

기출문제 (57번)

List all the pods showing name and namespace with a json path expression

기출문제 (59번)

Create a pod as follows: Name: mongo Using Image: mongo In a new Kubernetes namespace named: my-website

기출문제 (66번)

Create a pod that echo "hello world" and then exists.

Have the pod deleted automatically when it's completed

기출문제 (68번)

Schedule a Pod as follows:


Revision #1
Created 30 May 2023 05:21:27 by 와지
Updated 20 June 2023 13:20:11 by 와지