본문 바로가기

CKA &. CKAD/Core Concepts

(13)
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..
Service
Namespaces & Practic Test 같은 namespace에서의 호출은 단순히 서비스 네임만 호출 mysql.connect("db-service") mysql.connect("db-service") 다른 namespace로의 호출은 서비스 네임 다음에 namesapce.svc.clustername을 붙인다. dev namespace에 있는 db-service를 호출한다면 mysql.connect("db-service.dev.svc.cluster.local") mysql.connect("db-service.dev.svc.cluster.local") default namespace에서의 pod 조회 kubectl get pods kube-system namespace 에 대해서 조회할 경우 kubectl get pods --namespace=..
Practice Test - Deployment ㅁ 생성 kubectl create -f deployment-definition.yml ㅁ 조회 kubectl get deployments Deployment와 동일한 이름으로 replicaset 생성됨 kubectl get replicaset ㅁ 전체 조회 kubectl get all [Practice] ㅁ Create a new Deployment using the deployment-definition-1.yaml file located at /root/ kubectl create deployment --image=httpd:2.4-alpine httpd-frontend --dry-run=client -o yaml > httpd-deploymnet.yaml ㅁ fix error image kubec..