Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Create a highly available kubernetes cluster by binary

NotificationsYou must be signed in to change notification settings

jiangyp1996/KubeProdOps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

  • How to install Kubernetes in prod ?
  • How to migrate a etcd node ?
  • How to migrate a master node ?
  • How to upgrade kubelet from http to https ?
  • How to upgrade etcd from http to https ?

🌱 Install Kubernetes

Preparations

  • A center control node with ansible and ssh, refer tothis.

  • Clone this project to your ansible control node, then do the following.

     git clone https://github.com/jiangyp1996/KubeProdOps.git cd KubeProdOps git checkout -b <your-k8s-cluster-name>

Environment

  • Operating System and version: Red Hat Enterprise Linux Server release 7.9
  • Kernel: 3.10.0-1160.15.2.el7.x86_64
  • Kubernetes version: 1.18.14
  • Etcd version: 3.5.4
  • Docker version: 19.03.14
  • Flannel version: 0.22.3
  • CodeDNS version: 1.10.1

Certificate

Generate CA, Master and etcd certificates, and distribute them to the corresponding target hosts.

1. Generate CA cert

  • Generate ca.key and ca.crt.
cd certsh ./generate_ca_cert.sh --cluster-name=my-k8s --vip=10.18.10.100

2. Generate and distribute etcd and CA cert

  • Generate etcd_server.key, etcd_server.crt, etcd_client.key and etcd_client.crt
  • Distribute ca.crt, etcd_server.key and etcd_server.crt to etcd hosts
sh ./generate_and_distribute_etcd_cert.sh --cluster-name=my-k8s --etcd-servers-ip=10.18.10.3,10.18.10.4,10.18.10.5

3. Generate and distribute Master and CA cert

  • Generate apiserver.key and apiserver.crt
  • Distribute ca.crt, apiserver.key, apiserver.crt, etcd_client.key and etcd_client.crt to master hosts
sh ./generate_and_distribute_master_cert.sh --cluster-name=my-k8s --master-servers-ip=10.18.10.1,10.18.10.2 --vip=10.18.10.100

Install etcd

cd etcdansible-playbook -i ./inventory/etcd-inventory.ini  install_etcd.yml

Install Master

cd masteransible-playbook -i ./inventory/master-inventory.ini  install_master.yml

Install HAProxy and Keepalived

Install Worker

cd workeransible-playbook -i ./worker-inventory.ini  install_worker.yml

Install Flannel

  1. Download kube-flannel.yml fromgithub flannel releases to worker node.

  2. Change the Network value of ConfigMap, such as 172.24.0.0/13 in this project example.

You can refer to others/kube-flannel.yml in this project.

  1. kubectl apply -f kube-flannel.yml

Install CoreDNS

  1. Refer tocoredns.yaml.sed or this project's others/install-coredns.yml

  2. Change ConfigMap data

  3. Change Service clusterIP, such as 172.16.40.1 in this project example

  4. kubectl apply -f install-coredns.yml

🍄 Others

  1. Migrate a master node
  2. Migrate a etcd node
  3. Upgrade kubelet from http to https
  4. Upgrade etcd from http to https

About

Create a highly available kubernetes cluster by binary

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp