kubekey安装K8s环境笔记

说明

简要说明

https://github.com/kubesphere/kubekey
https://github.com/kubesphere/ks-install

下载kubekey

https://github.com/kubesphere/kubekey/releases/download/v1.0.0/kubekey-v1.0.0-linux-amd64.tar.gz
https://github.com/kubesphere/ks-install

执行安装k8s集群

yum -y install socat
yum -y install epel-release
yum -y install conntrack-tools


./kk create cluster --with-kubesphere

检查存储storageclass

kubectl get sc

创建本地存储卷 sc.yaml。

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: local-storage
  annotations: 
    storageclass.kubernetes.io/is-default-class: "true"
provisioner: openebs.io/local
volumeBindingMode: WaitForFirstConsumer
kubectl apply -f kubesphere-installer.yaml

kubectl apply -f cluster-configuration.yaml

查看安装KubeSphere日志:

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

由于kubesphere依赖很多组件,安装过程有点长,要耐心等待。

检查30880端口是否启用了

kubectl get svc/ks-console -n kubesphere-system

默认的密码:admin/P@88w0rd
来源: 雨林博客(www.yl-blog.com)