Slide 16
Slide 16 text
port-forwardを使ってPodへアクセス
16
$ kubectl port-forward nginx-966f97bf8-s4kpl 8080:80
Forwarding from 127.0.0.1:8080 -> 80
Forwarding from [::1]:8080 -> 80
Handling connection for 8080
Handling connection for 8080
# ブラウザから localhost:8080にアクセス可能。
$ kubectl logs nginx-966f97bf8-s4kpl -f
127.0.0.1 - - [27/Jun/2018:06:30:30 +0000] "GET / HTTP/1.1" 200 612 "-" "Mozilla/5.0
(Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/67.0.3396.87 Safari/537.36" "-"
127.0.0.1 - - [27/Jun/2018:06:30:30 +0000] "GET /favicon.ico HTTP/1.1" 404 572
"http://localhost:8080/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36" "-"
127.0.0.1 - - [27/Jun/2018:06:30:51 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0
(Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/67.0.3396.87 Safari/537.36" "-"