[英]Access a web app from outside an Azure k8s
从集群外部访问在 aks 容器中运行的 web 应用程序的最佳方法是什么,该名称已在 Azure DNS 区域中定义? 和外部 DNS 服务器对此有帮助吗?
我将设置一个指向您的服务的入口,该服务公开 web 应用程序。
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: simple-fanout-example
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- host: your.web.app.address
http:
paths:
- path: /
backend:
serviceName: service
servicePort: 8080
Ingress将 HTTP 和 HTTPS 路由从集群外部公开到集群内的服务。 流量路由由 Ingress 资源上定义的规则控制。
internet
|
[ Ingress ]
--|-----|--
[ Services ]
Ingress 可以配置为提供服务外部可访问的 URL、负载平衡流量、终止 SSL / TLS,并提供基于名称的虚拟主机。 Ingress controller负责实现 Ingress,通常使用负载均衡器,但它也可以配置边缘路由器或其他前端来帮助处理流量。
Ingress 不会暴露任意端口或协议。 向 Internet 公开 HTTP 和 HTTPS 以外的服务通常使用类型为Service.Type=NodePort或Service.Type=LoadBalancer的服务。
I would recommend reading Create an ingress controller in Azure Kubernetes Service (AKS) , or use Azure Application Gateway as an ingress this is explainedhere and you can find tutorials onGitHub
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.