imperative Test
2023. 4. 19. 20:48ㆍKubernetes
# nginx:alpine 이미지를 이용해서 nginx-pod 이름의 pod 생성
kubectl run nginx-pod --image=nginx:alpine
# redis: alpine 이미지를 이용해서 redis 이름의 pod 생성 , 라벨이 tier=db 여야함.
# 잘모르겠으면 kubectl run --help
kubectl run redis --image=redis:alpine --labels="tier=db"
# redis pod를 expose 하는 redis-service 이름의 서비스 생성 , port 가 6379 여야함.
# 잘모르겠으면 kubectl expose --help
kubectl expose pod redis --port=6379 --name redis-service
# webapp이름의 deployment 생성 ,image=kodekloud/webapp-color ,replicas 3이어야함.
kubectl create deploy webapp --image=kodekloud/webapp-color --replicas=3
# nginx 이미지를 써서 custom-nginx pod 생성 , port 8080
kubectl run custom-nginx --image=nginx --port=8080
kubectl run httpd --image=httpd:alpine
kubectl expose httpd --port=80
#위 2개를 하나로 합칠수있음 : kubectl run --help 참고
kubectl run httpd --image=httpd:alpine --port=80 --expose=true
'Kubernetes' 카테고리의 다른 글
[kubernetes] pod의 DNS 접근이 안될때는 ingress를 째려보자 (0) | 2023.05.04 |
---|---|
running pod 수정법 (0) | 2023.04.26 |
Load balancer (0) | 2023.04.17 |
Cluster IP (0) | 2023.04.17 |
Test-replicaSet (0) | 2023.04.12 |