본문 바로가기

Infra/Kubernetes

3. Kubectl을 사용해서 디플로이먼트 생성하기

I. Deploy an app

1. Deploy Application

kubectl create deployment kubernetes-bootcamp --image=gcr.io/google-samples/kubernetes-bootcamp:v1

2. List Deployments

kubectl get deployments

3. Query Version using API 

kubectl proxy
curl http://localhost:8001/version

4. Find the Name of the Pod

export POD_NAME=$(kubectl get pods -o go-template --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')
echo Name of the Pod: $POD_NAME