[k8s] 오브젝트 이해하기 — Ingress
·
Kubernetes
k8s 핵심 오브젝트 — Ingresskubernetes 개념 심화 2파트NodePort만 쓰다 보면 서비스마다 포트를 하나씩 열어야 해서 관리가 복잡해진다. Ingress는 포트 하나로 URL 경로에 따라 다른 서비스로 라우팅해준다.NodePort의 한계서비스가 늘어날수록 포트도 계속 늘어난다.mysite.com:30080 → 웹앱mysite.com:30090 → API 서버mysite.com:30100 → 관리자 페이지mysite.com:30200 → 결제 서비스사용자가 포트번호를 외워야 한다. 실제 서비스에선 말이 안 되는 구조다.Ingress가 하는 것포트 하나로 URL 경로에 따라 다른 서비스로 라우팅해준다.mysite.com/ → 웹앱mysite.com/api →..
[k8s] 오브젝트 이해하기 — Pod, Deployment, Service
·
Kubernetes
k8s 핵심 오브젝트 — Pod, Deployment, Servicekubernetes 개념 심화 1파트k8s를 직접 구축하고 나서, 핵심 오브젝트들을 직접 만들어보면서 이해해봤다. 개념만 읽는 것보다 직접 죽이고 살려보는 게 훨씬 빠르게 이해됐다.Podk8s에서 컨테이너가 실제로 돌아가는 최소 배포 단위다.kubectl run nginx-1-27 --image=nginx:1.27kubectl get pods14:02:11 [root@k8s-worker-jwc:/k8s]$ kubectl get podsNAME READY STATUS RESTARTS AGEnginx-1-26-b8b844b6c-8p2ng 1/1 Running 0 ..
[k8s] imperative command
·
Kubernetes
kubectl run nginx --image=nginx (deployment) kubectl run nginx --image=nginx --restart=Never (pod) kubectl run nginx --image=nginx --restart=OnFailure (job) kubectl run nginx --image=nginx --restart=OnFailure --schedule"* * * * *" (cronjob) kubectl run nginx --image=nginx \ --restart=Never --port=80 \ --namespace=myname --command -- serviceaccount=mysql --env=HOSTNAME=local \ --labels=bu=instanc..
kubernetes 커맨드 shortcuts
·
Kubernetes
po - 파드 rs - 레플리카셋 deploy - 디플로이먼트 svc - 서비스 ns - 네임스페이스 netpol - 네트워크 폴리시 pv - 퍼시스턴트 볼륨 pvc - 퍼시스턴트 볼륨 클레임 sa - 서비스 어카운트 숏컷을 사용해서 시간을 줄여보자
[CKAD] rewrite-target 옵션
·
Kubernetes
Different ingress controllers have different options that can be used to customise the way it works. NGINX Ingress controller has many options that can be seen here. I would like to explain one such option that we will use in our labs. The Rewrite target option. Our watch app displays the video streaming webpage at http://:/ Our wear app displays the apparel webpage at http://:/ We must configur..
[CKAD/Lab] Imperative commands
·
Kubernetes
Imperative command 예제1) Deploy a redis pod using the redis:alpine image with the labels set to tier=db Either use imperative commands to create the pod with the labels. Or else use imperative commands to generate the pod definition file, then add the labels before creating the pod using the file. $ kubectl run redis --image=redis:alpine --labels tier=db => image 생성 및 label 생성 (kubectl run 명령어를 사..
[CKAD/Lab] - namespace
·
Kubernetes
namespace 예제 1) Create a POD in the finance namespace. Use the spec given below. Name: redis Image name: redis $ kubectl get pods --namespace=finance $ kubectl get pods -n=finance => 네임스페이스 finance 내의 pod를 확인하는 커맨드 $ kubectl run redis --image=redis --namespace=finance => 네임스페이스 finance 내에 redis 라는 이름으로 redis를 생성하는 커맨드 예제 2) Access the Blue web application using the link above your terminal!! Fro..
[k8s] 필수 명령어
·
Kubernetes
--dry-run: 리소스 즉시 생성 --dry-run=client: 커맨드 테스트 -> 리소스가 생성되지 않음. -o yaml: 리소스 정의를 YAML 파일 형식으로 생성해준다. $ kubectl run nginx --image=nginx --dry-run=client -o yaml > nginx-pod.yaml => 리다이렉션으로 nginx-pod.yaml 파일을 생성할 수 있고, 해당 파일을 수정 및 리소스를 추가하여 업데이트 할 수 있다. 예제: # POD Create an NGINX Pod $ kubectl run nginx --image=nginx Generate POD Manifest YAML file (-o yaml). Don't create it(--dry-run) $ kubectl ru..
최선을 다하자!
'Kubernetes' 카테고리의 글 목록