When exposing a service in minikube it is possible to see its url via the following:
minikube service [-n NAMESPACE] [--url] NAME
How do you achieve the same in microk8s?
Thank you
The Kubernetes load balancer sends connections to the first server in the pool until it is at capacity, and then sends new connections to the next available server. This algorithm is ideal where virtual machines incur a cost, such as in hosted environments.
From the Service type drop-down list, select Node port. Click Expose. When your Service is ready, the Service details page opens, and you can see details about your Service. Under Ports, make a note of the Node Port that Kubernetes assigned to your Service.
To reach the ClusterIp from an external computer, you can open a Kubernetes proxy between the external computer and the cluster. You can use kubectl to create such a proxy. When the proxy is up, you're directly connected to the cluster, and you can use the internal IP (ClusterIp) for that Service .
A service of type LoadBalancer is the simplest and the fastest way to expose a service inside a Kubernetes cluster to the external world. You only need to specify the service type as type=LoadBalancer in the service definition. Services of type LoadBalancer are natively supported in Kubernetes deployments.
Realizing this is an older post, but since I just recently implemented a dev install of MicroK8s, I though perhaps I could provide some of my findings.
Wanting a load balancer, I installed MetalLB, https://metallb.universe.tf/, which provides a baremetal LB for a cluster. While MicroK8s does offer an addon for this, I did a manual installation to help myself gain a better understanding.
I used the Layer 2 Configuration option, https://metallb.universe.tf/configuration/#layer-2-configuration which provided a very simple way to expose my services via a load balancer.
To use the config, I then added an annotation to the services that utilize it, indicating which address pool, which for my deployment, I simply call microk8s_pool.
metallb.universe.tf/address-pool: microk8s_pool
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With