Skip to content

Commit 479d855

Browse files
authored
Merge pull request #13 from mohuani/main
feat: correcting the spelling and translating english doc
2 parents 679d895 + ff54092 commit 479d855

3 files changed

Lines changed: 115 additions & 3 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
k8s 作为云原生时代的操作系统,学习它的必要性不言而喻,如果你遇到了任何问题,可以在 [Discussions](https://github.com/guangzhengli/k8s-tutorials/discussions) 中评论或者 Issue 中提出,如果你觉得这个仓库对你有价值,欢迎 star 或者提 PR / Issue,让它变得更好!
88

9-
在学习本教程前,需要注意本教程侧重于实战引导,以渐进式修改代码的方式,将从最基础的 container 容器的定义开始,经过 `pod`, `deployment`, `servcie`, `ingress`, `configmap`, `secret` 等资源直到用 `helm` 来打包部署一套完整服务。所以如果你对容器和 k8s 的基础理论知识不甚了解的话,建议先从 [官网文档](https://kubernetes.io/zh-cn/docs/home/) 或者其它教程获取基础理论知识,再通过实战加深对知识的掌握!
9+
在学习本教程前,需要注意本教程侧重于实战引导,以渐进式修改代码的方式,将从最基础的 container 容器的定义开始,经过 `pod`, `deployment`, `service`, `ingress`, `configmap`, `secret` 等资源直到用 `helm` 来打包部署一套完整服务。所以如果你对容器和 k8s 的基础理论知识不甚了解的话,建议先从 [官网文档](https://kubernetes.io/zh-cn/docs/home/) 或者其它教程获取基础理论知识,再通过实战加深对知识的掌握!
1010

1111
这里是文档的索引:
1212
* [准备工作](docs/pre.md)
@@ -976,7 +976,7 @@ spec:
976976
nodePort: 30000
977977
```
978978

979-
创建 `service-hellok8s-nodeport` Servcie 后,使用 `curl` 命令或者浏览器访问 `http://192.168.59.100:30000` 可以得到结果。
979+
创建 `service-hellok8s-nodeport` Service 后,使用 `curl` 命令或者浏览器访问 `http://192.168.59.100:30000` 可以得到结果。
980980

981981
```shell
982982
kubectl apply -f service-hellok8s-nodeport.yaml

README_EN.md

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
<h1 align=center>Kubernetes Tutorials | k8s 教程</h1>
2+
3+
[![GitHub forks](https://img.shields.io/github/forks/guangzhengli/k8s-tutorials)](https://github.com/guangzhengli/k8s-tutorials/network)[![GitHub stars](https://img.shields.io/github/stars/guangzhengli/k8s-tutorials)](https://github.com/guangzhengli/k8s-tutorials/stargazers)[![GitHub issues](https://img.shields.io/github/issues/guangzhengli/k8s-tutorials)](https://github.com/guangzhengli/k8s-tutorials/issues)[![GitHub license](https://img.shields.io/github/license/guangzhengli/k8s-tutorials)](https://github.com/guangzhengli/k8s-tutorials/blob/main/LICENSE)
4+
5+
<h4 align=center>🌈 Kubernetes | 📰 Tutorials</h4>
6+
7+
K8s as a cloud-native operating system, the need to learn it speaks for itself, if you encounter any problems, you can comment in [Discussions]((https://github.com/guangzhengli/k8s-tutorials/discussions)) or Issue, if you think this repository is valuable to you, welcome to star or raise PR / Issue to make it better!
8+
9+
Before learning this tutorial, you need to note that this tutorial focuses on practical guidance to modify the code in an incremental way, starting from the most basic container definition, through `pod`, `deployment`, `service`, `ingress`, `configmap`, `secret` and other resources until the `helm` to packaged deployment of a complete set of services. So if you don't know much about the basics of containers and k8s, it is recommended to get the basic theoretical knowledge from the [official documentation]((https://kubernetes.io/docs/home/)) or other tutorials first, and then deepen your mastery of the knowledge through real-life practice!
10+
11+
Here is the index of this document:
12+
* [Preparation](docs/pre.md)
13+
* [container](docs/container.md)
14+
* [pod](docs/pod.md)
15+
* [deployment](docs/deployment.md)
16+
* [service](docs/service.md)
17+
* [ingress](docs/ingress.md)
18+
* [namespace](docs/namespace.md)
19+
* [configmap](docs/configmap.md)
20+
* [secret](docs/secret.md)
21+
* [job/cronjob](docs/job.md)
22+
* [helm](docs/helm.md)
23+
* [dashboard](docs/dashboard.md)
24+
* Translate English(unfinished)
25+
26+
# kubernetes tutorials
27+
28+
## Preparation
29+
30+
Before starting this tutorial, you need to configure your local environment. Here are the dependencies and packages that need to be installed.
31+
32+
### Install docker
33+
34+
First we need to install `docker` to package the image, if you already have `docker` installed locally, then you can choose to skip this section.
35+
36+
#### Recommended installation method
37+
38+
The easiest way to install docker is to use [Docker Desktop](https://www.docker.com/products/docker-desktop/) currently, just open the official website and download the package that corresponds to your computer's operating system (https://www.docker.com/products/docker-desktop/)
39+
40+
When the installation is complete, you can quickly verify that the installation was successful by using `docker run hello-world`!
41+
42+
#### Other installation methods
43+
44+
Currently, Docker has announced that [Docker Desktop](https://www.docker.com/products/docker-desktop/) is only free for individual developers or small groups (no longer free for large companies from 2021), so if you can't install `docker` via [Docker Desktop](https://www.docker.com/products/docker-desktop/), you can refer to [this article](https://dhwaneetbhatt.com/blog/run-docker-) to download and install `docker`. without-docker-desktop-on-macos) to install only the [Docker CLI](https://github.com/docker/cli).
45+
46+
### Install minikube
47+
48+
We also need to build a local cluster of k8s (either using a cloud vendor or another k8s cluster). The recommended way to build a local k8s cluster is to use [minikube](https://minikube.sigs.k8s.io/docs/).
49+
50+
You can download and install according to [minikube quick install](https://minikube.sigs.k8s.io/docs/start/), here is a brief list of MacOS installation, Linux & Windows OS can refer to [official documentation](https://minikube.sigs.k8s.io/docs/start/) for a quick installation.
51+
52+
```shell
53+
brew install minikube
54+
```
55+
56+
#### Start minikube
57+
58+
Because minikube supports many containers and virtualization technologies ([Docker](https://minikube.sigs.k8s.io/docs/drivers/docker/), [Hyperkit](https://minikube.sigs.k8s.io/docs/drivers/hyperkit/), [Hyper-V](https://minikube.sigs.k8s.io/docs/drivers/hyperv/), [KVM](https://minikube.sigs.k8s.io/docs/drivers/kvm2/), [Parallels](https://minikube.sigs.k8s.io/docs/drivers/parallels/), [Podman](https://minikube.sigs.k8s.io/docs/drivers/podman/), [VirtualBox](https://minikube.sigs.k8s.io/docs/drivers/virtualbox/), or [VMware Fusion/Workstation](https://minikube.sigs.k8s.io/docs/drivers/vmware/)), is also the place where the problem appears more often, so it is better to explain it here a little.
59+
60+
If you are using the `docker` solution recommended above [Docker Desktop](https://www.docker.com/products/docker-desktop/), then you can start minikube with the following command and wait patiently for the dependencies to download.
61+
62+
```shell
63+
minikube start --vm-driver docker --container-runtime=docker
64+
```
65+
66+
When you're done, run `minikube status` to check the current status to make sure it started successfully!
67+
68+
If you only have the Docker CLI locally, and the criterion is that if you execute a command like `docker ps` and it returns the error `Cannot connect to the Docker daemon at unix:///Users/xxxx/.colima/docker.sock. daemon running?` Then you need to run the following command.
69+
70+
```shell
71+
brew install hyperkit
72+
minikube start --vm-driver hyperkit --container-runtime=docker
73+
74+
# Tell Docker CLI to talk to minikube's VM
75+
eval $(minikube docker-env)
76+
77+
# Save IP to a hostname
78+
echo "`minikube ip` docker.local" | sudo tee -a /etc/hosts > /dev/null
79+
80+
# Test
81+
docker run hello-world
82+
```
83+
84+
**minikube command quick search**
85+
86+
`minikube stop` Does not delete any data, just stops the VM and k8s cluster.
87+
88+
`minikube delete` Delete all minikube data after startup.
89+
90+
`minikube ip` View the IP address where the cluster and docker engine are running.
91+
92+
`minikube pause` Suspend current resources and k8s clusters
93+
94+
`minikube status` View current cluster status
95+
96+
### Install kubectl
97+
98+
This step is optional, if not installed, all subsequent `kubectl` related commands will be replaced by the `minikube kubectl` command.
99+
100+
If you don't want to use `minikube kubectl` or configure the relevant environment variables for the following tutorial, you can consider installing `kubectl` directly.
101+
102+
```shell
103+
brew install kubectl
104+
```
105+
106+
### Register a docker hub account to log in
107+
108+
Since the default image address used by minikube is DockerHub, we also need to register an account in DockerHub (https://hub.docker.com/) and log in to the account using the login command.
109+
110+
```shell
111+
docker login
112+
```

docs/service.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ spec:
176176
nodePort: 30000
177177
```
178178

179-
创建 `service-hellok8s-nodeport` Servcie 后,使用 `curl` 命令或者浏览器访问 `http://192.168.59.100:30000` 可以得到结果。
179+
创建 `service-hellok8s-nodeport` Service 后,使用 `curl` 命令或者浏览器访问 `http://192.168.59.100:30000` 可以得到结果。
180180

181181
```shell
182182
kubectl apply -f service-hellok8s-nodeport.yaml

0 commit comments

Comments
 (0)