Convert Figma logo to code with AI

opsnull logofollow-me-install-kubernetes-cluster

和我一步步部署 kubernetes 集群

7,421
2,904
7,421
183

Top Related Projects

109,710

Production-Grade Container Scheduling and Management

Bootstrap Kubernetes the hard way. No scripts.

27,529

Lightweight Kubernetes

15,866

Deploy a Production Ready Kubernetes Cluster

The container platform tailored for Kubernetes multi-cloud, datacenter, and edge management ⎈ 🖥 ☁️

Quick Overview

The "follow-me-install-kubernetes-cluster" repository is a comprehensive guide for manually deploying a production-grade Kubernetes cluster. It provides step-by-step instructions in Chinese for setting up a highly available Kubernetes environment, including all necessary components and best practices.

Pros

  • Detailed, step-by-step instructions for a complete Kubernetes setup
  • Covers advanced topics like high availability and security considerations
  • Regularly updated to reflect the latest Kubernetes versions and best practices
  • Includes explanations and rationale for each step, promoting understanding

Cons

  • Instructions are primarily in Chinese, which may limit accessibility for non-Chinese speakers
  • Manual installation process can be time-consuming compared to automated tools
  • Requires a deep understanding of Kubernetes concepts and Linux administration
  • May not be suitable for small-scale or development environments due to its production-grade focus

Getting Started

To begin using this guide:

  1. Clone the repository:

    git clone https://github.com/opsnull/follow-me-install-kubernetes-cluster.git
    
  2. Navigate to the repository directory:

    cd follow-me-install-kubernetes-cluster
    
  3. Start with the README.md file, which provides an overview and table of contents for the installation process.

  4. Follow the chapters in order, starting with environment preparation and progressing through component installation and configuration.

  5. Refer to the specific markdown files for each step, carefully following the instructions and executing the provided commands.

Note: Ensure you have the necessary hardware resources and meet the prerequisites before beginning the installation process. It's recommended to have a good understanding of Kubernetes concepts and Linux administration before attempting this manual installation.

Competitor Comparisons

109,710

Production-Grade Container Scheduling and Management

Pros of kubernetes

  • Official repository with comprehensive documentation and extensive community support
  • Contains the core Kubernetes components and APIs, allowing for deeper understanding and customization
  • Regularly updated with the latest features, bug fixes, and security patches

Cons of kubernetes

  • Steeper learning curve for beginners due to its complexity and extensive codebase
  • Requires more setup and configuration compared to the follow-me-install-kubernetes-cluster guide
  • May be overwhelming for users who just want a simple Kubernetes installation

Code Comparison

follow-me-install-kubernetes-cluster:

# Example installation step
$ sudo apt-get update && sudo apt-get install -y kubelet kubeadm kubectl

kubernetes:

// Example Kubernetes API code
type Pod struct {
    metav1.TypeMeta `json:",inline"`
    metav1.ObjectMeta `json:"metadata,omitempty"`
    Spec PodSpec `json:"spec,omitempty"`
    Status PodStatus `json:"status,omitempty"`
}

The follow-me-install-kubernetes-cluster repository provides a step-by-step guide for installing Kubernetes, making it more accessible for beginners. In contrast, the kubernetes repository contains the actual source code and components of the Kubernetes project, offering a deeper dive into the system's internals but requiring more expertise to navigate and utilize effectively.

Bootstrap Kubernetes the hard way. No scripts.

Pros of kubernetes-the-hard-way

  • More comprehensive and detailed, covering advanced topics
  • Focuses on manual installation, providing deeper understanding
  • Regularly updated to reflect latest Kubernetes versions

Cons of kubernetes-the-hard-way

  • More time-consuming to complete
  • Requires more technical expertise
  • Less focused on production-ready deployments

Code Comparison

follow-me-install-kubernetes-cluster:

# Install Docker
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum install -y docker-ce
systemctl enable docker && systemctl start docker

kubernetes-the-hard-way:

