Files
website/content/zh/docs/tasks/access-application-cluster/configure-cloud-provider-firewall.md
Zach Corleissen abcee2dccd Update localization guidelines (#10485)
* Update localization guidelines for language labels

Continuing work

Continuing work

Continuing work

More work in progress

Add local OWNERS folders

Add an OWNERS file to Chinese

Remove shortcode for repos

Add Japanese

Alphabetize languages, change weights accordingly

More updates

Add Korean in Korean

Add English to languageName

Feedback from gochist

Move Chinese content from cn/ to zh/

Move OWNERS from cn/ to zh/

Resolve merge conflicts by updating from master

Add files back in to prep for resolution

After rebase on upstream/master, remove files

Review and update localization guidelines

Feedback from gochist, tnir, cstoku

Add a trailing newline to content/ja/OWNERS

Add a trailing newline to content/zh/OWNERS

Drop requirement for GH repo project

Clarify language about forks/branches

Edits and typos

Remove a shortcode specific to a multi-repo language setup

Update aliases and owners

Add explicit OWNERS for content/en

Migrate content from Chinese repo, update regex in config.toml

Remove untranslated strings

Add trailing newline to content/en/OWNERS

Add trailing newlines to OWNERS files

add Jaguar project description (#10433)

* add Jaguar project description

[Jaguar](https://gitlab.com/sdnlab/jaguar) is an open source solution for Kubernetes's network based on OpenDaylight.
Jaguar provides overlay network using vxlan and Jaguar CNIPlugin provides one IP address per pod.

* Minor newline tweak

blog post for azure vmss (#10538)

Add microk8s to pick-right-solution.md (#10542)

* Add microk8s to pick-right-solution.md

Microk8s is a single-command installation of upstream Kubernetes on any Linux and should be included in the list of local-machine solutions.

* capitalized Istio

Add microk8s to foundational.md (#10543)

* Add microk8s to foundational.md

Adding microk8s as credible and stable alternative to get started with Kubernetes on a local machine. This is especially attractive for those not wanting to incur the overhead of running a VM for a local cluster.

* Update foundational.md

Thank you for your suggestions! LMK if this works now?

* Rewrote first paragraph

And included a bullet list of features of microk8s

* Copyedit

fix typo (#10545)

Fix the kubectl subcommands links. (#10550)

Signed-off-by: William Zhang <warmchang@outlook.com>

Fix command issue (#10515)

Signed-off-by: mooncake <xcoder@tenxcloud.com>

remove imported community files per issue 10184 (#10501)

networking.md: Markdown fix (#10498)

Fix front matter, federation command-line tools (#10500)

Clean up glossary entry (#10399)

update slack link (#10536)

typo in StatefulSet docs (#10558)

fix discription about horizontal pod autoscale (#10557)

Remove redundant symbols (#10556)

Fix issue #10520 (#10554)

Signed-off-by: William Zhang <warmchang@outlook.com>

Update api-concepts.md (#10534)

Revert "Fix command issue (#10515)"

This reverts commit c02a7fb9f9.

Update memory-constraint-namespace.md (#10530)

update memory request to 100MiB corresponding the yaml content

Blog: Introducing Volume Snapshot Alpha for Kubernetes (#10562)

* blog post for azure vmss

* snapshot blog post

Resolve merge conflicts in OWNERS*

Minor typo fix (#10567)

Not sure what's supposed to be here, proposing removing it.

* Feedback from gochist

Tweaks to feedback

* Feedback from ClaudiaJKang
2018-10-12 14:25:01 -07:00

3.3 KiB
Raw Permalink Blame History

approvers, title
approvers title
bprashanth
davidopp
配置你的云平台防火墙

许多云服务商(比如 Google Compute Engine)定义防火墙以防止服务无意间暴露到 internet 上。 当暴露服务给外网时,你可能需要在防火墙上开启一个或者更多的端口来支持服务。 本文描述了这个过程,以及其他云服务商的具体信息。

负载均衡(LoadBalancer)服务的访问限制

当以 spec.type: LoadBalancer 使用服务时,你可以使用 spec.loadBalancerSourceRanges 指定允许访问负载均衡的 IP 段。 这个字段采用 CIDR 的 IP 段,Kubernetes 会使用这个段配置防火墙。支持这个功能的平台目前有 Google Compute EngineGoogle Kubernetes Engine 和 AWS。 如果云服务商不支持这个功能,这个字段会被忽略。

假设 10.0.0.0/8 是内部的子网。在下面这个例子中,会创建一个只有集群内部 ip 可以访问的负载均衡器。 集群外部的客户端是无法访问这个负载均衡器的。

apiVersion: v1
kind: Service
metadata:
  name: myapp
spec:
  ports:
    - port: 8765
      targetPort: 9376
  selector:
    app: example
  type: LoadBalancer
  loadBalancerSourceRanges:
  - 10.0.0.0/8

这个例子中,会创建一个只能被 IP 为 130.211.204.1 和 130.211.204.2 的客户端访问的负载据衡器。

apiVersion: v1
kind: Service
metadata:
  name: myapp
spec:
  ports:
    - port: 8765
      targetPort: 9376
  selector:
    app: example
  type: LoadBalancer
  loadBalancerSourceRanges:
  - 130.211.204.1/32
  - 130.211.204.2/32

谷歌计算引擎(Google Compute Engine

当以 spec.type: LoadBalancer 使用服务时,防火墙会被自动打开。 然而,当以 spec.type: NodePort 使用服务时,防火墙默认 不会 被打开。

Google Compute Engine 的防火墙文档在别处

你可以使用 gcloud 命令行工具添加一个防火墙:

$ gcloud compute firewall-rules create my-rule --allow=tcp:<port>

注意 使用 Google Compute Engine 平台的防火墙时有一个重要的关于安全的注意点:

在 Kubernetes v1.0.0 版本,GCE 防火墙是定义按虚拟机(VM)来的,而不是按 ip 来的。 这就意味着当你在防火墙上打开一个服务端口时,任何在那台虚拟机 IP 上的同一端口的服务 都有被外部访问的潜在可能。注意,这对于其他 Kubernetes 服务来说不是问题,因为他们监 听的 IP 地址与主机节点的外部 IP 地址不同。

考虑一下:

  • 你创建了一个服务,使用了外部服务均衡 (IP 地址为 1.2.3.4) 和 80 端口。
  • 你在防火墙上为集群的所有节点都打开了 80 端口,所以外部的服务可以向你的 服务发送数据包。
  • 你又在虚拟机(IP 为2.3.4.5)上使用 80 端口启动了一台 nginx 服务器. 这个 nginx 在虚拟机的外部 IP 地址上也被暴露到了 internet 上。

因此,在 Google Compute Engine 或者 Google Kubernetes Engine 上开启防火墙端口时请 小心。你可能无意间把其他服务也暴露给了 internet。

这个问题会在 Kubernetes 后续版本中被修复。

其他云服务商

即将更新