通过 Istio 公开开源 Helm 图表 Gateway/VirtualService
Expose opensource Helm charts through Istio Gateway/VirtualService
我想通过 Istio ingress 公开一些 Helm Charts。
例如,今天我可以通过 Ingress
类型(使用 NginX Ingress)公开 Kubernetes Dashboard:
helm install stable/kubernetes-dashboard --set ingress.enabled=true
但是,对于 Istio 我是否必须 fork Kubernetes Dashboard Helm chart 以添加所需的 Gateway
和 VirtualService
yaml?
或者是否有更好的方法来修补开源图表以与 Istio ingress 一起使用?
您可以创建自己的图表,将 stable/kubernetes-dashboard
作为 requirements.yaml
的依赖项。然后,您实际上拥有一个包含仪表板的包装图表,您可以在包装级别包含 Istio 入口配置。
实际上,您可以在不换行的情况下执行此操作。在我的例子中,我不得不将 Keycloak 公开为 VirtualService
。 keycloak 也在其他 namespace.
- 我写了
Gateway
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: keycloak-gateway
namespace: keycloak
spec:
selector:
istio: ingressgateway # use Istio default gateway implementation
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- "*"
- 我写了
VirtualService
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: demo-keycloak-http
namespace: keycloak
spec:
gateways:
- keycloak-gateway
hosts:
- '*'
http:
- match:
- uri:
prefix: /auth
route:
- destination:
host: demo-keycloak-http.keycloak.svc.cluster.local
port:
number: 80
请注意,我正在路由服务名称。
如您所见,还可以从其他命名空间公开 helm chart。在你的情况下,也许你不需要写 Gateway
您只需要找到服务名称并为其写入VirtualService
。
我想通过 Istio ingress 公开一些 Helm Charts。
例如,今天我可以通过 Ingress
类型(使用 NginX Ingress)公开 Kubernetes Dashboard:
helm install stable/kubernetes-dashboard --set ingress.enabled=true
但是,对于 Istio 我是否必须 fork Kubernetes Dashboard Helm chart 以添加所需的 Gateway
和 VirtualService
yaml?
或者是否有更好的方法来修补开源图表以与 Istio ingress 一起使用?
您可以创建自己的图表,将 stable/kubernetes-dashboard
作为 requirements.yaml
的依赖项。然后,您实际上拥有一个包含仪表板的包装图表,您可以在包装级别包含 Istio 入口配置。
实际上,您可以在不换行的情况下执行此操作。在我的例子中,我不得不将 Keycloak 公开为 VirtualService
。 keycloak 也在其他 namespace.
- 我写了
Gateway
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: keycloak-gateway
namespace: keycloak
spec:
selector:
istio: ingressgateway # use Istio default gateway implementation
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- "*"
- 我写了
VirtualService
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: demo-keycloak-http
namespace: keycloak
spec:
gateways:
- keycloak-gateway
hosts:
- '*'
http:
- match:
- uri:
prefix: /auth
route:
- destination:
host: demo-keycloak-http.keycloak.svc.cluster.local
port:
number: 80
请注意,我正在路由服务名称。
如您所见,还可以从其他命名空间公开 helm chart。在你的情况下,也许你不需要写 Gateway
您只需要找到服务名称并为其写入VirtualService
。