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

后端 未结 3 1189
無奈伤痛
無奈伤痛 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:02

    There are a few idiomatic ways to expose a service externally in Kubernetes (see note#1):

    1. Service.Type=LoadBalancer, as OP pointed out.
    2. Service.Type=NodePort, this would exposing node's IP.
    3. Service.Type=ExternalName, Maps the Service to the contents of the externalName field by returning a CNAME record (You need CoreDNS version 1.7 or higher to use the ExternalName type.)
    4. Ingress. This is a new concept that expose eternal HTTP and/or HTTPS routes to services within the Kubernetes cluster, you can even map a route to multiple services. However, this only maps HTTP and/or HTTPS routes only. (See note#2)

提交回复
热议问题