如何使用ExternalDNS从DigitalOcean Kubernetes自动管理DNS记录

介绍 (Introduction)

When deploying web apps to Kubernetes, you usually use Services and Ingresses to expose apps beyond the cluster at your desired domain. This involves manually configuring not only the Ingress, but also the DNS records at your provider, which can be a time-consuming and error-prone process. This can become an obstacle as your application grows in complexity; when the external IP changes, it is necessary to update the DNS records accordingly.

将Web应用程序部署到Kubernetes时,通常使用服务和入口在所需域中将应用程序公开到群集之外。 这不仅需要在供应商处手动配置Ingress,还需要手动配置DNS记录,这可能是一个耗时且容易出错的过程。 随着应用程序复杂性的增加,这可能成为障碍。 当外部IP更改时,有必要相应地更新DNS记录。

To overcome this, the Kubernetes sig-network team created ExternalDNS for the purpose of automatically managing external DNS records from within a Kubernetes cluster. Once deployed, ExternalDNS works in the background and requires almost no additional configuration. Whenever a Service or Ingress is created or changed, ExternalDNS will update the records right away.

为了克服这个问题, Kubernetes sig-network团队创建了ExternalDNS ,目的是从Kubernetes集群中自动管理外部DNS记录。 部署后,ExternalDNS在后台运行,几乎不需要其他配置。 每当创建或更改服务或入口时,ExternalDNS都会立即更新记录。

In this tutorial, you will install ExternalDNS to your DigitalOcean Kubernetes cluster via Helm and configure it to use DigitalOcean as your DNS provider. Then, you will deploy a sample web app with an Ingress and use ExternalDNS to point it to your domain name. In the end, you will have an automated DNS record managing system in place for both Services and Ingresses.

在本教程中,您将通过Helm将ExternalDNS安装到DigitalOcean Kubernetes群集,并将其配置为使用DigitalOcean作为您的DNS提供程序。 然后,您将部署一个带有Ingress的示例Web应用程序,并使用ExternalDNS将其指向您的域名。 最后,您将拥有针对服务和入口的自动DNS记录管理系统。

先决条件 (Prerequisites)

  • A DigitalOcean Kubernetes cluster with your connection configured as the kubectl default. Instructions on how to configure kubectl are shown under the Connect to your Cluster step when you create your cluster. To create a Kubernetes cluster on DigitalOcean, see Kubernetes Quickstart.

    一个DigitalOcean Kubernetes集群,其连接配置为kubectl默认。 创建集群时,“如何连接到集群”步骤下会显示有关如何配置kubectl说明。 要在DigitalOcean上创建Kubernetes集群,请参阅Kubernetes Quickstart

  • The Helm package manager installed on your local machine, and Tiller installed on your cluster. To do this, complete Steps 1 and 2 of the How To Install Software on Kubernetes Clusters with the Helm Package Manager tutorial.

    在本地计算机上安装了Helm软件包管理器,在集群上安装了Tiller。 为此,请使用Helm Package Manager教程完成如何在Kubernetes群集上安装软件的步骤1和2。

  • The Nginx Ingress Controller installed on your cluster using Helm in order to use ExternalDNS with Ingress Resources. To do this, follow How to Set Up an Nginx Ingress on DigitalOcean Kubernetes Using Helm. You’ll need to set the publishService property to true as per the instructions in Step 2.

    使用Helm在群集上安装的Nginx Ingress Controller可以将ExternalDNS与Ingress资源一起使用。 为此,请遵循

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值