代码拉取完成,页面将自动刷新
package approuter
import (
"context"
"github.com/rancher/types/config"
)
// This controller is responsible for watching all the ingress resources in the cluster and creates the following DNS entries
// in <rancher_root_domain>:
// <$ingress_name>.<$namespace>.<$cluster_id>.<rancher_root_domain> => [ingress IPs]
// When an ingress resource has more than 10 IPs, only 10 IPs will be returned by DNS.
// In an RKE cluster, when a node becomes unhealthy and the corresponding nginx ingress resource becomes unavailable,
// the dynamic DNS controller updates the DNS mapping to remove that node IP from the list.
// Every once in a while (default 24h), the dynamic DNS controller will call renew to update the expiration time
func Register(ctx context.Context, cluster *config.UserContext) {
secrets := cluster.Management.Core.Secrets("")
secretLister := cluster.Management.Core.Secrets("").Controller().Lister()
workload := cluster.UserOnlyContext()
c := &Controller{
ingressInterface: workload.Extensions.Ingresses(""),
ingressLister: workload.Extensions.Ingresses("").Controller().Lister(),
dnsClient: NewClient(secrets, secretLister, workload.ClusterName),
clusterName: workload.ClusterName,
managementSecretLister: secretLister,
}
workload.Extensions.Ingresses("").AddHandler(ctx, "approuterController", c.sync)
go c.renew(ctx)
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。