Skip to content

Commit

Permalink
[zh] translation for admin2
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-my committed Sep 27, 2021
1 parent 0297612 commit 864a380
Show file tree
Hide file tree
Showing 7 changed files with 147 additions and 87 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ This document helps you get started using the Kubernetes [NetworkPolicy API](/do
<!--
Make sure you've configured a network provider with network policy support. There are a number of network providers that support NetworkPolicy, including:
* [Antrea](/docs/tasks/administer-cluster/network-policy-provider/antrea-network-policy/)
* [Calico](/docs/tasks/administer-cluster/network-policy-provider/calico-network-policy/)
* [Cilium](/docs/tasks/administer-cluster/network-policy-provider/cilium-network-policy/)
* [Kube-router](/docs/tasks/administer-cluster/network-policy-provider/kube-router-network-policy/)
Expand All @@ -38,6 +39,7 @@ Make sure you've configured a network provider with network policy support. Ther
-->
你首先需要有一个支持网络策略的 Kubernetes 集群。已经有许多支持 NetworkPolicy 的网络提供商,包括:

* [Antrea](/zh/docs/tasks/administer-cluster/network-policy-provider/antrea-network-policy/)
* [Calico](/zh/docs/tasks/administer-cluster/network-policy-provider/calico-network-policy/)
* [Cilium](/zh/docs/tasks/administer-cluster/network-policy-provider/cilium-network-policy/)
* [Kube-router](/zh/docs/tasks/administer-cluster/network-policy-provider/kube-router-network-policy/)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ Host: k8s-master:8080

<!--
Note that Kubernetes does not need to know what a dongle is or what a dongle is for.
The preceding PATCH request just tells Kubernetes that your Node has four things that
The preceding PATCH request tells Kubernetes that your Node has four things that
you call dongles.
Start a proxy, so that you can easily send requests to the Kubernetes API server:
-->
注意:Kubernetes 不需要了解 dongle 资源的含义和用途。
前面的 PATCH 请求仅仅告诉 Kubernetes 你的节点拥有四个你称之为 dongle 的东西。
前面的 PATCH 请求告诉 Kubernetes 你的节点拥有四个你称之为 dongle 的东西。

启动一个代理(proxy),以便你可以很容易地向 Kubernetes API server 发送请求:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,9 @@ Apply the manifest to create a Deployment
应用清单文件来创建 Deployment。
<!--
We have just created a deployment whose replica size is 2 that is running the pod called `snowflake` with a basic container that just serves the hostname.
We have created a deployment whose replica size is 2 that is running the pod called `snowflake` with a basic container that serves the hostname.
-->
我们刚刚创建了一个副本大小为 2 的 Deployment,该 Deployment 运行名为 `snowflake` 的 Pod,
我们创建了一个副本大小为 2 的 Deployment,该 Deployment 运行名为 `snowflake` 的 Pod,
其中包含一个仅提供主机名服务的基本容器。
```shell
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!--
---
title: Use Antrea for NetworkPolicy
content_type: task
weight: 10
---
-->
---
title: 使用 Antrea 提供 NetworkPolicy
content_type: task
weight: 10
---

<!-- overview -->
<!--
This page shows how to install and use Antrea CNI plugin on Kubernetes.
For background on Project Antrea, read the [Introduction to Antrea](https://antrea.io/docs/).
-->
本页展示了如何在 kubernetes 中安装和使用 Antrea CNI 插件。
要了解 Antrea 项目的背景,请阅读 [Antrea 介绍](https://antrea.io/docs/)

## {{% heading "prerequisites" %}}

<!--
You need to have a Kubernetes cluster. Follow the
[kubeadm getting started guide](/docs/reference/setup-tools/kubeadm/) to bootstrap one.
-->
你需要拥有一个 kuernetes 集群。
遵循 [kubeadm 入门指南](/zh/docs/reference/setup-tools/kubeadm/)自行创建一个。

<!-- steps -->

<!--
## Deploying Antrea with kubeadm
Follow [Getting Started](https://github.com/vmware-tanzu/antrea/blob/main/docs/getting-started.md) guide to deploy Antrea for kubeadm.
-->
## 使用 kubeadm 部署 Antrea
遵循[入门](https://github.com/vmware-tanzu/antrea/blob/main/docs/getting-started.md)指南
为 kubeadm 部署 Antrea 。

## {{% heading "whatsnext" %}}

<!--
Once your cluster is running, you can follow the [Declare Network Policy](/docs/tasks/administer-cluster/declare-network-policy/) to try out Kubernetes NetworkPolicy.
-->
一旦你的集群已经运行,你可以遵循
[声明网络策略](/zh/docs/tasks/administer-cluster/declare-network-policy/)
来尝试 Kubernetes NetworkPolicy。
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ Decide whether you want to deploy a [cloud](#creating-a-calico-cluster-with-goog
**先决条件**: [gcloud](https://cloud.google.com/sdk/docs/quickstarts)

<!--
1. To launch a GKE cluster with Calico, just include the `--enable-network-policy` flag.
1. To launch a GKE cluster with Calico, include the `--enable-network-policy` flag.
-->
1. 启动一个带有 Calico 的 GKE 集群,只需加上参数 `--enable-network-policy`
1. 启动一个带有 Calico 的 GKE 集群,需要加上参数 `--enable-network-policy`

**语法**
```shell
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,62 +33,71 @@ For background on Cilium, read the [Introduction to Cilium](https://docs.cilium.
## Deploying Cilium on Minikube for Basic Testing
To get familiar with Cilium easily you can follow the
[Cilium Kubernetes Getting Started Guide](https://docs.cilium.io/en/stable/gettingstarted/minikube/)
[Cilium Kubernetes Getting Started Guide](https://docs.cilium.io/en/stable/gettingstarted/k8s-install-default/)
to perform a basic DaemonSet installation of Cilium in minikube.
To start minikube, minimal version required is >= v1.3.1, run the with the
To start minikube, minimal version required is >= v1.5.2, run the with the
following arguments:
-->
## 在 Minikube 上部署 Cilium 用于基本测试

为了轻松熟悉 Cilium 你可以根据
[Cilium Kubernetes 入门指南](https://docs.cilium.io/en/stable/gettingstarted/minikube/)
[Cilium Kubernetes 入门指南](https://docs.cilium.io/en/stable/gettingstarted/k8s-install-default/s)
在 minikube 中执行一个 cilium 的基本 DaemonSet 安装。

要启动 minikube,需要的最低版本为 1.3.1,使用下面的参数运行:
要启动 minikube,需要的最低版本为 1.5.2,使用下面的参数运行:

```shell
minikube version
```
```
minikube version: v1.3.1
minikube version: v1.5.2
```

```shell
minikube start --network-plugin=cni --memory=4096
```

<!--
Mount the BPF filesystem:
For minikube you can install Cilium using its CLI tool. Cilium will
automatically detect the cluster configuration and will install the appropriate
components for a successful installation:
-->
挂载 BPF 文件系统:
对于 minikube 你可以使用 Cilium 的 CLI 工具安装它。
Cilium 将自动检测集群配置并为成功的集群部署选择合适的组件。

```shell
minikube ssh -- sudo mount bpffs -t bpf /sys/fs/bpf
curl -LO https://github.com/cilium/cilium-cli/releases/latest/download/cilium-linux-amd64.tar.gz
sudo tar xzvfC cilium-linux-amd64.tar.gz /usr/local/bin
rm cilium-linux-amd64.tar.gz
cilium install
```

<!--
For minikube you can deploy this simple ''all-in-one'' YAML file that includes
DaemonSet configurations for Cilium as well as appropriate RBAC settings:
-->
在 minikube 环境中,你可以部署下面的"一体化" YAML 文件,其中包含 Cilium
的 DaemonSet 配置以及适当的 RBAC 配置:


```shell
kubectl create -f https://raw.githubusercontent.com/cilium/cilium/v1.8/install/kubernetes/quick-install.yaml
```

```
configmap/cilium-config created
serviceaccount/cilium created
serviceaccount/cilium-operator created
clusterrole.rbac.authorization.k8s.io/cilium created
clusterrole.rbac.authorization.k8s.io/cilium-operator created
clusterrolebinding.rbac.authorization.k8s.io/cilium created
clusterrolebinding.rbac.authorization.k8s.io/cilium-operator created
daemonset.apps/cilium create
deployment.apps/cilium-operator created
🔮 Auto-detected Kubernetes kind: minikube
✨ Running "minikube" validation checks
✅ Detected minikube version "1.20.0"
ℹ️ Cilium version not set, using default version "v1.10.0"
🔮 Auto-detected cluster name: minikube
🔮 Auto-detected IPAM mode: cluster-pool
🔮 Auto-detected datapath mode: tunnel
🔑 Generating CA...
2021/05/27 02:54:44 [INFO] generate received request
2021/05/27 02:54:44 [INFO] received CSR
2021/05/27 02:54:44 [INFO] generating key: ecdsa-256
2021/05/27 02:54:44 [INFO] encoded CSR
2021/05/27 02:54:44 [INFO] signed certificate with serial number 48713764918856674401136471229482703021230538642
🔑 Generating certificates for Hubble...
2021/05/27 02:54:44 [INFO] generate received request
2021/05/27 02:54:44 [INFO] received CSR
2021/05/27 02:54:44 [INFO] generating key: ecdsa-256
2021/05/27 02:54:44 [INFO] encoded CSR
2021/05/27 02:54:44 [INFO] signed certificate with serial number 3514109734025784310086389188421560613333279574
🚀 Creating Service accounts...
🚀 Creating Cluster roles...
🚀 Creating ConfigMap...
🚀 Creating Agent DaemonSet...
🚀 Creating Operator Deployment...
⌛ Waiting for Cilium to be installed...
```

<!--
Expand Down Expand Up @@ -126,15 +135,15 @@ this list of Pods run:
部署使用 Cilium 的集群会添加 Pods 到 `kube-system` 命名空间。要查看 Pod 列表,运行:

```shell
kubectl get pods --namespace=kube-system
kubectl get pods --namespace=kube-system -l k8s-app=cilium
```

<!-- You'll see a list of Pods similar to this: -->
你将看到像这样的 Pods 列表:

```console
NAME READY STATUS RESTARTS AGE
cilium-6rxbd 1/1 Running 0 1m
NAME READY STATUS RESTARTS AGE
cilium-kkdhz 1/1 Running 0 3m23s
...
```

Expand Down
Loading

0 comments on commit 864a380

Please sign in to comment.