kubernetes - Accessing a service using a LoadBalancer in microk8s
问题描述
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
解决方案
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
推荐阅读
- c++ - vxWorks 6.9 中的定时器
- node.js - 等待不适用于nodejs中的插入命令
- wordpress - SSL证书解释
- postgresql - postgreSQL中的批量返回语句?
- google-cloud-automl - 在 Google AutoML 视觉中,是否可以生成图像中重要区域的定位图(热图)?
- typescript - 将对象的 Observable 转换为 Observables 的对象
- c++ - strcmp - '[' 标记之前的预期主表达式
- python - 散景:如何为带有双索引 Pandas 分组数据框的条形图设置单索引标签图例?
- r - dplyr 将具有更改参数的单个函数应用于同一列
- javascript - 如果我在按钮内添加跨度以添加字体真棒图标,则下拉 onclick 功能不起作用