How can you publish a Kubernetes Service without using the type LoadBalancer (on GCP)

后端 未结 3 1080
無奈伤痛
無奈伤痛 2021-02-04 10:43

I would like to avoid using type: \"LoadBalancer\" for a certain Kubernetes Service, but still to be able to publish it on the Internet. I am using Google Cloud Pla

3条回答
  •  清酒与你
    2021-02-04 11:05

    There's another option: set the hostNetwork flag on your pod.

    For example, you can use helm3 to install nginx this way:

     helm install --set controller.hostNetwork=true nginx-ingress nginx-stable/nginx-ingress
    

    The nginx is then available at port 80 & 443 on the IP address of the node that runs the pod. You can use node selectors or affinity or other tools to influence this choice.

提交回复
热议问题