我可以在多个 AKS 群集中使用我的 azure DNS 区域吗
Can I use my azure DNS zone in more than one AKS clusters
我的域名有 DNS 区域,还有一个 AKS 群集。我想创建具有两个独立集群的开发和暂存环境。所以我想在每个集群中使用具有不同子域的相同域并将其集成到入口中。
如果我没理解错的话,你需要 Exposing Applications on Azure.
所以思路是用External DNS
+ nginx ingress controller
。
你
az group create -n devresourcegroup -l yourlocation
az network dns zone create -g devresourcegroup -n dev.yourdomainname.com
az group create -n stagingresourcegroup -l yourlocation
az network dns zone create -g stagingresourcegroup -n staging.yourdomainname.com
- create dev.yourdomainname.com 和 staging.yourdomainname.com 个条目
- add permissions to modify dns zone for external-dns
- deploy externaldns in both clusters
我假设 external-dns-values.yaml
应该像
dev-external-dns-values.yaml
:
domainFilters:
- dev.yourdomainname.com # (optional) Just restrict to this
...
azure:
secretName: azure-config-file # Secret name created above for dev
extraArgs:
azure-resource-group: devresourcegroup # (Optional) Resource group name created above
staging-external-dns-values.yaml
:
domainFilters:
- staging.yourdomainname.com # (optional) Just restrict to this domain
...
azure:
secretName: azure-config-file # Secret name created above for staging
extraArgs:
azure-resource-group: stagingresourcegroup # (Optional) Resource group name created above
- 安装external-dns'es
helm install stable/external-dns --name external-dns -f dev-external-dns-values.yaml
helm install stable/external-dns --name external-dns -f staging-external-dns-values.yaml
-
deploy apps 每个集群中都有适当的入口对象。我是说这部分
spec:
rules:
- host:
http:
paths:
- backend:
serviceName:
servicePort:
path:
我的域名有 DNS 区域,还有一个 AKS 群集。我想创建具有两个独立集群的开发和暂存环境。所以我想在每个集群中使用具有不同子域的相同域并将其集成到入口中。
如果我没理解错的话,你需要 Exposing Applications on Azure.
所以思路是用External DNS
+ nginx ingress controller
。
你
az group create -n devresourcegroup -l yourlocation
az network dns zone create -g devresourcegroup -n dev.yourdomainname.com
az group create -n stagingresourcegroup -l yourlocation
az network dns zone create -g stagingresourcegroup -n staging.yourdomainname.com
- create dev.yourdomainname.com 和 staging.yourdomainname.com 个条目
- add permissions to modify dns zone for external-dns
- deploy externaldns in both clusters
我假设 external-dns-values.yaml
应该像
dev-external-dns-values.yaml
:
domainFilters:
- dev.yourdomainname.com # (optional) Just restrict to this
...
azure:
secretName: azure-config-file # Secret name created above for dev
extraArgs:
azure-resource-group: devresourcegroup # (Optional) Resource group name created above
staging-external-dns-values.yaml
:
domainFilters:
- staging.yourdomainname.com # (optional) Just restrict to this domain
...
azure:
secretName: azure-config-file # Secret name created above for staging
extraArgs:
azure-resource-group: stagingresourcegroup # (Optional) Resource group name created above
- 安装external-dns'es
helm install stable/external-dns --name external-dns -f dev-external-dns-values.yaml
helm install stable/external-dns --name external-dns -f staging-external-dns-values.yaml
deploy apps 每个集群中都有适当的入口对象。我是说这部分
spec:
rules:
- host:
http:
paths:
- backend:
serviceName:
servicePort:
path: