Azure AKS 的入口 IP
Ingress IP with Azure AKS
我正在用 az aks
实现 this example。我想使用入口以便轻松使用反向代理,如示例中所示,根据入口简单规则,容器重定向到 /tea
,另一个容器重定向到 /coffee
。
rules:
- host: cafe.example.com
http:
paths:
- path: /tea
backend:
serviceName: tea-svc
servicePort: 80
- path: /coffee
backend:
serviceName: coffee-svc
servicePort: 80
我按照步骤操作,但是,如您所见,Azure 不会为我的入口提供 IP 地址。
$ kubectl get ingress
NAME HOSTS ADDRESS PORTS AGE
demo-ingress demo.mydomain.com 80, 443 17h
我认为 azure 只为负载均衡器提供地址。有什么解决方法或解决方案吗?我可以通过某种方式说 azure
为我的入口提供 IP 吗?
作为一些附加信息,我还尝试了 `helm:
helm install stable/nginx-ingress --set controller.publishService.enabled=true
不过我完全是菜鸟,好像什么也做不了
我花了一段时间才发布答案。我想更多地了解容器中发生的事情。
无论如何,implementation I was testing, it is that a azure compatible ingress controller has to be installed (that's kind of my best guess, I'm not an expert though). The steps to install the ingress controller are here的问题。
所有相关文件都在文件夹/install中。我最后做的是 makefile
包含以下说明:
kubectl apply -f install/common/ns-and-sa.yaml
kubectl apply -f install/common/default-server-secret.yaml
kubectl apply -f install/common/nginx-config.yaml
kubectl apply -f install/rbac/rbac.yaml
kubectl apply -f install/deployment/nginx-ingress.yaml
kubectl apply -f install/daemon-set/nginx-ingress.yaml
kubectl create -f install/service/nodeport.yaml
kubectl apply -f install/service/loadbalancer.yaml
kubectl get svc nginx-ingress --namespace=nginx-ingress
有点麻烦,不过我的makefile只要一个命令就可以了
希望对遇到同样问题的人有所帮助。
我正在用 az aks
实现 this example。我想使用入口以便轻松使用反向代理,如示例中所示,根据入口简单规则,容器重定向到 /tea
,另一个容器重定向到 /coffee
。
rules:
- host: cafe.example.com
http:
paths:
- path: /tea
backend:
serviceName: tea-svc
servicePort: 80
- path: /coffee
backend:
serviceName: coffee-svc
servicePort: 80
我按照步骤操作,但是,如您所见,Azure 不会为我的入口提供 IP 地址。
$ kubectl get ingress
NAME HOSTS ADDRESS PORTS AGE
demo-ingress demo.mydomain.com 80, 443 17h
我认为 azure 只为负载均衡器提供地址。有什么解决方法或解决方案吗?我可以通过某种方式说 azure
为我的入口提供 IP 吗?
作为一些附加信息,我还尝试了 `helm:
helm install stable/nginx-ingress --set controller.publishService.enabled=true
不过我完全是菜鸟,好像什么也做不了
我花了一段时间才发布答案。我想更多地了解容器中发生的事情。
无论如何,implementation I was testing, it is that a azure compatible ingress controller has to be installed (that's kind of my best guess, I'm not an expert though). The steps to install the ingress controller are here的问题。
所有相关文件都在文件夹/install中。我最后做的是 makefile
包含以下说明:
kubectl apply -f install/common/ns-and-sa.yaml
kubectl apply -f install/common/default-server-secret.yaml
kubectl apply -f install/common/nginx-config.yaml
kubectl apply -f install/rbac/rbac.yaml
kubectl apply -f install/deployment/nginx-ingress.yaml
kubectl apply -f install/daemon-set/nginx-ingress.yaml
kubectl create -f install/service/nodeport.yaml
kubectl apply -f install/service/loadbalancer.yaml
kubectl get svc nginx-ingress --namespace=nginx-ingress
有点麻烦,不过我的makefile只要一个命令就可以了
希望对遇到同样问题的人有所帮助。