# Generate the Kubernetes Configuration Files for Authentication
kubectl config set-cluster kubernetes-the-hard-way \
  --certificate-authority=ca.pem \
  --embed-certs=true \
  --server=https://${KUBERNETES_PUBLIC_ADDRESS}:6443 \
  --kubeconfig=kube-proxy.kubeconfig

The code snippets demonstrate the difference in approach. follow-me-install-kubernetes-cluster focuses on practical installation steps, while kubernetes-the-hard-way emphasizes manual configuration and deeper understanding of Kubernetes components.

Both repositories provide valuable resources for learning Kubernetes, but cater to different skill levels and learning objectives. follow-me-install-kubernetes-cluster is more suitable for beginners and those seeking a quicker setup, while kubernetes-the-hard-way is ideal for advanced users and those wanting to gain in-depth knowledge of Kubernetes internals.

27,529

Lightweight Kubernetes

Pros of k3s

  • Lightweight and resource-efficient, ideal for edge computing and IoT devices
  • Easy to install and manage with a single binary
  • Includes built-in storage and load balancing solutions

Cons of k3s

  • Limited customization options compared to full Kubernetes installations
  • May not support all Kubernetes features and add-ons
  • Potential performance limitations for large-scale deployments

Code Comparison

follow-me-install-kubernetes-cluster:

# Install etcd
yum -y install etcd
systemctl enable etcd
systemctl start etcd

k3s:

# Install k3s
curl -sfL https://get.k3s.io | sh -
# Check installation
k3s kubectl get node

The follow-me-install-kubernetes-cluster repository provides a step-by-step guide for manually installing a full Kubernetes cluster, which offers more control and customization. In contrast, k3s simplifies the installation process with a single command, making it easier for beginners but potentially limiting advanced configurations.

k3s is more suitable for lightweight environments and quick deployments, while follow-me-install-kubernetes-cluster is better for learning the intricacies of Kubernetes and creating highly customized clusters.

15,866

Deploy a Production Ready Kubernetes Cluster

Pros of kubespray

  • More actively maintained with frequent updates and a larger community
  • Supports multiple cloud providers and on-premises deployments
  • Offers more customization options and flexibility in cluster configuration

Cons of kubespray

  • Steeper learning curve due to its complexity and extensive feature set
  • Requires more system resources for deployment and management
  • May be overkill for simple or small-scale Kubernetes deployments

Code Comparison

follow-me-install-kubernetes-cluster:

# Example of manual etcd configuration
etcd \
  --name ${ETCD_NAME} \
  --data-dir=${ETCD_DATA_DIR} \
  --listen-peer-urls=https://${ETCD_IP}:2380 \
  --listen-client-urls=https://${ETCD_IP}:2379,http://127.0.0.1:2379 \
  --advertise-client-urls=https://${ETCD_IP}:2379 \
  --initial-advertise-peer-urls=https://${ETCD_IP}:2380 \
  --initial-cluster=${ETCD_NODES} \
  --initial-cluster-state=new \
  --initial-cluster-token=etcd-cluster-0 \
  --client-cert-auth \
  --trusted-ca-file=/etc/kubernetes/ssl/ca.pem \
  --cert-file=/etc/etcd/ssl/etcd.pem \
  --key-file=/etc/etcd/ssl/etcd-key.pem \
  --peer-client-cert-auth \
  --peer-trusted-ca-file=/etc/kubernetes/ssl/ca.pem \
  --peer-cert-file=/etc/etcd/ssl/etcd.pem \
  --peer-key-file=/etc/etcd/ssl/etcd-key.pem

kubespray:

# Example of etcd configuration in group_vars/etcd.yml
etcd_peer_port: 2380
etcd_client_port: 2379
etcd_data_dir: "/var/lib/etcd"
etcd_cert_dir: "/etc/ssl/etcd/ssl"
etcd_config_dir: "/etc/etcd"
etcd_cert_group: "root"
etcd_script_dir: "{{ bin_dir }}/etcd-scripts"

The container platform tailored for Kubernetes multi-cloud, datacenter, and edge management ⎈ 🖥 ☁️

Pros of KubeSphere

  • Provides a comprehensive web-based UI for managing Kubernetes clusters
  • Offers built-in monitoring, logging, and alerting capabilities
  • Includes multi-tenancy support and fine-grained access control

