"Interactive Tutorial - Deploying an App"의 두 판 사이의 차이

잔글 (봇: Kubernetes을(를) K8s(으)로 분류 대체함)
 
(다른 사용자 한 명의 중간 판 하나는 보이지 않습니다)
28번째 줄: 28번째 줄:


==View our app==
==View our app==
{{소스헤더|Terminal2}}
<source lang='console'>
$ kubectl proxy
Starting to serve on 127.0.0.1:8001
</source>
{{소스헤더|Terminal}}
<source lang='console'>
$ curl http://localhost:8001/version
{
  "major": "1",
  "minor": "13",
  "gitVersion": "v1.13.3",
  "gitCommit": "721bfa751924da8d1680787490c54b9179b1fed0",
  "gitTreeState": "clean",
  "buildDate": "2019-02-01T20:00:57Z",
  "goVersion": "go1.11.5",
  "compiler": "gc",
  "platform": "linux/amd64"
}
</source>
<source lang='console'>
$ curl http://localhost:8001/version
{
  "major": "1",
  "minor": "13",
  "gitVersion": "v1.13.3",
  "gitCommit": "721bfa751924da8d1680787490c54b9179b1fed0",
  "gitTreeState": "clean",
  "buildDate": "2019-02-01T20:00:57Z",
  "goVersion": "go1.11.5",
  "compiler": "gc",
  "platform": "linux/amd64"
}
</source>
<source lang='console'>
$ export POD_NAME=$(kubectl get pods -o go-template --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')
$ echo Name of the Pod: $POD_NAME
Name of the Pod: kubernetes-bootcamp-6bf84cb898-blx46
</source>
<source lang='console'>
$ curl http://localhost:8001/api/v1/namespaces/default/pods/$POD_NAME/proxy/
Hello Kubernetes bootcamp! | Running on: kubernetes-bootcamp-6bf84cb898-blx46 | v=1
</source>


[[분류: kubernetes]]
[[분류:K8s]]
[[분류: 카타코더]]
[[분류:카타코더]]

2020년 7월 31일 (금) 22:47 기준 최신판

1 개요[ | ]

Interactive Tutorial - Deploying an App

2 kubectl basics[ | ]

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.3", GitCommit:"721bfa751924da8d1680787490c54b9179b1fed0", GitTreeState:"clean", BuildDate:"2019-02-01T20:08:12Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.3", GitCommit:"721bfa751924da8d1680787490c54b9179b1fed0", GitTreeState:"clean", BuildDate:"2019-02-01T20:00:57Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}
$ kubectl get nodes
NAME       STATUS   ROLES    AGE     VERSION
minikube   Ready    master   3m15s   v1.13.3

3 Deploy our app[ | ]

$ kubectl run kubernetes-bootcamp --image=gcr.io/google-samples/kubernetes-bootcamp:v1 --port=8080
kubectl run --generator=deployment/apps.v1 is DEPRECATED and will be removed in a future version. Use kubectl run --generator=run-pod/v1 or kubectl create instead.
deployment.apps/kubernetes-bootcamp created
$ kubectl get deployments
NAME                  READY   UP-TO-DATE   AVAILABLE   AGE
kubernetes-bootcamp   1/1     1            1           2m5s

4 View our app[ | ]

Terminal2
$ kubectl proxy
Starting to serve on 127.0.0.1:8001
Terminal
$ curl http://localhost:8001/version
{
  "major": "1",
  "minor": "13",
  "gitVersion": "v1.13.3",
  "gitCommit": "721bfa751924da8d1680787490c54b9179b1fed0",
  "gitTreeState": "clean",
  "buildDate": "2019-02-01T20:00:57Z",
  "goVersion": "go1.11.5",
  "compiler": "gc",
  "platform": "linux/amd64"
}
$ curl http://localhost:8001/version
{
  "major": "1",
  "minor": "13",
  "gitVersion": "v1.13.3",
  "gitCommit": "721bfa751924da8d1680787490c54b9179b1fed0",
  "gitTreeState": "clean",
  "buildDate": "2019-02-01T20:00:57Z",
  "goVersion": "go1.11.5",
  "compiler": "gc",
  "platform": "linux/amd64"
}
$ export POD_NAME=$(kubectl get pods -o go-template --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')
$ echo Name of the Pod: $POD_NAME
Name of the Pod: kubernetes-bootcamp-6bf84cb898-blx46
$ curl http://localhost:8001/api/v1/namespaces/default/pods/$POD_NAME/proxy/
Hello Kubernetes bootcamp! | Running on: kubernetes-bootcamp-6bf84cb898-blx46 | v=1
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}