| ページ一覧 | ブログ | twitter |  書式 | 書式(表) |

MyMemoWiki

差分

ナビゲーションに移動 検索に移動
725 バイト追加 、 2020年11月21日 (土) 04:13
*もし、ゲストをゲストブックにアクセスさせたい場合、Frontend サービスを外部に見えるようにする必要がある。
*クライアントがコンテナクラスターの外部からサービスにリクエストするためには、NodePortサービスを公開することで可能となる
 
*type を LoadBalancerに変更して、apply
<pre>
$ kubectl apiVersion: v1kind: Servicemetadata: name: frontend labels: app: guestbook tier: frontendspec: # comment or delete the following line if you want to use a LoadBalancer #type: NodePort # if your cluster supports it, uncomment the following to automatically create # an external load-balanced IP for the frontend service. type: LoadBalancer ports: - port: 80 selector: app: guestbook tier: frontend</pre> *URL(kubectl apply -f https://k8s.io/examples/application/guestbook/frontend-service.yaml)ではなく、上記を変更した、ローカルファイルからapplyする。*Macで[[Multipass]]上のため、事前にマウントを実施済み<pre>$ kubectl apply -f ./files/php_guest_book/frontend-service.yaml
</pre>
frontend NodePort 10.152.183.152 <none> 80:31279/TCP 41s
</pre>
 
===NodePort経由で参照する===

案内メニュー