Giter VIP home page Giter VIP logo

k8's Introduction

Creating a single-master-cluster

two step to create a single master cluster

  • create vm
  • kubeadm init

VM Configuration

os kubernetes CPU MEM
centos7.4 1.11.2 2C 4G

Prerequisites

  1. Install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  1. Install vagrant and virtualbox
brew cask install vagrant
brew cask install virtualbox

Create vm

  1. Run this cmd in directory with Vagrantfile
vagrant up

Create kubernetes cluster

  1. Init kubernetes master
kubeadm init --config=kubeadm.config

mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
  1. Remove master taint
kubectl taint nodes --all node-role.kubernetes.io/master-
  1. Install flannel
kubectl create -f flannel.yaml
  1. Check cluster
kubectl cluster-info
kubectl get cs
kubectl get nodes
  1. Join node

Option 1

# join node
kubeadm join --token <token> <master-ip>:<master-port> --discovery-token-ca-cert-hash sha256:<hash>

# list token
kubeadm token list

# discovery-token-ca-cert-hash
root@ubuntu:/home/cong# openssl x509 -pubkey -in /etc/kubernetes/pki/ca.crt | openssl rsa -pubin -outform der 2>/dev/null | openssl dgst -sha256 -hex | sed 's/^.* //'

Option 2

kubeadm token create --print-join-command
  1. delete node
kubectl drain <node name> --delete-local-data --force --ignore-daemonsets
kubectl delete node <node name>

k8's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.