loader
image/svg+xml
  • Data centers and network
  • Products and services
  • Industries
  • Support
  • News
  • About us

Knowledge Base

Setting up load balancing with Ingress and Service resources

Servers.com offers integrated support for two types of load balancing for a publicly accessible application:

- HTTP(S) load balancing using Ingress resources;

- TCP load balancing using Service resources.

Creating an Ingress resource for HTTP(S) load balancing 

Ingress is a Kubernetes resource that encapsulates a collection of rules and a configuration for routing external HTTP(S) traffic to internal services.

On the Servers.com platform, Ingress is implemented using the Load Balancing service. When you create an Ingress in your cluster, the Servers.com's Ingress controller creates a Load Balancer instance and configures it to route traffic to your application. The Ingress controller is provisioned with the cluster. The load balancer is set up with an ephemeral IP address, meaning its lifetime equals to the lifetime of the resource it's attached to. Once that resource is destroyed, the IP address is freed, and will eventually be assigned to another resource.

Since each Ingress resource is merely a Load Balancer instance on our platform, it is priced as a Load Balancer instance.

Class name of the Servers.com Ingress controller 

The controller provisioned by Servers.com only processes Ingresses with "kubernetes.io/ingress.class" annotation set to "serverscom".

A minimal Ingress resource example

--- apiVersion: extensions/v1beta1 kind: Ingress metadata: name: hello-world-ingress annotations: kubernetes.io/ingress.class: "serverscom" servers.com/ingress.load-balancer-healthcheck-path: "/healthz" spec: rules: - host: example.com http: paths: - path: / backend: serviceName: hello-world-svc servicePort: 8080

Annotations specific to the Servers.com Ingress controller

servers.com/ingress.load-balancer-healthcheck-path

Description: Sets the healthcheck path for the Ingress-resource-backing load balancer. See the "Healthcheck URI" section in the documentation for the Load Balancing service.

Type: string, uri path

Default: /healthz

servers.com/ingress.load-balancer-geo-ip

Description: Enables/disables GeoIP headers for the Ingress-resource-backing load balancer. See the "GeoIP headers injection" section in the documentation for the Load Balancing service.

Type: stringified boolean ( "false", "true" )

Default: "false"

servers.com/ingress.load-balancer-redirect-http

Description: Enables/disables redirection of HTTP to HTTPS for the Ingress-resource-backing load balancer. See the "SSL termination & Forwarding rules" section in the documentation for the the Load Balancing service.

Type: stringified boolean ( "false", "true" )

Default: "false"

ingress.kubernetes.io/load-balancer-status

Description: This annotation is used to record debug information on the Load balancer current status. The value is overwritten by the Ingress controller. [1]

Creating Service resource for TCP load balancing 

Service is effectively a named load balancer that proxies TCP traffic to one or more Pods.

On the Servers.com platform, setting the type field of a Service object to LoadBalancer provisions an L4 (TCP) load balancer for your Service. The actual creation of the load balancer happens asynchronously, and information about the provisioned balancer is published in the Service’s .status.loadBalancer field. The load balancer is set up with an ephemeral IP address, meaning its lifetime equals to the lifetime of the resource it's attached to. Once that resource is destroyed, the IP address is freed, and will eventually be assigned to another resource.

Since each Service resource with the type field set to LoadBalancer is merely a Load Balancer instance on our platform, it is priced as a Load Balancer instance.

A minimal Service resource example

--- apiVersion: v1 kind: Service metadata: name: hello-world-svc annotations: servers.com/service.proxy-protocol: "false" spec: ports: - port: 80 protocol: TCP targetPort: 80 selector: app: hello-world-app type: LoadBalancer

Annotations specific to the Servers.com's cloud controller manager

servers.com/service.proxy-protocol

Description: Enables/disables the PROXY protocol on a load balancer. The PROXY protocol enables applications to receive client connection information passed through a load balancer. The information passed via the PROXY protocol is the client IP address, the load balancer IP address, and both port numbers.

Type: stringified boolean ( "false", "true" )

Default: "false"