데이터센터프로그래밍22(2)

서유리·2022년 5월 27일
1
post-thumbnail

22-Services(실습)

🟡 Apply multiple ReplicaSet manifest

ls -al
minikube start
# kubectl apply -f [파일명].yaml
kubectl apply -f two-replicas-with-label.yaml
kubectl get pod -l app=eva
kubectl get pod -l app=eva -l release=west
kubectl get pod -l app=eva -l release=east
kubectl get all

🟡 Apply simple Service (NodePort) manifest

# kubectl apply -f [파일명].yaml
kubectl apply -f simple-service.yaml
kubectl get service eva
kubectl get all

🟡 Apply Nginx through NodePort

kubectl cluster-info
# Check IP address of Kubernetes master
kubectl get all
# Check Port mapping of eva's NodePort
curl http://{Master IP address}:{NodePort Number}

🟡 Access Nginx through temporal container

kubectl run -i --rm --tty debug \ --image=alpine:latest --restart=Never --ash -il
apk add curl
curl http://eva/

🟡 Check Nginx log for labelled service

kubectl logs -f{Pod ID} nginx

🟡 Cleanup Kubernets

# kubectl delete -f [파일명].yaml
kubectl delete -f simple-service.yaml
# kubectl delete -f [파일명].yaml
kubectl delete -f two-replicas-with-label.yaml
kubectl delete pods,services --all=true
minikube stop
profile
best of best

0개의 댓글

관련 채용 정보