Expose a Kubernetes cluster workload to Public Internet
Use the RingLink Kubernetes Operator to expose workloads in your cluster to Public Internet.
To get started, define a Service with type: LoadBalancer, and set the loadBalancerClass to ringlink.
Prerequisites
Expose a Kubernetes Service
To expose a Kubernetes Service to public internet, follow these steps:
Set spec.type to LoadBalancer.
Set spec.loadBalancerClass to ringlink.
Add the annotation networking.ring.link/load-balancer-type with the value external.
Add the annotation networking.ring.link/load-balancer-zone with the value us-west to public your service in
US.
After setup, the Service will show an DNS name can be reachable via public internet.
Check the status with:
kubectl get service <service-name>You should also see a new device listed under the Networks tab in the RingLink dashboard.
Example configuration:
apiVersion: v1
kind: Service
metadata:
name: ringlink-lb
annotations:
networking.ring.link/load-balancer-type: "external"
networking.ring.link/load-balancer-zone: "lax27-a"
spec:
type: LoadBalancer
loadBalancerClass: ringlink
selector:
app: nginx
ports:
- protocol: TCP
port: 80Expected output:
root@localhost:~# kubectl get svc ringlink-lb
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
ringlink-lb LoadBalancer 10.43.29.231 right-neglect.elb.com 80:31088/TCP 9sExpose a Service to a specific network
If you're working with multiple RingLink networks, you can bind a Service to a specific one:
Create a RingLinkConfiguration for the target network:
apiVersion: ring.link/v1
kind: RingLinkConfiguration
metadata:
name: ringlink-08132e98
spec:
network: 08132e98
secretName: ringlink-tokenAdd the networking.ring.link/config annotation to the Service:
apiVersion: v1
kind: Service
metadata:
name: ringlink-lb
annotations:
networking.ring.link/config: "ringlink-08132e98"
networking.ring.link/load-balancer-type: "external"
networking.ring.link/load-balancer-zone: "lax27-a"
spec:
type: LoadBalancer
loadBalancerClass: ringlink
selector:
app: nginx
ports:
- protocol: TCP
port: 80Custom region to publish
If you want to publish your service to another region, change annotation networking.ring.link/load-balancer-zone to your desired region.
Available Region are:
| zone code | location |
|---|---|
| hkg01-a | Hong Kong |
| sea01-a | Seattle |
| tyo05-a | Tokyo |
| can01-a | Guangzhou |
| lax27-a | Los Angeles |
| fra27-a | Frankfurt |
| iad27-a | Ashburn |
| sha03-a | Shanghai |
| syd27-a | Sydney |