[集群自动化一]3分钟装好k8s_HA-v1.13.0

*


原文链接

To install k8s_HA-1.13.0 on CoreOS

external-etcd.png

Prepare:

  • download:
    • coreos-k8s-v1.13.0.tgz ----- k8s 1.13.0's docker image&kubelet/kubeadm/kubectl&dashboard
    • ha.tgz ----- docker image: keepalived.tar/haproxy.tar/etcd.tar
    • coreosbase2.tgz ----- kvm's img for CoreOS 1855.4
    • 1.0 istio.tgz---(Optional)
    • k8s-addon.tgz---(Optional)
    • clone k8s-ha-autoinstall & mv *tgz k8s-ha0autoinstall
  • CONFIG
    • vi CONFIG -----just need modify node&master's IP
K8S_VER=v1.13.0
CIDR_SUBNET=10.244.0.0/16
KUBECONFIG=/etc/kubernetes/admin.conf
LOAD_BALANCER_DNS=k8sha.yunwei.edu
LOAD_BALANCER_PORT=8443
CP1_HOSTNAME=master1.yunwei.edu
CP2_HOSTNAME=master2.yunwei.edu
CP3_HOSTNAME=master3.yunwei.edu
VIP_IP=192.168.253.30
CP1_IP=192.168.253.31
CP2_IP=192.168.253.32
CP3_IP=192.168.253.33
NODE1_IP=192.168.253.34
NODE1_HOSTNAME=node1.yunwei.edu
REMOTE_USER=core
#
master="$CP1_IP,$CP2_IP,$CP3_IP"
node="$NODE1_IP"  # add IP seprate by ','
NODES="$master,$node"
net="calico" #calico or flannel
dashboard=true
helm=true
ingress=true
prometheus=true
efk=true
istio=true

#just for coreos machines
KVM_NAME="master1,master2,master3,node1"
GATEWAY=192.168.253.125
DNS1=192.168.253.110
DNS2=114.114.114.114
  • clone

    • clone or install CoreOS machines

    cd clone_coreos;sh clone_machine.sh

Install

  • Install for single master:

    sh -x install.sh all

  • Install for multi master:

    sh -x install.sh allha

安装视频


安装完成

验证安装

  • 浏览svc.html 包含相关服务的链接
  • sh install.sh status 查看各服务状态

当需要重新安装:

`sh -x install.sh reset`

install.sh 的HELP

usage: install.sh [prepare|p]|p1|p2|p3|p4|[1|base]|[2|addon]|[3|ha]|dashboard|network|node|rejoin|ingress|helm|prometheus|efk|istio|finish|default|help|...   [-c|--config  /path/to/config/config.filename]
        p|prepare      :cp&load all tgz&images.
        p1             :cp&load base tgz&images.
        p2             :cp&load addon tgz&images.
        p3             :cp&load istio tgz&images.
        p4             :cp&load HA tgz&images.
        1|base         :install k8s base component&calico&dashboard.
        2|addon        :install k8s addon component:helm,ingress,efk,prometheus.
        3|ha           :install HA cluster of k8s.
        node           :only join node.
        all|default    :install all configured in CONFIG file with single master.
        allha          :install all configured in CONFIG file with HA three master.
        finish         :get login token&svc.
        rejoin         :need join other node after 24h.
        ingress        :install ingress.
        helm           :install helm.
        efk            :install efk.
        prometheus     :install prometheus.
        istio          :install istio component.
        reboot         :reboot all
        reset          :kubeadm reset all
        etcdcheck      :check etcd cluster
        calicocheck    :check calico status
        getpods        :get pods -o wide
        getsvc         :get svc -o wide
        genindex       :gen index svc.html
        status         :get etcd&calico&pods
        timezone8      :set timezone CST-8
        route          :add route temporally


微信公众号: [LinuxMan]

Linux命令用法速查公众号,如:输入ls,返回用法链接,内含500+命令用法
  _       _                          __  __                 
 | |     (_)  _ __    _   _  __  __ |  \/  |   __ _   _ __  
 | |     | | | '_ \  | | | | \ \/ / | |\/| |  / _` | | '_ \ 
 | |___  | | | | | | | |_| |  >  <  | |  | | | (_| | | | | |
 |_____| |_| |_| |_|  \__,_| /_/\_\ |_|  |_|  \__,_| |_| |_|

你可能感兴趣的:([集群自动化一]3分钟装好k8s_HA-v1.13.0)