wonpick
devvon
wonpick
방문자🌱
오늘
어제
  • 분류 전체보기 (147)
    • 개발 (42)
      • Spark (7)
      • Hadoop (3)
      • ML&DL (4)
      • Paper Review (0)
      • ETC (24)
    • STUDY (77)
      • Data Engineering (54)
      • Cloud (4)
      • Algorithm (5)
      • SQL (10)
      • Toy Project (1)
    • Android (2)
    • Backend (14)
    • 인턴 (0)
    • 공모전 (0)

블로그 메뉴

  • 홈
  • 태그
  • 방명록

인기 글

태그

  • SQL
  • 쿠버네티스
  • cka
  • Python
  • 데이터엔지니어링
  • 최신 데이터 인프라 이해하기 #7
  • kodekloud
  • 자연어처리
  • 최신 데이터 인프라 이해하기
  • 인턴강연

최근 댓글

최근 글

티스토리

Designed By.hELLO
wonpick

devvon

[kodekloud] 01 Core Concepts : Imperative-Commands 풀이
STUDY/Data Engineering

[kodekloud] 01 Core Concepts : Imperative-Commands 풀이

2023. 1. 21. 20:10
Q1. Deploy a pod named nginx-pod using the nginx:alpine image.                                                                                         
 k run nginx-pod --image=nginx:alpine

Q2. Deploy a redis pod using the redis:alpine image with the labels set to tier=db.                                                             
k run redis --image=redis:alpine --labels=tier=db

Q3. Create a service redis-service to expose the redis application within the cluster on port 6379.                                 
명령어 예시 공식문서
kubectl expose (-f FILENAME | TYPE NAME) [--port=port] [--protocol=TCP|UDP|SCTP] [--target-port=number-or-name] [--name=name] [--external-ip=external-ip-of-service] [--type=type]
k expose pods redis --port=6379 --name=redis-service

[공식문서] 쿠버네티스 서비스 객체로 클러스터에 접근하기 

# service 정보 표시하기 
kubectl describe services  redis-service
'''서비스 생성시 포트를 6379로 했어야했는데 6370으로 잘못침..'''

삭제하고 재생성

Q4. Create a deployment named webapp using the image kodekloud/webapp-color with 3 replicas.                              
k create deployment webapp --image=kodekloud/webapp-color --replicas=3

 

Q5. Create a new pod called custom-nginx using the nginx image and expose it on container port 8080.                      
k run custom-nginx --image=nginx --port=8080

Q6.Create a new namespace called dev-ns. Use imperative commands.

Q7. Create a new deployment called redis-deploy in the dev-ns namespace with the redis image. It should               have 2 replicas                                                                                                                                                                           
k create deployment redis-deploy --namespace=dev-ns --image=rdis --replicas=2

Q8. Create a pod called httpd using the image httpd:alpine in the default namespace. Next, create a service of type    ClusterIP by the same name (httpd). The target port for the service should be 80.                                                        
k run httpd --image=httpd:alpine --port=80 --expose

 

'STUDY > Data Engineering' 카테고리의 다른 글

[kodekloud] 02 Scheduling : Labels and Selectors 풀이  (0) 2023.01.22
[kodekloud] 02 Scheduling : Manual Scheduling 풀이  (0) 2023.01.21
[kodekloud] 01 Core Concepts : Service 풀이  (0) 2023.01.21
[kodekloud] 01 Core Concepts : Namespaces 풀이  (0) 2023.01.21
14. CKA udemy 강의 정리 - Section 7 [Networking]  (0) 2023.01.21
    wonpick
    wonpick

    티스토리툴바