自学内容网 自学内容网

KubeKey安装K8s和kubesphere

安装指南

在 Linux 上安装 Kubernetes 和 KubeSphere

卸载 Kubernetes 和 KubeSphere

前置工作-网络问题

 yum -y install socat conntrack etables ipset
alias kk='kubectl -n kubesphere-system'
export http_proxy=10.10.x.x:7890
export https_proxy=10.10.x.x:7890

Docker设置网络代理:https://blog.csdn.net/qq_37320062/article/details/141964953 不行

vim /lib/systemd/system/docker.service
[Service]
Environment="HTTP_PROXY=http://10.10..x.x:7890"
Environment="HTTPS_PROXY=https://10.10.x.x:7890"
systemctl daemon-reload
systemctl restart docker
docker info

Docker镜像源拉取失败超时:https://blog.csdn.net/m0_37899908/article/details/145090710 牛逼

vim /etc/docker/daemon.json
{
        "exec-opts":["native.cgroupdriver=systemd"],
        "insecure-registries":["0.0.0.0/0"],
        "log-driver": "json-file",
        "log-opts": {
            "max-size": "100m"
        },
        "storage-driver": "overlay2",
        "live-restore": true,
        "registry-mirrors": [
          "https://2a6bf1988cb6428c877f723ec7530dbc.mirror.swr.myhuaweicloud.com",
          "https://docker.m.daocloud.io",
          "https://hub-mirror.c.163.com",
          "https://mirror.baidubce.com",
          "https://your_preferred_mirror",
          "https://dockerhub.icu",
          "https://docker.registry.cyou",
          "https://docker-cf.registry.cyou",
          "https://dockercf.jsdelivr.fyi",
          "https://docker.jsdelivr.fyi",
          "https://dockertest.jsdelivr.fyi",
          "https://mirror.aliyuncs.com",
          "https://dockerproxy.com",
          "https://mirror.baidubce.com",
          "https://docker.m.daocloud.io",
          "https://docker.nju.edu.cn",
          "https://docker.mirrors.sjtug.sjtu.edu.cn",
          "https://docker.mirrors.ustc.edu.cn",
          "https://mirror.iscas.ac.cn",
          "https://docker.rainbond.cc"
          ]
}
systemctl daemon-reload
systemctl restart docker
docker info

安装K8s

mkdir kubesphere
export KKZONE=cn
curl -sfL https://get-kk.kubesphere.io | VERSION=v3.1.7 bash -
chmod +x kk
cat ksp-k8s-v12410.yaml
apiVersion: kubekey.kubesphere.io/v1alpha2
kind: Cluster
metadata:
  name: ycylab
spec:
  hosts:
  - {name: ksp-control-1, address: 172.30.30.x, internalAddress: 172.30.30.x, user: root, password: "xxxxxx"}
  roleGroups:
    etcd:
    - ksp-control-1
    control-plane:
    - ksp-control-1
    worker:
    - ksp-control-1
  controlPlaneEndpoint:
    ## Internal loadbalancer for apiservers
    internalLoadbalancer: haproxy
    domain: lb.ycylab.cn
    address: ""
    port: 6443
  kubernetes:
    version: v1.24.10
    clusterName: ycylab.cn
    #dnsDomain: opsxlab.cn
    autoRenewCerts: true
    containerManager: containerd
  etcd:
    type: kubekey
  network:
    plugin: calico
    kubePodsCIDR: 10.233.64.0/18
    kubeServiceCIDR: 10.233.0.0/18
    ## multus support. https://github.com/k8snetworkplumbingwg/multus-cni
    multusCNI:
      enabled: false
  storage:
    openebs:
      basePath: /opt/qfusion # 默认没有的新增配置,base path of the local PV
  registry:
    privateRegistry: "registry.cn-beijing.aliyuncs.com" #使用 KubeSphere 在阿里云的镜像仓库
    namespaceOverride: "kubesphereio"
    registryMirrors: []
    insecureRegistries: []
  addons: []

./kk create cluster -f ksp-k8s-v12410.yaml
cp /etc/kubernetes/kubeadm.conf /etc/kubernetes/kubeadm-config.yaml
cp /usr/bin/kubectl /usr/local/bin/kubectl
cp /usr/bin/kubeadm /usr/local/bin/kubeadm

./kk create cluster --with-kubesphere v3.3.1 --with-kubernetes v1.24.10

在这里插入图片描述

安装K8s和kubesphere

./kk create cluster --with-kubesphere v3.3.1 --with-kubernetes v1.24.10 --container-manager containerd

在这里插入图片描述

在这里插入图片描述
在这里插入图片描述


原文地址:https://blog.csdn.net/hezuijiudexiaobai/article/details/145234589

免责声明:本站文章内容转载自网络资源,如侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!