忘忧的小站

  • 首页
  • 文章归档
  • 日志
  • 关于页面

  • 搜索
分布式索引 索引 全文搜索 Lucene.Net GPS 音视频 过滤 AOP 时区 升级 ABP.Zero 数据备份 linux 阿里云盘 aliyunpan 面试题 Signalr S 汉字 css html 前端 拼音键盘 在线键盘 uniapp .Net Core XMLRPC Serilog LOKI Nlog 分布式日志 加密 总结 人生 Asp.Net Core Swagger Web Element-plus Quasar 匹配 JavaScript 正则 .Net 后台 架构师 Redis EF CORE MySQL 自考 英语 集群 Jenkins CI/DI 内网穿透 代理 ABP 学习 后端 软考

k8s集群安装教程 基于Kubesphere

发表于 2021-11-15 | 分类于 .Net Core | 0 | 阅读次数 1270

KubeSphere官网

服务器信息

nameip
master192.168.40.153
node1192.168.40.161
node2192.168.40.162

准备工作 执行下列代码,在每一台服务器上

yum update -y 
yum install -y chrony 
systemctl enable chronyd
systemctl start chronyd
timedatectl set-ntp true
timedatectl set-timezone Asia/Shanghai
chronyc activity -v
iptables -F
systemctl status firewalld
systemctl stop firewalld
systemctl disable firewalld
yum install openssl openssl-devel -y
yum install socat -y
yum install epel-release -y
yum install conntrack-tools -y

生成配置文件

export KKZONE=cn
curl -sfL https://get-kk.kubesphere.io | VERSION=v1.0.1 sh -
chmod +x kk
./kk create config --with-kubesphere v3.0.0
vim config-sample.yaml

这时在当前目录下就创建一个config-sample.yaml
我们使用vim 将配置文件修改为


apiVersion: kubekey.kubesphere.io/v1alpha1
kind: Cluster
metadata:
  name: sample
spec:
  hosts:
  - {name: master, address: 192.168.40.153, internalAddress: 192.168.40.153, user: root, password: '8'}
  - {name: node1, address: 192.168.40.161, internalAddress: 192.168.40.161, user: root, password: '8'}
  - {name: node2, address: 192.168.40.162, internalAddress: 192.168.40.162, user: root, password: '8'}
  roleGroups:
    etcd:
    - master
    master: 
    - master
    worker:
    - master
    - node1
    - node2
  controlPlaneEndpoint:
    domain: lb.kubesphere.local
    address: ""
    port: "6443"
  kubernetes:
    version: v1.17.9
    imageRepo: kubesphere
    clusterName: cluster.local
  network:
    plugin: calico
    kubePodsCIDR: 10.233.64.0/18
    kubeServiceCIDR: 10.233.0.0/18
  registry:
    registryMirrors: []
    insecureRegistries: []
  addons: []


---
apiVersion: installer.kubesphere.io/v1alpha1
kind: ClusterConfiguration
metadata:
  name: ks-installer
  namespace: kubesphere-system
  labels:
    version: v3.0.0

vim保存退出 :wq!

./kk create cluster -f config-sample.yaml //开始安装

整个过程大概20分钟

安装完成

#####################################################
###              Welcome to KubeSphere!           ###
#####################################################

Console: http://192.168.40.153:30880
Account: admin
Password: P@88w0rd

NOTES:
  1. After logging into the console, please check the
     monitoring status of service components in
     the "Cluster Management". If any service is not
     ready, please wait patiently until all components
     are ready.
  2. Please modify the default password after login.

#####################################################
https://kubesphere.io             20xx-xx-xx xx:xx:xx
#####################################################

管理员密码重置

admin密码太难输了,直接重置admin密码 将密码重置为123456

kubectl patch users admin -p '{"spec":{"password":"123456"}}' --type='merge' && kubectl annotate users admin iam.kubesphere.io/password-encrypted- 

启用 kubectl 自动补全

yum -y install epel-release
yum install bash-completion bash-completion-extras -y
locate bash_completion.sh
updatedb
source /etc/profile.d/bash_completion.sh
logout //登出后重新登录
echo 'source <(kubectl completion bash)' >>~/.bashrc
kubectl completion bash >/etc/bash_completion.d/kubectl

  • 本文作者: 忘忧
  • 本文链接: /archives/42
  • 版权声明: 本博客所有文章除特别声明外,均采用CC BY-NC-SA 3.0 许可协议。转载请注明出处!
# 后端 # 集群
从零开始的CI/DI Jenkins集成docker+.NetCore自动化发布
.Net Core Replace First 方法
  • 文章目录
  • 站点概览
忘忧

忘忧

君子藏器于身,待时而动,何不利之有

44 日志
6 分类
60 标签
RSS
Github E-mail StackOverflow
Creative Commons
0%
© 2025 忘忧
由 Halo 强力驱动