ecs和eks 比较
As the creator of Foo, a platform for website quality monitoring, I recently endeavored in a migration to Kubernetes and EKS (an AWS service).
作为网站质量监控平台Foo的创建者,我最近努力迁移到Kubernetes和EKS(一种AWS服务)。
Kubernetes provides a robust level of DNS support. Luckily for us, within a cluster, we can reference pods by host name as defined in a spec.
Kubernetes提供了强大的DNS支持级别。 对我们来说幸运的是,在集群中,我们可以按规范中定义的主机名引用Pod。
But what if we want to expose an app to the outside world as a website under a static domain? I thought this would be a common, well documented case, but boy was I wrong.
但是,如果我们想将应用程序作为静态站点下的网站公开给外界,该怎么办? 我以为这是一个常见且有据可查的案例,但是男孩我错了。
Assume a Service named
foo
in the Kubernetes namespacebar
. A Pod running in namespacebar
can look up this service by simply doing a DNS query forfoo
. A Pod running in namespacequux
can look up this service by doing a DNS query forfoo.bar
~ DNS for Services and Pods - Kubernetes在Kubernetes命名空间
bar
假设一个名为foo
的服务。 在名称空间bar
运行的Pod可以通过对foo
进行DNS查询来查找此服务。 在命名空间quux
运行的Pod可以通过对foo.bar
进行DNS查询来查找此服务〜 服务和foo.bar
DNS-Kubernetes
Yes, that's great ❤️ But this still leads to many unsolved mysteries. Let's take this one step at a time shall we?! This post will address the following items.
是的,太好了❤️但这仍然导致许多未解之谜。 让我们一次迈出这一步吧? 这篇文章将解决以下问题。
How to define services
如何定义服务
How to expose multiple services under one NGINX server. No fancy schmancy "Ingress" needed 🙌
如何在一台NGINX服务器下公开多种服务 。 无需花哨的“ Ingress ” 🙌
How to create an external DNS and connect to a domain you've acquired through any qualified registry like GoDaddy or Google Domains, for example. We'll use Route 53 and ExternalDNS to do the heavy lifting.
例如,如何创建外部DNS并连接到通过任何合格的注册表(例如GoDaddy或Google Domains)获得的域。 我们将使用Route 53和ExternalDNS进行繁重的工作。
This post assumes a setup with EKS and eksctl
as documented in "Getting started with eksctl
", but many of the concepts and examples in this post could be applicable in a variety of configurations.
这篇文章假定使用“ eksctl
入门 ”中介绍的EKS和eksctl
进行设置,但是本文中的许多概念和示例可能适用于各种配置。