zoukankan      html  css  js  c++  java
  • KubeSphere2.1踩坑记

    至少两台机器。推荐4X16。(完全安装KubeSphere会吃掉10G+内存)

    k8s安装(略1.14.8)可参考我上一篇文章或者基于kubeadmin快速安装

    KubeSphere2.1前置条件

    1.k8s版本必须小于1.6大于等于1.13 我选择的是1.14.8

    2.helm必须大于等于2.10 小于2.16 我选择2.15.2

    安装流程:

    1.helm安装(master节点)

      wget https://get.helm.sh/helm-v2.15.2-linux-amd64.tar.gz

      tar zxvf helm-v2.15.2-linux-amd64.tar.gz

      cd liniux-amd64

      mv helm /usr/local/bin

    2.tiller安装(master节点)

    kubectl -n kube-system create serviceaccount tiller
    kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
    helm init --service-account tiller --skip-refresh --tiller-image registry.cn-shanghai.aliyuncs.com/rancher/tiller:v2.15.1

    *验证helm是否成功 输入 helm list 没有任何返回则代表成功

    3. nfs安装(安装到node节点,master节点安装后始终提示无法连接,很诡异)

    yum install -y nfs-utils

    vim /etc/exports
    /home/data node端ip/24(insecure,rw,async,no_root_squash) 

    mkdir /home/data

    chmod 777  /home/data

    systemctl enable rpcbind.service
    systemctl enable nfs-server.service
    systemctl start rpcbind.service
    systemctl start nfs-server.service

    4.安装storageclass(master节点)

    ---
    apiVersion: v1
    kind: ServiceAccount
    metadata:
      name: nfs-provisioner
    ---
    kind: ClusterRole
    apiVersion: rbac.authorization.k8s.io/v1
    metadata:
       name: nfs-provisioner-runner
       namespace: default
    rules:
       -  apiGroups: [""]
          resources: ["persistentvolumes"]
          verbs: ["get", "list", "watch", "create", "delete"]
       -  apiGroups: [""]
          resources: ["persistentvolumeclaims"]
          verbs: ["get", "list", "watch", "update"]
       -  apiGroups: ["storage.k8s.io"]
          resources: ["storageclasses"]
          verbs: ["get", "list", "watch"]
       -  apiGroups: [""]
          resources: ["events"]
          verbs: ["watch", "create", "update", "patch"]
       -  apiGroups: [""]
          resources: ["services", "endpoints"]
          verbs: ["get","create","list", "watch","update"]
       -  apiGroups: ["extensions"]
          resources: ["podsecuritypolicies"]
          resourceNames: ["nfs-provisioner"]
          verbs: ["use"]
    ---
    kind: ClusterRoleBinding
    apiVersion: rbac.authorization.k8s.io/v1
    metadata:
      name: run-nfs-provisioner
    subjects:
      - kind: ServiceAccount
        name: nfs-provisioner
        namespace: default
    roleRef:
      kind: ClusterRole
      name: nfs-provisioner-runner
      apiGroup: rbac.authorization.k8s.io
    ---
    kind: Deployment
    apiVersion: apps/v1
    metadata:
      name: nfs-client-provisioner
    spec:
      selector:
        matchLabels:
          app: nfs-client-provisioner
      replicas: 1
      strategy:
        type: Recreate
      template:
        metadata:
          labels:
            app: nfs-client-provisioner
        spec:
          serviceAccount: nfs-provisioner
          containers:
            - name: nfs-client-provisioner
              image: quay.io/external_storage/nfs-client-provisioner:latest
              imagePullPolicy: IfNotPresent
              volumeMounts:
                - name: nfs-client
                  mountPath: /persistentvolumes
              env:
                - name: PROVISIONER_NAME
                  value: fuseim.pri/ifs
                - name: NFS_SERVER
                  value: 此处修改为nfs服务器ip
                - name: NFS_PATH
                  value: /home/data
          volumes:
            - name: nfs-client
              nfs:
                server: 此处修改为nfs服务器ip
                path: /home/data
    ---
    apiVersion: storage.k8s.io/v1
    kind: StorageClass
    metadata:
      name: nfs-storage
    provisioner: fuseim.pri/ifs
    reclaimPolicy: Retain
    

      5.设置默认storageclass(master节点)

           kubectl patch storageclass nfs-storage -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'

          

    7.最小化安装 KubeSphere(master节点)
    kubectl apply -f https://raw.githubusercontent.com/kubesphere/ks-installer/master/kubesphere-minimal.yaml

    8.查看安装日志
    kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f

  • 相关阅读:
    Linux 系统使用WordPress开启“固定链接设置”之后部分页面打不开(404)的解决办法
    WordPress安全配置
    去掉Windows2003的自动锁定
    用IP访问wordpress的css和js为何不能加载
    元素伸缩
    Cookie之获设删
    输入0开头的数字,自动纠正
    PHP入门(一)
    node.js(一)
    vue-demo-tab切换
  • 原文地址:https://www.cnblogs.com/gmmy/p/12168114.html
Copyright © 2011-2022 走看看