Coder Social home page Coder Social logo

kubernetes-vagrant-cluster's Introduction

kubernetes-vagrant-cluster

一. 基本环境准备

vagrantfile里的ip要和install的ip一致, 各addon里与ip相关,要进行配置

前置条件

由于需要同步主机文件,所以需要安装相关插件vagrant-vbguest. 注意,该版本目前一定要0.21版本,其它版本暂时有问题

# 查看插件
vagrant plugin list 
# sync folder plugin
vagrant plugin install vagrant-vbguest --plugin-version 0.21

启用虚拟机

当虚拟机启动后,集群还处于待激活状态,各节点还未加入到集群,需求一些简单的配置

vagrant up 

二.必须的操作

安装网络插件flannel

由于 flannel 的镜像拉取失败,请先提前下载并载入. 然后修改 addon/flannel/flannel.yml的镜像. 目前使用以下两个:

  • rancher/mirrored-flannelcni-flannel:v0.17.0
  • rancher/mirrored-flannelcni-flannel-cni-plugin:v1.0.1
cd /vagrant
kubectl apply -f addon/flannel/flannel.yml

将其它节点加入到集群

查看 kubeadm.out 有加入节点的指令

kubeadm join --token <token> <control-plane-host>:<control-plane-port> --discovery-token-ca-cert-hash sha256:<hash>

控制平面节点隔离

kubectl taint nodes --all node-role.kubernetes.io/master

配置 ipvs

kubectl edit configmap -n kube-system kube-proxy

修改其中的

apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
mode: "ipvs"
ipvs:
  strictARP: true

重启kube-proxypod

kubectl get pod -n kube-system |grep kube-proxy |awk '{system("kubectl delete pod "$1" -n kube-system")}'

可选的addon

安装 metallb

kubectl apply -f addon/metallb/namespace.yml
helm install metallb  metallb/metallb -f addon/metallb/values.yml  -n metallb-system

安装 ingress-nginx

kubectl apply -f addon/ingress-nginx/namespace.yml
helm install  ingress-nginx ingress-nginx/ingress-nginx -f addon/ingress-nginx/values.yaml -n ingress-nginx

References

kubernetes-vagrant-cluster's People

Contributors

thinkgos avatar

Watchers

 avatar  avatar

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.