[zh] translation for admin2

This commit is contained in:
Steven Yan
2021-09-26 10:59:27 +08:00
parent 0297612be4
commit 864a3808b8
7 changed files with 147 additions and 87 deletions
@@ -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。
@@ -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
@@ -33,25 +33,25 @@ 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
@@ -59,36 +59,45 @@ 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...
```
<!--
@@ -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
...
```