不会为入口资源创建 DNS 记录
DNS records are not created for ingress resources
我的配置:
apiVersion: v1
kind: ServiceAccount
metadata:
name: external-dns
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: external-dns
rules:
- apiGroups: [""]
resources: ["services"]
verbs: ["get","watch","list"]
- apiGroups: [""]
resources: ["pods"]
verbs: ["get","watch","list"]
- apiGroups: ["extensions"]
resources: ["ingresses"]
verbs: ["get","watch","list"]
- apiGroups: [""]
resources: ["nodes"]
verbs: ["list"]
- apiGroups: ["networking.istio.io"]
resources: ["gateways"]
verbs: ["get","watch","list"]
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: external-dns-viewer
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: external-dns
subjects:
- kind: ServiceAccount
name: external-dns
namespace: kube-system
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: external-dns
namespace: kube-system
spec:
strategy:
type: Recreate
template:
metadata:
labels:
app: external-dns
spec:
serviceAccountName: external-dns
containers:
- name: external-dns
image: registry.opensource.zalan.do/teapot/external-dns:latest
args:
- --source=ingress
- --source=istio-gateway
- --domain-filter=xxx
- --policy=upsert-only
- --provider=azure
volumeMounts:
- name: azure-config-file
mountPath: /etc/kubernetes
readOnly: true
volumes:
- name: azure-config-file
secret:
secretName: azuredns-config
正在解析 Istio 网关对象并正在创建 DNS 记录(这发生在不久前,我现在在日志中看不到任何内容)。出于某种原因,入口记录未被解析。我试过添加 --source=service
并使用以下注释服务:external-dns.alpha.kubernetes.io/hostname: my.host.name
,也没有效果。
有什么想法吗?这看起来不错,但不知何故不起作用。 Ingress 工作,cert-manager 创建证书,如果我手动创建 DNS 记录 ingress 工作正常。
我建议 运行ning https://github.com/kubernetes-incubator/external-dns 具有适当的云提供商角色,例如AWS 中的 IAM 角色,允许修改 Route53 记录。
对于 Azure:https://github.com/kubernetes-incubator/external-dns/blob/master/docs/tutorials/azure.md
当你 运行 它时,确保你启用了入口源:https://github.com/helm/charts/blob/master/stable/external-dns/values.yaml#L8-L12
它具有调试日志记录功能,因此您可以准确检查您的记录发生了什么。
问题是由于 nginx-ingress 没有将其 IP 地址发布到入口资源状态字段。 GH 问题:https://github.com/kubernetes-incubator/external-dns/issues/456
--log-level=debug
帮助确定了问题。通过将此添加到 nginx 入口控制器部署来修复:
- --publish-service=kube-system/nginx-ingress-controller
- --update-status
我的配置:
apiVersion: v1
kind: ServiceAccount
metadata:
name: external-dns
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: external-dns
rules:
- apiGroups: [""]
resources: ["services"]
verbs: ["get","watch","list"]
- apiGroups: [""]
resources: ["pods"]
verbs: ["get","watch","list"]
- apiGroups: ["extensions"]
resources: ["ingresses"]
verbs: ["get","watch","list"]
- apiGroups: [""]
resources: ["nodes"]
verbs: ["list"]
- apiGroups: ["networking.istio.io"]
resources: ["gateways"]
verbs: ["get","watch","list"]
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: external-dns-viewer
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: external-dns
subjects:
- kind: ServiceAccount
name: external-dns
namespace: kube-system
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: external-dns
namespace: kube-system
spec:
strategy:
type: Recreate
template:
metadata:
labels:
app: external-dns
spec:
serviceAccountName: external-dns
containers:
- name: external-dns
image: registry.opensource.zalan.do/teapot/external-dns:latest
args:
- --source=ingress
- --source=istio-gateway
- --domain-filter=xxx
- --policy=upsert-only
- --provider=azure
volumeMounts:
- name: azure-config-file
mountPath: /etc/kubernetes
readOnly: true
volumes:
- name: azure-config-file
secret:
secretName: azuredns-config
正在解析 Istio 网关对象并正在创建 DNS 记录(这发生在不久前,我现在在日志中看不到任何内容)。出于某种原因,入口记录未被解析。我试过添加 --source=service
并使用以下注释服务:external-dns.alpha.kubernetes.io/hostname: my.host.name
,也没有效果。
有什么想法吗?这看起来不错,但不知何故不起作用。 Ingress 工作,cert-manager 创建证书,如果我手动创建 DNS 记录 ingress 工作正常。
我建议 运行ning https://github.com/kubernetes-incubator/external-dns 具有适当的云提供商角色,例如AWS 中的 IAM 角色,允许修改 Route53 记录。
对于 Azure:https://github.com/kubernetes-incubator/external-dns/blob/master/docs/tutorials/azure.md
当你 运行 它时,确保你启用了入口源:https://github.com/helm/charts/blob/master/stable/external-dns/values.yaml#L8-L12
它具有调试日志记录功能,因此您可以准确检查您的记录发生了什么。
问题是由于 nginx-ingress 没有将其 IP 地址发布到入口资源状态字段。 GH 问题:https://github.com/kubernetes-incubator/external-dns/issues/456
--log-level=debug
帮助确定了问题。通过将此添加到 nginx 入口控制器部署来修复:
- --publish-service=kube-system/nginx-ingress-controller
- --update-status