STUDY/Data Engineering

[kodekloud] 01 Core Concepts : Service 풀이

wonpick 2023. 1. 21. 20:08
Q1. How many Services exist on the system?                                                                                                                            
alias k=kubectl; k get services

Q2. What is the type of the default kubernetes service?                                                                                                          

위에서 k get services 명령어를 통해 type이 clusterIP임을 확인했다. 

 

Q3. What is the targetPort configured on the kubernetes service?                                                                                        
k describe services
# 서비스가 1개만 있기 때문에 위의 명령어로도 가능하지만 정확한 서비스 명과 조회하려면
k describe svc kubernetes

Q4. How many labels are configured on the kubernetes service?                                                                                           

위에서 확인한 것처럼 2개

Q5. How many Endpoints are attached on the kubernetes service?                                                                                       

1개

-> 10.27.66.3:6443

 

Q6. How many Deployments exist on the system now?                                                                                                            
k get deployments

Q7. What is the image used to create the pods in the deployment?                                                                                       
k describe deployments #1개니까 
k describe deployments.apps simple-webapp-deployment

Q8. Are you able to accesss the Web App UI?                                                                                                                           

접근 안됨 : NO

Q9. Create a new service to access the web application using the service-definition-1.yaml file.                                      

미리 생성된 매니페스트를 수정하고 서비스를 생성하면된다! 서비스를 생성하는 커맨드는 create,apply로 가능하다. 

create와 apply의 차이는?!

command 리소스가 존재하지 않을 경우 리소스가 이미 존재할 경우
create 새로운 리소스가 생성됩니다. ERROR가 발생합니다.
apply 새로운 리소스가 생성됩니다. 리소스를 구성합니다.
(부분적인 spec을 적용합니다.)
replace ERROR가 발생합니다. 리소스가 삭제된 뒤 새롭게 생성됩니다.

 

Q10. Access the web application using the tab simple-webapp-ui above the terminal window.