-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from pwnsky/dev
更新文档&脚本
- Loading branch information
Showing
6 changed files
with
137 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
# kubernetes | ||
|
||
## 环境搭建 | ||
|
||
本次k8s集群采用kind来进行搭建。 | ||
|
||
需要预先安装 go, docker | ||
|
||
|
||
|
||
k8s学习: | ||
|
||
doc: https://k8s.easydoc.net | ||
|
||
bilibili: https://www.bilibili.com/video/BV1Tg411P7EB/ | ||
|
||
zhihu: https://zhuanlan.zhihu.com/p/616621837 | ||
|
||
|
||
|
||
|
||
|
||
### Linux | ||
|
||
#### kind | ||
|
||
ref: https://kind.sigs.k8s.io/ | ||
|
||
设置 go 代理 | ||
|
||
``` | ||
echo "export GO111MODULE=on" >> ~/.profile | ||
echo "export GOPROXY=https://goproxy.cn" >> ~/.profile | ||
source ~/.profile | ||
``` | ||
|
||
设置path | ||
|
||
``` | ||
echo "export PATH=$PATH:~/go/bin" >> ~/.profile | ||
source ~/.profile | ||
``` | ||
|
||
下载kind | ||
|
||
``` | ||
go install sigs.k8s.io/[email protected] && kind create cluster | ||
``` | ||
|
||
|
||
|
||
### Windows | ||
|
||
#### kind | ||
|
||
ref: https://kind.sigs.k8s.io/ | ||
|
||
设置go代理 | ||
|
||
``` | ||
SETX GO111MODULE on | ||
go env -w GOPROXY=https://goproxy.cn,direct | ||
SETX GOPROXY https://goproxy.cn,direct | ||
``` | ||
|
||
下载kind | ||
|
||
``` | ||
go install sigs.k8s.io/[email protected] | ||
``` | ||
|
||
增加c:/Users/{user}/go/bin路径到环境变量 | ||
|
||
``` | ||
kind create cluster | ||
``` | ||
|
||
#### kubectl | ||
|
||
ref: https://kubernetes.io/docs/tasks/tools/install-kubectl-windows/ | ||
|
||
``` | ||
curl.exe -LO "https://dl.k8s.io/release/v1.28.1/bin/windows/amd64/kubectl.exe" | ||
``` | ||
|
||
下载好后,移动到环境变量中的目录里,这里可以移动到 ~/go/bin | ||
|
||
查看pods | ||
|
||
``` | ||
kubectl get pods | ||
``` | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters