diff --git a/README.md b/README.md
index b5ecb064..261c9bac 100644
--- a/README.md
+++ b/README.md
@@ -11,7 +11,9 @@
> - [Linux 学习笔记](https://www.huweihuang.com/linux-notes/)
> - [数据结构学习笔记](https://www.huweihuang.com/data-structure-notes/)
>
-> 个人博客:[www.huweihuang.com](https://www.huweihuang.com/)
+> 个人博客:
+> - [www.huweihuang.com](https://www.huweihuang.com/)
+> - [k8s.huweihuang.com](https://k8s.huweihuang.com/)
---
@@ -22,23 +24,23 @@
## 安装与配置
-- [部署k8s集群]()
- - [使用kubeadm安装生产环境kubernetes](setup/install-k8s-by-kubeadm.md)
- - [使用kubespray安装kubernetes](setup/install-k8s-by-kubespray.md)
- - [使用minikube安装kubernetes](setup/install-k8s-by-minikube.md)
- - [使用kind安装kubernetes](setup/install-k8s-by-kind.md)
+- [部署k8s集群](setup/installer/README.md)
+ - [使用kubeadm安装生产环境kubernetes](setup/installer/install-k8s-by-kubeadm.md)
+ - [使用kubespray安装kubernetes](setup/installer/install-k8s-by-kubespray.md)
+ - [使用minikube安装kubernetes](setup/installer/install-k8s-by-minikube.md)
+ - [使用kind安装kubernetes](setup/installer/install-k8s-by-kind.md)
- [k8s证书及秘钥](setup/k8s-cert.md)
- [k8s版本说明](setup/k8s-version-release.md)
## 基本概念
-- [kubernetes架构]()
+- [kubernetes架构](concepts/architecture/README.md)
- [Kubernetes总架构图](concepts/architecture/kubernetes-architecture.md)
- [基于Docker及Kubernetes技术构建容器云(PaaS)平台概述](concepts/architecture/paas-based-on-docker-and-kubernetes.md)
-- [kubernetes对象]()
+- [kubernetes对象](concepts/object/README.md)
- [理解kubernetes对象](concepts/object/understanding-kubernetes-objects.md)
- [kubernetes常用对象说明](concepts/object/kubernetes-basic-concepts.md)
-- [Pod]()
+- [Pod](concepts/pod/README.md)
- [Pod介绍](concepts/pod/pod.md)
- [Pod定义文件](concepts/pod/pod-definition.md)
- [Pod生命周期](concepts/pod/pod-lifecycle.md)
@@ -46,18 +48,18 @@
- [Pod存储卷](concepts/pod/pod-volume.md)
- [Pod控制器](concepts/pod/pod-scheduler.md)
- [Pod伸缩与升级](concepts/pod/pod-operation.md)
-- [配置]()
- - [ConfigMap](concepts/pod/pod-configmap.md)
-- [Workload]()
+- [配置](concepts/configmap/README.md)
+ - [ConfigMap](concepts/configmap/pod-configmap.md)
+- [Workload](concepts/README.md)
## 核心原理
-- [核心组件]()
+- [核心组件](principle/README.md)
- [Api Server](principle/kubernetes-core-principle-api-server.md)
- [Controller Manager](principle/kubernetes-core-principle-controller-manager.md)
- [Scheduler](principle/kubernetes-core-principle-scheduler.md)
- [Kubelet](principle/kubernetes-core-principle-kubelet.md)
-- [流程图]()
+- [流程图](principle/flow/README.md)
- [Pod创建流程](principle/flow/pod-flow.md)
- [PVC创建流程](principle/flow/pvc-flow.md)
@@ -65,25 +67,25 @@
- [Docker网络](network/docker-network.md)
- [K8S网络](network/kubernetes-network.md)
-- [网络插件]()
+- [网络插件](network/flannel/README.md)
- [Flannel介绍](network/flannel/flannel-introduction.md)
-- [CNI]()
+- [CNI](network/cni/README.md)
- [CNI接口介绍](network/cni/cni.md)
- [Macvlan介绍](network/cni/macvlan.md)
## 容器存储
-- [存储卷概念]()
- - [Volume](storage/volume.md)
- - [Persistent Volume](storage/persistent-volume.md)
- - [Persistent Volume Claim](storage/persistent-volume-claim.md)
- - [Storage Class](storage/storage-class.md)
- - [Dynamic Volume Provisioning](storage/dynamic-provisioning.md)
-- [CSI]()
- - [csi-cephfs-plugin](csi/ceph/csi-cephfs-plugin.md)
- - [部署csi-cephfs](csi/ceph/deploy-csi-cephfs.md)
- - [部署cephfs-provisioner](csi/provisioner/cephfs-provisioner.md)
- - [FlexVolume介绍](csi/flexvolume.md)
+- [存储卷概念](storage/volume/README.md)
+ - [Volume](storage/volume/volume.md)
+ - [Persistent Volume](storage/volume/persistent-volume.md)
+ - [Persistent Volume Claim](storage/volume/persistent-volume-claim.md)
+ - [Storage Class](storage/volume/storage-class.md)
+ - [Dynamic Volume Provisioning](storage/volume/dynamic-provisioning.md)
+- [CSI](storage/csi/README.md)
+ - [csi-cephfs-plugin](storage/csi/ceph/csi-cephfs-plugin.md)
+ - [部署csi-cephfs](storage/csi/ceph/deploy-csi-cephfs.md)
+ - [部署cephfs-provisioner](storage/csi/provisioner/cephfs-provisioner.md)
+ - [FlexVolume介绍](storage/csi/flexvolume.md)
## 资源隔离
@@ -94,30 +96,30 @@
## 运维指南
-- [kubectl工具]()
- - [kubectl安装与配置](operation/install-kubectl.md)
- - [kubectl命令说明](operation/kubectl-commands.md)
- - [kubectl命令别名](operation/kubectl-alias.md)
+- [kubectl工具](operation/kubectl/README.md)
+ - [kubectl安装与配置](operation/kubectl/install-kubectl.md)
+ - [kubectl命令说明](operation/kubectl/kubectl-commands.md)
+ - [kubectl命令别名](operation/kubectl/kubectl-alias.md)
- [kubernetes集群问题排查](operation/kubernetes-troubleshooting.md)
-- [节点调度]()
- - [安全迁移节点](operation/safely-drain-node.md)
- - [指定Node调度与隔离](operation/nodeselector-and-taint.md)
-- [镜像仓库配置]()
+- [节点调度](operation/node/README.md)
+ - [安全迁移节点](operation/node/safely-drain-node.md)
+ - [指定Node调度与隔离](operation/node/nodeselector-and-taint.md)
+- [镜像仓库配置](operation/registry/README.md)
- [配置私有的镜像仓库](operation/registry/config-private-registry.md)
- [拉取私有镜像](operation/registry/ImagePullSecrets.md)
## 开发指南
- [client-go的使用及源码分析](develop/client-go.md)
-- [CSI插件开发]()
+- [CSI插件开发](develop/README.md)
- [nfs-client-provisioner源码分析](develop/nfs-client-provisioner.md)
- [csi-provisioner源码分析](develop/csi-provisioner.md)
-- [operator开发]()
+- [operator开发](develop/operator/README.md)
- [kubebuilder的使用](develop/operator/kubebuilder.md)
## 问题排查
-- [节点相关问题]()
+- [节点相关问题](trouble-shooting/node/README.md)
- [keycreate permission denied](trouble-shooting/node/keycreate-permission-denied.md)
- [Cgroup不支持pid资源](trouble-shooting/node/cgroup-pid-error.md)
- [Cgroup子系统无法挂载](trouble-shooting/node/cgroup-subsystem-not-mount.md)
@@ -130,48 +132,40 @@
## 源码分析
- [Kubernetes源码分析笔记](code-analysis/code-analysis-notes.md)
-
-- [kubelet]()
-
+- [kubelet](code-analysis/kubelet/README.md)
- [NewKubeletCommand](code-analysis/kubelet/NewKubeletCommand.md)
- [NewMainKubelet](code-analysis/kubelet/NewMainKubelet.md)
- [startKubelet](code-analysis/kubelet/startKubelet.md)
- [syncLoopIteration](code-analysis/kubelet/syncLoopIteration.md)
- [syncPod](code-analysis/kubelet/syncPod.md)
-
-- [kube-controller-manager]()
-
+- [kube-controller-manager](code-analysis/kube-controller-manager/README.md)
- [NewControllerManagerCommand](code-analysis/kube-controller-manager/NewControllerManagerCommand.md)
- [DeploymentController](code-analysis/kube-controller-manager/deployment-controller.md)
- [Informer机制](code-analysis/kube-controller-manager/sharedIndexInformer.md)
-
-- [kube-scheduler]()
-
+- [kube-scheduler](code-analysis/kube-scheduler/README.md)
- [NewSchedulerCommand](code-analysis/kube-scheduler/NewSchedulerCommand.md)
- [registerAlgorithmProvider](code-analysis/kube-scheduler/registerAlgorithmProvider.md)
- [scheduleOne](code-analysis/kube-scheduler/scheduleOne.md)
- [findNodesThatFit](code-analysis/kube-scheduler/findNodesThatFit.md)
- [PrioritizeNodes](code-analysis/kube-scheduler/PrioritizeNodes.md)
- [preempt](code-analysis/kube-scheduler/preempt.md)
-
-- [kube-apiserver]()
-
+- [kube-apiserver](code-analysis/kube-apiserver/README.md)
- [NewAPIServerCommand](code-analysis/kube-apiserver/NewAPIServerCommand.md)
----
## Runtime
-- [Runtime]()
+- [Runtime](runtime/README.md)
- [Runc和Containerd概述](runtime/runtime.md)
-- [Containerd]()
+- [Containerd](runtime/containerd/README.md)
- [安装Containerd](runtime/containerd/install-containerd.md)
-- [Docker]()
+- [Docker](docker/README.md)
- [Docker学习笔记](docker/docker-notes.md)
-- [Kata Container]()
+- [Kata Container](runtime/kata/README.md)
- [kata容器简介](runtime/kata/kata-container.md)
- [kata配置](runtime/kata/kata-container-conf.md)
-- [GPU]()
+- [GPU](gpu/README.md)
- [nvidia-device-plugin介绍](gpu/nvidia-device-plugin.md)
## Etcd
@@ -180,36 +174,32 @@
- [Raft算法](etcd/raft.md)
- [Etcd启动配置参数](etcd/etcd-setup-flags.md)
- [Etcd访问控制](etcd/etcd-auth-and-security.md)
-- [etcdctl命令工具]()
- - [etcdctl命令工具-V3](etcd/etcdctl-v3.md)
- - [etcdctl命令工具-V2](etcd/etcdctl-v2.md)
+- [etcdctl命令工具](etcd/etcdctl/README.md)
+ - [etcdctl命令工具-V3](etcd/etcdctl/etcdctl-v3.md)
+ - [etcdctl命令工具-V2](etcd/etcdctl/etcdctl-v2.md)
- [Etcd中的k8s数据](etcd/k8s-etcd-data.md)
- [Etcd-Operator的使用](etcd/etcd-operator-usage.md)
## 多集群管理
- [k8s多集群管理的思考](multi-cluster/k8s-multi-cluster-thinking.md)
-
-- [Virtual Kubelet]()
-
- - [Virtual Kubelet介绍](virtual-kubelet/virtual-kubelet.md)
- - [Virtual Kubelet 命令](virtual-kubelet/virtual-kubelet-cmd.md)
-
-- [Karmada]()
-
- - [Karmada介绍](multi-cluster/karmada.md)
+- [Virtual Kubelet](multi-cluster/virtual-kubelet/README.md)
+ - [Virtual Kubelet介绍](multi-cluster/virtual-kubelet/virtual-kubelet.md)
+ - [Virtual Kubelet 命令](multi-cluster/virtual-kubelet/virtual-kubelet-cmd.md)
+- [Karmada](multi-cluster/karmada/README.md)
+ - [Karmada介绍](multi-cluster/karmada/karmada-introduction.md)
## 边缘容器
- [KubeEdge介绍](kubeedge/kubeedge-arch.md)
-- [KubeEdge源码分析]()
+- [KubeEdge源码分析](kubeedge/code-analysis/README.md)
- [cloudcore](kubeedge/code-analysis/cloudcore.md)
- [edgecore](kubeedge/code-analysis/edgecore.md)
## 虚拟化
- [虚拟化相关概念](kvm/vm-concept.md)
-- [KubeVirt]()
+- [KubeVirt](kvm/kubevirt/README.md)
- [KubeVirt的介绍](kvm/kubevirt/kubevirt-introduction.md)
- [KubeVirt的使用](kvm/kubevirt/kubevirt-installation.md)
@@ -220,6 +210,7 @@
- [Heapster介绍](monitor/heapster-introduction.md)
- [Influxdb介绍](monitor/influxdb-introduction.md)
+
---
# 赞赏
diff --git a/SUMMARY.md b/SUMMARY.md
index dfa8401b..4b891c69 100644
--- a/SUMMARY.md
+++ b/SUMMARY.md
@@ -1,6 +1,6 @@
# Summary
-## 目录
+## 目录
- [序言](README.md)
@@ -11,11 +11,11 @@
## 安装与配置
-- [部署k8s集群](setup/README.md)
- - [使用kubeadm安装生产环境kubernetes](setup/install-k8s-by-kubeadm.md)
- - [使用kubespray安装kubernetes](setup/install-k8s-by-kubespray.md)
- - [使用minikube安装kubernetes](setup/install-k8s-by-minikube.md)
- - [使用kind安装kubernetes](setup/install-k8s-by-kind.md)
+- [部署k8s集群](setup/installer/README.md)
+ - [使用kubeadm安装生产环境kubernetes](setup/installer/install-k8s-by-kubeadm.md)
+ - [使用kubespray安装kubernetes](setup/installer/install-k8s-by-kubespray.md)
+ - [使用minikube安装kubernetes](setup/installer/install-k8s-by-minikube.md)
+ - [使用kind安装kubernetes](setup/installer/install-k8s-by-kind.md)
- [k8s证书及秘钥](setup/k8s-cert.md)
- [k8s版本说明](setup/k8s-version-release.md)
@@ -54,7 +54,7 @@
- [Docker网络](network/docker-network.md)
- [K8S网络](network/kubernetes-network.md)
-- [网络插件](network/README.md)
+- [网络插件](network/flannel/README.md)
- [Flannel介绍](network/flannel/flannel-introduction.md)
- [CNI](network/cni/README.md)
- [CNI接口介绍](network/cni/cni.md)
@@ -62,17 +62,17 @@
## 容器存储
-- [存储卷概念](storage/README.md)
- - [Volume](storage/volume.md)
- - [Persistent Volume](storage/persistent-volume.md)
- - [Persistent Volume Claim](storage/persistent-volume-claim.md)
- - [Storage Class](storage/storage-class.md)
- - [Dynamic Volume Provisioning](storage/dynamic-provisioning.md)
-- [CSI](csi/README.md)
- - [csi-cephfs-plugin](csi/ceph/csi-cephfs-plugin.md)
- - [部署csi-cephfs](csi/ceph/deploy-csi-cephfs.md)
- - [部署cephfs-provisioner](csi/provisioner/cephfs-provisioner.md)
- - [FlexVolume介绍](csi/flexvolume.md)
+- [存储卷概念](storage/volume/README.md)
+ - [Volume](storage/volume/volume.md)
+ - [Persistent Volume](storage/volume/persistent-volume.md)
+ - [Persistent Volume Claim](storage/volume/persistent-volume-claim.md)
+ - [Storage Class](storage/volume/storage-class.md)
+ - [Dynamic Volume Provisioning](storage/volume/dynamic-provisioning.md)
+- [CSI](storage/csi/README.md)
+ - [csi-cephfs-plugin](storage/csi/ceph/csi-cephfs-plugin.md)
+ - [部署csi-cephfs](storage/csi/ceph/deploy-csi-cephfs.md)
+ - [部署cephfs-provisioner](storage/csi/provisioner/cephfs-provisioner.md)
+ - [FlexVolume介绍](storage/csi/flexvolume.md)
## 资源隔离
@@ -83,14 +83,14 @@
## 运维指南
-- [kubectl工具](operation/README.md)
- - [kubectl安装与配置](operation/install-kubectl.md)
- - [kubectl命令说明](operation/kubectl-commands.md)
- - [kubectl命令别名](operation/kubectl-alias.md)
+- [kubectl工具](operation/kubectl/README.md)
+ - [kubectl安装与配置](operation/kubectl/install-kubectl.md)
+ - [kubectl命令说明](operation/kubectl/kubectl-commands.md)
+ - [kubectl命令别名](operation/kubectl/kubectl-alias.md)
- [kubernetes集群问题排查](operation/kubernetes-troubleshooting.md)
-- [节点调度](operation/README.md)
- - [安全迁移节点](operation/safely-drain-node.md)
- - [指定Node调度与隔离](operation/nodeselector-and-taint.md)
+- [节点调度](operation/node/README.md)
+ - [安全迁移节点](operation/node/safely-drain-node.md)
+ - [指定Node调度与隔离](operation/node/nodeselector-and-taint.md)
- [镜像仓库配置](operation/registry/README.md)
- [配置私有的镜像仓库](operation/registry/config-private-registry.md)
- [拉取私有镜像](operation/registry/ImagePullSecrets.md)
@@ -106,7 +106,7 @@
## 问题排查
-- [节点相关问题](trouble-shooting/README.md)
+- [节点相关问题](trouble-shooting/node/README.md)
- [keycreate permission denied](trouble-shooting/node/keycreate-permission-denied.md)
- [Cgroup不支持pid资源](trouble-shooting/node/cgroup-pid-error.md)
- [Cgroup子系统无法挂载](trouble-shooting/node/cgroup-subsystem-not-mount.md)
@@ -147,7 +147,7 @@
- [Runc和Containerd概述](runtime/runtime.md)
- [Containerd](runtime/containerd/README.md)
- [安装Containerd](runtime/containerd/install-containerd.md)
-- [Docker]()
+- [Docker](docker/README.md)
- [Docker学习笔记](docker/docker-notes.md)
- [Kata Container](runtime/kata/README.md)
- [kata容器简介](runtime/kata/kata-container.md)
@@ -161,32 +161,32 @@
- [Raft算法](etcd/raft.md)
- [Etcd启动配置参数](etcd/etcd-setup-flags.md)
- [Etcd访问控制](etcd/etcd-auth-and-security.md)
-- [etcdctl命令工具](etcd/README.md)
- - [etcdctl命令工具-V3](etcd/etcdctl-v3.md)
- - [etcdctl命令工具-V2](etcd/etcdctl-v2.md)
+- [etcdctl命令工具](etcd/etcdctl/README.md)
+ - [etcdctl命令工具-V3](etcd/etcdctl/etcdctl-v3.md)
+ - [etcdctl命令工具-V2](etcd/etcdctl/etcdctl-v2.md)
- [Etcd中的k8s数据](etcd/k8s-etcd-data.md)
- [Etcd-Operator的使用](etcd/etcd-operator-usage.md)
## 多集群管理
- [k8s多集群管理的思考](multi-cluster/k8s-multi-cluster-thinking.md)
-- [Virtual Kubelet](virtual-kubelet/README.md)
- - [Virtual Kubelet介绍](virtual-kubelet/virtual-kubelet.md)
- - [Virtual Kubelet 命令](virtual-kubelet/virtual-kubelet-cmd.md)
-- [Karmada](multi-cluster/README.md)
- - [Karmada介绍](multi-cluster/karmada.md)
+- [Virtual Kubelet](multi-cluster/virtual-kubelet/README.md)
+ - [Virtual Kubelet介绍](multi-cluster/virtual-kubelet/virtual-kubelet.md)
+ - [Virtual Kubelet 命令](multi-cluster/virtual-kubelet/virtual-kubelet-cmd.md)
+- [Karmada](multi-cluster/karmada/README.md)
+ - [Karmada介绍](multi-cluster/karmada/karmada-introduction.md)
## 边缘容器
- [KubeEdge介绍](kubeedge/kubeedge-arch.md)
-- [KubeEdge源码分析](kubeedge/README.md)
+- [KubeEdge源码分析](kubeedge/code-analysis/README.md)
- [cloudcore](kubeedge/code-analysis/cloudcore.md)
- [edgecore](kubeedge/code-analysis/edgecore.md)
## 虚拟化
- [虚拟化相关概念](kvm/vm-concept.md)
-- [KubeVirt](kvm/README.md)
+- [KubeVirt](kvm/kubevirt/README.md)
- [KubeVirt的介绍](kvm/kubevirt/kubevirt-introduction.md)
- [KubeVirt的使用](kvm/kubevirt/kubevirt-installation.md)
diff --git a/storage/README.md b/code-analysis/kube-apiserver/README.md
similarity index 100%
rename from storage/README.md
rename to code-analysis/kube-apiserver/README.md
diff --git a/code-analysis/kube-controller-manager/README.md b/code-analysis/kube-controller-manager/README.md
new file mode 100644
index 00000000..e69de29b
diff --git a/code-analysis/kube-scheduler/README.md b/code-analysis/kube-scheduler/README.md
new file mode 100644
index 00000000..e69de29b
diff --git a/code-analysis/kubelet/README.md b/code-analysis/kubelet/README.md
new file mode 100644
index 00000000..e69de29b
diff --git a/concepts/README.md b/concepts/README.md
new file mode 100644
index 00000000..e69de29b
diff --git a/concepts/pod/README.md b/concepts/pod/README.md
new file mode 100644
index 00000000..e69de29b
diff --git a/docker/README.md b/docker/README.md
new file mode 100644
index 00000000..e69de29b
diff --git a/docker/docker-notes.md b/docker/docker-notes.md
index 51009953..41ea463a 100644
--- a/docker/docker-notes.md
+++ b/docker/docker-notes.md
@@ -1,2 +1,4 @@
-# 详见:[Docker学习笔记](https://www.huweihuang.com/docker-notes/)
+# Docker学习笔记
+
+详见:[Docker学习笔记](https://www.huweihuang.com/docker-notes/)
diff --git a/etcd/etcdctl/README.md b/etcd/etcdctl/README.md
new file mode 100644
index 00000000..e69de29b
diff --git a/etcd/etcdctl-v2.md b/etcd/etcdctl/etcdctl-v2.md
similarity index 100%
rename from etcd/etcdctl-v2.md
rename to etcd/etcdctl/etcdctl-v2.md
diff --git a/etcd/etcdctl-v3.md b/etcd/etcdctl/etcdctl-v3.md
similarity index 100%
rename from etcd/etcdctl-v3.md
rename to etcd/etcdctl/etcdctl-v3.md
diff --git a/gpu/README.md b/gpu/README.md
new file mode 100644
index 00000000..e69de29b
diff --git a/kubeedge/code-analysis/README.md b/kubeedge/code-analysis/README.md
new file mode 100644
index 00000000..e69de29b
diff --git a/kvm/README.md b/kvm/README.md
new file mode 100644
index 00000000..e69de29b
diff --git a/kvm/kubevirt/README.md b/kvm/kubevirt/README.md
new file mode 100644
index 00000000..e69de29b
diff --git a/multi-cluster/karmada/README.md b/multi-cluster/karmada/README.md
new file mode 100644
index 00000000..e69de29b
diff --git a/multi-cluster/karmada.md b/multi-cluster/karmada/karmada-introduction.md
similarity index 100%
rename from multi-cluster/karmada.md
rename to multi-cluster/karmada/karmada-introduction.md
diff --git a/multi-cluster/virtual-kubelet/README.md b/multi-cluster/virtual-kubelet/README.md
new file mode 100644
index 00000000..e69de29b
diff --git a/virtual-kubelet/virtual-kubelet-cmd.md b/multi-cluster/virtual-kubelet/virtual-kubelet-cmd.md
similarity index 100%
rename from virtual-kubelet/virtual-kubelet-cmd.md
rename to multi-cluster/virtual-kubelet/virtual-kubelet-cmd.md
diff --git a/virtual-kubelet/virtual-kubelet.md b/multi-cluster/virtual-kubelet/virtual-kubelet.md
similarity index 100%
rename from virtual-kubelet/virtual-kubelet.md
rename to multi-cluster/virtual-kubelet/virtual-kubelet.md
diff --git a/network/README.md b/network/README.md
new file mode 100644
index 00000000..e69de29b
diff --git a/network/cni/README.md b/network/cni/README.md
new file mode 100644
index 00000000..e69de29b
diff --git a/operation/kubectl/README.md b/operation/kubectl/README.md
new file mode 100644
index 00000000..e69de29b
diff --git a/operation/install-kubectl.md b/operation/kubectl/install-kubectl.md
similarity index 100%
rename from operation/install-kubectl.md
rename to operation/kubectl/install-kubectl.md
diff --git a/operation/kubectl-alias.md b/operation/kubectl/kubectl-alias.md
similarity index 100%
rename from operation/kubectl-alias.md
rename to operation/kubectl/kubectl-alias.md
diff --git a/operation/kubectl-commands.md b/operation/kubectl/kubectl-commands.md
similarity index 100%
rename from operation/kubectl-commands.md
rename to operation/kubectl/kubectl-commands.md
diff --git a/operation/node/README.md b/operation/node/README.md
new file mode 100644
index 00000000..e69de29b
diff --git a/operation/nodeselector-and-taint.md b/operation/node/nodeselector-and-taint.md
similarity index 100%
rename from operation/nodeselector-and-taint.md
rename to operation/node/nodeselector-and-taint.md
diff --git a/operation/safely-drain-node.md b/operation/node/safely-drain-node.md
similarity index 100%
rename from operation/safely-drain-node.md
rename to operation/node/safely-drain-node.md
diff --git a/runtime/README.md b/runtime/README.md
new file mode 100644
index 00000000..e69de29b
diff --git a/runtime/containerd/README.md b/runtime/containerd/README.md
new file mode 100644
index 00000000..e69de29b
diff --git a/runtime/containerd/containerd-ctl.md b/runtime/containerd/containerd-ctl.md
new file mode 100644
index 00000000..a83ffd92
--- /dev/null
+++ b/runtime/containerd/containerd-ctl.md
@@ -0,0 +1,25 @@
+# crictl
+
+```bash
+#!/bin/bash
+CrictlVersion=$5
+CrictlVersion=${CrictlVersion:-0.21.0}
+
+echo "--------------install crictl--------------"
+wget https://github.com/kubernetes-sigs/cri-tools/releases/download/v${CrictlVersion}/crictl-v${CrictlVersion}-linux-amd64.tar.gz
+tar Cxzvf /usr/local/bin nerdctl-${NerdctlVersion}-linux-amd64.tar.gz
+```
+
+设置配置文件
+
+```bash
+cat > /etc/crictl.yaml << EOF
+runtime-endpoint: unix:///run/containerd/containerd.sock
+image-endpoint: unix:///run/containerd/containerd.sock
+timeout: 2
+debug: false
+pull-image-on-create: false
+EOF
+```
+
+
diff --git a/runtime/containerd/install-containerd.md b/runtime/containerd/install-containerd.md
index 27fd8163..ad4cd6e8 100644
--- a/runtime/containerd/install-containerd.md
+++ b/runtime/containerd/install-containerd.md
@@ -1,9 +1,9 @@
-# Ubuntu安装containerd
+# 1. Ubuntu安装containerd
以下以Ubuntu为例
> 说明:安装containerd与安装docker流程基本一致,差别在于不需要安装docker-ce
->
+>
> - `containerd`: apt-get install -y containerd.io
> - `docker`: apt-get install docker-ce docker-ce-cli containerd.io
@@ -68,7 +68,7 @@ systemctl status containerd
```bash
# 查看版本
apt-cache madison containerd
-
+
# sudo apt-get install containerd=
```
@@ -79,7 +79,6 @@ apt-cache madison containerd
1、生成默认配置
```bash
-# 生成默认配置
containerd config default > /etc/containerd/config.toml
```
@@ -100,9 +99,63 @@ k8s官方推荐使用systemd类型的CgroupDriver。
systemctl restart containerd
```
+# 2. 离线二进制安装containerd
+
+把`containerd`、`runc`、`cni-plugins`、`nerdctl`二进制下载到本地,再上传到对应服务器,解压文件到对应目录,修改containerd配置文件,启动containerd。
+
+```bash
+#!/bin/bash
+set -e
+
+ContainerdVersion=$1
+ContainerdVersion=${ContainerdVersion:-1.6.6}
+RuncVersion=$2
+RuncVersion=${RuncVersion:-1.1.3}
+CniVersion=$3
+CniVersion=${CniVersion:-1.1.1}
+NerdctlVersion=$4
+NerdctlVersion=${NerdctlVersion:-0.21.0}
+
+CrictlVersion=$5
+CrictlVersion=${CrictlVersion:-1.24.2}
+
+echo "--------------install containerd--------------"
+wget https://github.com/containerd/containerd/releases/download/v${ContainerdVersion}/containerd-${ContainerdVersion}-linux-amd64.tar.gz
+tar Cxzvf /usr/local containerd-${ContainerdVersion}-linux-amd64.tar.gz
+
+echo "--------------install containerd service--------------"
+wget https://raw.githubusercontent.com/containerd/containerd/681aaf68b7dcbe08a51c3372cbb8f813fb4466e0/containerd.service
+mv containerd.service /lib/systemd/system/
+
+mkdir -p /etc/containerd/
+containerd config default > /etc/containerd/config.toml
+
+echo "--------------install runc--------------"
+wget https://github.com/opencontainers/runc/releases/download/v${RuncVersion}/runc.amd64
+chmod +x runc.amd64
+mv runc.amd64 /usr/local/bin/runc
+
+echo "--------------install cni plugins--------------"
+wget https://github.com/containernetworking/plugins/releases/download/v${CniVersion}/cni-plugins-linux-amd64-v${CniVersion}.tgz
+rm -fr /opt/cni/bin
+mkdir -p /opt/cni/bin
+tar Cxzvf /opt/cni/bin cni-plugins-linux-amd64-v${CniVersion}.tgz
+
+echo "--------------install nerdctl--------------"
+wget https://github.com/containerd/nerdctl/releases/download/v${NerdctlVersion}/nerdctl-${NerdctlVersion}-linux-amd64.tar.gz
+tar Cxzvf /usr/local/bin nerdctl-${NerdctlVersion}-linux-amd64.tar.gz
+
+echo "--------------install crictl--------------"
+wget https://github.com/kubernetes-sigs/cri-tools/releases/download/v${CrictlVersion}/crictl-v${CrictlVersion}-linux-amd64.tar.gz
+tar Cxzvf /usr/local/bin crictl-v${CrictlVersion}-linux-amd64.tar.gz
+
+# 启动containerd服务
+systemctl daemon-reload
+systemctl restart contaienrd
+```
参考:
@@ -112,4 +165,10 @@ systemctl restart containerd
- https://docs.docker.com/engine/install/ubuntu/
-- https://kubernetes.io/docs/setup/production-environment/container-runtimes/#containerd
\ No newline at end of file
+- https://kubernetes.io/docs/setup/production-environment/container-runtimes/#containerd
+
+- [containerd/containerd.service at main · containerd/containerd · GitHub](https://github.com/containerd/containerd/blob/main/containerd.service)
+
+- [GitHub - containerd/nerdctl: containerd ctl ](https://github.com/containerd/nerdctl)
+
+- [GitHub - kubernetes-sigs/cri-tools: CLI and validation tools for Kubelet Container Runtime Interface (CRI) .](https://github.com/kubernetes-sigs/cri-tools)
\ No newline at end of file
diff --git a/runtime/containerd/remove-dockershim.md b/runtime/containerd/remove-dockershim.md
index 7b199a49..8fbab3ba 100644
--- a/runtime/containerd/remove-dockershim.md
+++ b/runtime/containerd/remove-dockershim.md
@@ -10,4 +10,6 @@
- [Dockershim removal feedback & issues ](https://github.com/kubernetes/kubernetes/issues/106917)
-- [将 Docker Engine 节点从 dockershim 迁移到 cri-dockerd | Kubernetes](https://kubernetes.io/zh-cn/docs/tasks/administer-cluster/migrating-from-dockershim/migrate-dockershim-dockerd/)
\ No newline at end of file
+- [将 Docker Engine 节点从 dockershim 迁移到 cri-dockerd | Kubernetes](https://kubernetes.io/zh-cn/docs/tasks/administer-cluster/migrating-from-dockershim/migrate-dockershim-dockerd/)
+
+- [查明节点上所使用的容器运行时 | Kubernetes](https://kubernetes.io/zh-cn/docs/tasks/administer-cluster/migrating-from-dockershim/find-out-runtime-you-use/)
\ No newline at end of file
diff --git a/runtime/kata/README.md b/runtime/kata/README.md
new file mode 100644
index 00000000..e69de29b
diff --git a/setup/installer/README.md b/setup/installer/README.md
new file mode 100644
index 00000000..e69de29b
diff --git a/setup/install-k8s-by-kind.md b/setup/installer/install-k8s-by-kind.md
similarity index 100%
rename from setup/install-k8s-by-kind.md
rename to setup/installer/install-k8s-by-kind.md
diff --git a/setup/install-k8s-by-kubeadm.md b/setup/installer/install-k8s-by-kubeadm.md
similarity index 82%
rename from setup/install-k8s-by-kubeadm.md
rename to setup/installer/install-k8s-by-kubeadm.md
index a178aa53..7c0cf55c 100644
--- a/setup/install-k8s-by-kubeadm.md
+++ b/setup/installer/install-k8s-by-kubeadm.md
@@ -2,6 +2,36 @@
# 1. 环境准备
+## 1.0. master硬件配置
+
+参考:
+
+- [Master节点规格](https://help.aliyun.com/document_detail/98886.html)
+
+- [高可靠推荐配置 - 容器服务 ACK - 阿里云](https://help.aliyun.com/document_detail/94292.html)
+
+Kubernetes集群Master节点上运行着etcd、kube-apiserver、kube-controller等核心组件,对于Kubernetes集群的稳定性有着至关重要的影响,对于生产环境的集群,必须慎重选择Master规格。Master规格跟集群规模有关,集群规模越大,所需要的Master规格也越高。
+
+**说明** :可从多个角度衡量集群规模,例如节点数量、Pod数量、部署频率、访问量。这里简单的认为集群规模就是集群里的节点数量。
+
+对于常见的集群规模,可以参见如下的方式选择Master节点的规格(对于测试环境,规格可以小一些。下面的选择能尽量保证Master负载维持在一个较低的水平上)。
+
+| 节点规模 | Master规格 | 磁盘 |
+| -------------- | ----------------- | ---------- |
+| 1~5个节点 | 4核8 GB(不建议2核4 GB) | |
+| 6~20个节点 | 4核16 GB | |
+| 21~100个节点 | 8核32 GB | |
+| **100~200个节点** | **16核64 GB** | |
+| **1000个节点** | **32核128GB** | **1T SSD** |
+
+**注意事项:**
+
+- **由于Etcd的性能瓶颈,Etcd的数据存储盘尽量选择SSD磁盘。**
+
+- **为了实现多机房容灾,可将三台master分布在一个可用区下三个不同机房。**(机房之间的网络延迟在10毫秒及以下级别)
+
+- **申请LB来做master节点的负载均衡实现高可用,LB作为apiserver的访问地址。**
+
## 1.1. 设置防火墙端口策略
生产环境设置k8s节点的iptables端口访问规则。
@@ -85,7 +115,6 @@ apt install -y containerd.io
2、生成默认配置
```bash
-# 生成默认配置
containerd config default > /etc/containerd/config.toml
```
@@ -156,7 +185,10 @@ EOF
# 安装指定版本的kubeadm, kubelet, kubectl
apt-get update
-apt-get install -y kubelet=1.21.10-00 kubeadm=1.21.10-00 kubectl=1.21.10-00
+apt-get install -y kubelet=1.24.2-00 kubeadm=1.24.2-00 kubectl=1.24.2-00
+
+# 查询有哪些版本
+apt-cache madison kubeadm
```
# 4. 配置kubeadm config
@@ -267,7 +299,7 @@ kubeadm config print init-defaults > kubeadm-config.yaml
修改配置内容
```yaml
-apiVersion: kubeadm.k8s.io/v1beta2
+apiVersion: kubeadm.k8s.io/v1beta3
bootstrapTokens:
- groups:
- system:bootstrappers:kubeadm:default-node-token
@@ -281,7 +313,8 @@ localAPIEndpoint:
advertiseAddress: 1.2.3.4 # 修改为apiserver的IP 或者去掉localAPIEndpoint则会读取默认IP。
bindPort: 6443
nodeRegistration:
- criSocket: /run/containerd/containerd.sock
+ criSocket: unix:///var/run/containerd/containerd.sock
+ imagePullPolicy: IfNotPresent
name: node
taints: null
---
@@ -290,19 +323,18 @@ apiServer:
- lb.k8s.domain # 添加额外的apiserver的域名
-
timeoutForControlPlane: 4m0s
-apiVersion: kubeadm.k8s.io/v1beta2
+apiVersion: kubeadm.k8s.io/v1beta3
certificatesDir: /etc/kubernetes/pki
clusterName: kubernetes
controllerManager: {}
-dns:
- type: CoreDNS
+dns: {} # 默认为coredns
etcd:
local:
dataDir: /data/etcd # 修改etcd的存储盘目录
imageRepository: k8s.gcr.io # 修改镜像仓库地址
controlPlaneEndpoint: lb.k8s.domain # 修改控制面域名
kind: ClusterConfiguration
-kubernetesVersion: 1.21.0 # k8s 版本
+kubernetesVersion: 1.24.0 # k8s 版本
networking:
dnsDomain: cluster.local
serviceSubnet: 10.96.0.0/12
@@ -331,7 +363,7 @@ kubeadm config images pull
## 5.1. 安装master
```bash
-sudo kubeadm init --config kubeadm-config.yaml --upload-certs --cri-socket /run/containerd/containerd.sock --node-name
+sudo kubeadm init --config kubeadm-config.yaml --upload-certs --node-name
```
部署参数说明:
@@ -374,7 +406,6 @@ Then you can join any number of worker nodes by running the following on each as
kubeadm join :6443 --token \
--discovery-token-ca-cert-hash sha256: \
--control-plane --certificate-key \
---cri-socket /run/containerd/containerd.sock \
--node-name
```
@@ -468,6 +499,30 @@ openssl x509 -pubkey -in /etc/kubernetes/pki/ca.crt | openssl rsa -pubin -outfor
基于新生成的token重新添加节点。
+## 9.2. 修改kubeadm join的master IP或端口
+
+`kubeadm join`命令会去`kube-public`命名空间获取名为`cluster-info`的`ConfigMap`。如果需要修改kubeadm join使用的master的IP或端口,则需要修改cluster-info的configmap。
+
+```bash
+# 查看cluster-info
+kubectl -n kube-public get configmaps cluster-info -o yaml
+
+# 修改cluster-info
+kubectl -n kube-public edit configmaps cluster-info
+```
+
+修改配置文件中的`server`字段
+
+```yaml
+clusters:
+- cluster:
+ certificate-authority-data: xxx
+ server: https://lb.k8s.domain:36443
+ name: ""
+```
+
+执行kubeadm join的命令时指定新修改的master地址。
+
参考:
- [利用 kubeadm 创建高可用集群 | Kubernetes](https://kubernetes.io/zh-cn/docs/setup/production-environment/tools/kubeadm/high-availability/)
@@ -481,5 +536,3 @@ openssl x509 -pubkey -in /etc/kubernetes/pki/ca.crt | openssl rsa -pubin -outfor
- https://github.com/Mirantis/cri-dockerd
- [配置 cgroup 驱动|Kubernetes](https://kubernetes.io/zh-cn/docs/tasks/administer-cluster/kubeadm/configure-cgroup-driver/)
- [GitHub: flannel is a network fabric for containers](https://github.com/flannel-io/flannel)
-
-
diff --git a/setup/install-k8s-by-kubespray.md b/setup/installer/install-k8s-by-kubespray.md
similarity index 100%
rename from setup/install-k8s-by-kubespray.md
rename to setup/installer/install-k8s-by-kubespray.md
diff --git a/setup/install-k8s-by-minikube.md b/setup/installer/install-k8s-by-minikube.md
similarity index 100%
rename from setup/install-k8s-by-minikube.md
rename to setup/installer/install-k8s-by-minikube.md
diff --git a/storage/csi/README.md b/storage/csi/README.md
new file mode 100644
index 00000000..e69de29b
diff --git a/csi/ceph/csi-cephfs-plugin.md b/storage/csi/ceph/csi-cephfs-plugin.md
similarity index 100%
rename from csi/ceph/csi-cephfs-plugin.md
rename to storage/csi/ceph/csi-cephfs-plugin.md
diff --git a/csi/ceph/deploy-csi-cephfs.md b/storage/csi/ceph/deploy-csi-cephfs.md
similarity index 100%
rename from csi/ceph/deploy-csi-cephfs.md
rename to storage/csi/ceph/deploy-csi-cephfs.md
diff --git a/csi/flexvolume.md b/storage/csi/flexvolume.md
similarity index 100%
rename from csi/flexvolume.md
rename to storage/csi/flexvolume.md
diff --git a/csi/provisioner/cephfs-provisioner.md b/storage/csi/provisioner/cephfs-provisioner.md
similarity index 100%
rename from csi/provisioner/cephfs-provisioner.md
rename to storage/csi/provisioner/cephfs-provisioner.md
diff --git a/storage/volume/README.md b/storage/volume/README.md
new file mode 100644
index 00000000..e69de29b
diff --git a/storage/dynamic-provisioning.md b/storage/volume/dynamic-provisioning.md
similarity index 100%
rename from storage/dynamic-provisioning.md
rename to storage/volume/dynamic-provisioning.md
diff --git a/storage/persistent-volume-claim.md b/storage/volume/persistent-volume-claim.md
similarity index 100%
rename from storage/persistent-volume-claim.md
rename to storage/volume/persistent-volume-claim.md
diff --git a/storage/persistent-volume.md b/storage/volume/persistent-volume.md
similarity index 100%
rename from storage/persistent-volume.md
rename to storage/volume/persistent-volume.md
diff --git a/storage/storage-class.md b/storage/volume/storage-class.md
similarity index 100%
rename from storage/storage-class.md
rename to storage/volume/storage-class.md
diff --git a/storage/volume.md b/storage/volume/volume.md
similarity index 100%
rename from storage/volume.md
rename to storage/volume/volume.md