CKA &. CKAD (104) 썸네일형 리스트형 Practice Test - Labels and Selectors ㅁ We have deployed a number of PODs. They are labelled with 'tier', 'env' and 'bu'. How many PODs exist in the 'dev' environmnet? Use selectors to filter the output kubectl get pods --show-labels kubectl get pods --selector env=dev or kubectl get pods -l env=dev or kbuectl get pods -l env=dev --no-headers | wc -l ㅁ How many PODs are in the "finance" business unit ("bu")" kubectl get pods --selec.. Labels and Selectors Pod-definition.yaml apiVersion: v1 kind: Pod metatdata: name: simple-webapp labels; app: App1 function: Front-end spec: containers: - name: simple-webapp image: simple-webapp ports: - containerPort: 8080 Select kubectl get pods --selector app=App1 Replicaset-definition.yaml apiVersion: apps/v1 kind: ReplicaSet metadata: name: simple-webapp labels: app: App1 function: Front-end annotations: build.. Manual Scheduling ㅁ A pod definition file nginx.yaml is given. Create pod using the file. kubectl apply -f nginx.yaml ㅁ What is the status of the created POD? kubectl get pods ㅁ Why is the POD in a pending state? kubectl -n kube-system get pods kubectl describe pod nginx ㅁ Manually schedule the pod on node01 apiVersion: v1 kind: Pod metadata: name: nginx spec: nodeName: node01 containers: - image: nginx name: ngi.. kubectl apply command ㅁ Declarative Create Object kubectl apply -f nginx.yaml kubectl apply -f /path/to/config-files Update Object kubectl apply -f nginx.yaml Practice Test - Imperative Command ㅁ Deploy a pod named nginx-pod using the nginx:alpine image kubectl run nginx-pod --image=nginx:alpine ㅁ Deploy a redis pod using the redis:alpine image with the labels set to tier=db kubectl run redis --image=redis:alpine --label=tier-db ㅁ Create a service redis-service to expose the redis application within the cluster on port 6379 kubectl expose pod redis --name redis-service --port 6379 --ta.. CKA Tip 2: Imperative Command with kubectl [Pod] - Create an NGINX Pod kubectl run nginx --image=nginx - Generate POD Manifest YAML file (-o yaml). Don't create it(--dry-run) kubectl run nginx --image=nginx --dry-run=client -o yaml [Deployment] - create a deployment kubectl create deploymnet --iage=nginx nginx - Generate Deployment YAML file (-o yaml). Don't create it (--dry-run) kubectl create deployment --image=nginx nginx --dry-run -o.. Imperative vs Declarative Practice Test - Service ㅁ How many Services exist on the system? in the current(default) namespace kubectl get services ㅁ What is the type of the default kubernetes service? kubectl get services --all-namespaces ㅁ What is the targetPort configured on the kubernetes service? ㅁ How many labels are configured on the kubernetes service ㅁ How many Endpoints are attached on the kubernetes service? kubectl describe service ku.. 이전 1 ··· 9 10 11 12 13 다음