Cons of KubeSphere

  • Requires more resources to run due to additional components
  • May have a steeper learning curve for users new to Kubernetes
  • Some advanced Kubernetes features might be abstracted or less accessible

Code Comparison

follow-me-install-kubernetes-cluster:

# Install etcd
tar -xvf etcd-v3.4.3-linux-amd64.tar.gz
mv etcd-v3.4.3-linux-amd64/etcd* /opt/k8s/bin

KubeSphere:

apiVersion: installer.kubesphere.io/v1alpha1
kind: ClusterConfiguration
metadata:
  name: ks-installer
  namespace: kubesphere-system
spec:
  persistence:
    storageClass: ""

The follow-me-install-kubernetes-cluster repository provides a step-by-step guide for manually installing Kubernetes components, while KubeSphere offers a more automated installation process with additional features and a user-friendly interface. The code snippets show the difference in approach, with follow-me-install-kubernetes-cluster focusing on individual component installation and KubeSphere using a custom resource definition for cluster configuration.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

和我一步步部署 kubernetes 集群

dashboard-home

本系列文档介绍使用二进制部署 kubernetes v1.16.6 集群的所有步骤(Hard-Way 模式)。

在部署的过程中,将详细列出各组件的启动参数,它们的含义和可能遇到的问题。

部署完成后,你将理解系统各组件的交互原理,进而能快速解决实际问题。

所以本文档主要适合于那些有一定 kubernetes 基础,想通过一步步部署的方式来学习和了解系统配置、运行原理的人。

本系列系文档适用于 CentOS 7 及以上版本系统,**随着各组件的更新而更新**,有任何问题欢迎提 issue!

由于启用了 x509 证书双向认证、RBAC 授权等严格的安全机制,建议从头开始部署,否则可能会认证、授权等失败!

从 v1.16.x 版本开始,本文档做了如下调整:

  1. 容器运行时:用 containerd 替换 docker,更加简单、健壮;相应的命令行工具为 crictl;
  2. Pod 网络:用 calico 替换 flannel 实现 Pod 互通,支持更大规模的集群;

新增指标监控系统:使用主流的 Prometheus、Grafana 技术栈实现集群指标采集和监控;

如果想继续使用 docker 和 flannel,请参考附件文档。

历史版本

  • v1.6.2:已停止更新;
  • v1.8.x:已停止更新;
  • v1.10.x:已停止更新;
  • v1.12.x:已停止更新;
  • v1.14.x:继续更新;

步骤列表

  1. 00.组件版本和配置策略
  2. 01.初始化系统和全局变量
  3. 02.创建CA根证书和秘钥
  4. 03.部署kubectl命令行工具
  5. 04.部署etcd集群
  6. 05-1.部署master节点.md
    1. 05-2.apiserver集群
    2. 05-3.controller-manager集群
    3. 05-4.scheduler集群
  7. 06-1.部署woker节点
    1. 06-2.apiserver高可用之nginx代理
    2. 06-3.containerd
    3. 06-4.kubelet
    4. 06-5.kube-proxy
    5. 06-6.部署calico网络
  8. 07.验证集群功能
  9. 08-1.部署集群插件
    1. 08-2.coredns插件
    2. 08-3.dashboard插件
    3. 08-4.kube-prometheus插件
    4. 08-5.EFK插件
  10. 09.部署Docker-Registry
  11. 10.清理集群
  12. A.浏览器访问apiserver安全端口
  13. B.校验TLS证书
  14. C.部署metrics-server插件
  15. D.部署Harbor-Registry

在线阅读

电子书

打赏

如果你觉得这份文档对你有帮助,请微信扫描下方的二维码进行捐赠,加油后的 opsnull 将会和你分享更多的原创教程,谢谢!

weixin_qr.jpg

广告位

版权

Copyright 2017-2020 zhangjun (geekard@qq.com)

知识共享 署名-非商业性使用-相同方式共享 4.0(CC BY-NC-SA 4.0),详情见 LICENSE 文件。