LoginSignup
0
0

Fedora39でminikube - ServiceをDeployする(1)

Last updated at Posted at 2024-04-20

Fedora39でminikube - pod確認(1)からの続きです。

@fedora:~$ kubectl_m create deployment hello-minikube --image=kicbase/echo-server:1.0
deployment.apps/hello-minikube created

確認します。

@fedora:~$ kubectl_m get services
NAME             TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)          AGE
hello-minikube   NodePort    10.97.204.75   <none>        8080:32147/TCP   75s
kubernetes       ClusterIP   10.96.0.1      <none>        443/TCP          13d

ブラウザで確認します。

@fedora:~$ minikube service hello-minikube
|-----------|----------------|-------------|-----------------------------|
| NAMESPACE |      NAME      | TARGET PORT |             URL             |
|-----------|----------------|-------------|-----------------------------|
| default   | hello-minikube |        8080 | http://192.168.59.100:32147 |
|-----------|----------------|-------------|-----------------------------|
🎉  デフォルトブラウザーで default/hello-minikube サービスを開いています...

ブラウザで開くと、この様に表示されます。

Request served by hello-minikube-7f54cff968-xhftg

HTTP/1.1 GET /

Host: 192.168.59.100:32147
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Encoding: gzip, deflate
Accept-Language: ja,en-US;q=0.7,en;q=0.3
Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0

ポートフォーワードもできます。

@fedora:~$ kubectl_m port-forward service/hello-minikube 7080:8080
Forwarding from 127.0.0.1:7080 -> 8080
Forwarding from [::1]:7080 -> 8080
Handling connection for 7080

ブラウザで開くと、この様に表示されます。

Request served by hello-minikube-7f54cff968-xhftg

HTTP/1.1 GET /

Host: localhost:7080
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Encoding: gzip, deflate, br
Accept-Language: ja,en-US;q=0.7,en;q=0.3
Connection: keep-alive
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: none
Sec-Fetch-User: ?1
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0

(参考)minikube start

Fedora39でminikube - LoadBalancerをDeployする(1)につづく。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0