KubeSphere v3.4.0 部署K8S Docker + Prometheus + grafana

编程入门 行业动态 更新时间:2024-10-25 16:31:06

<a href=https://www.elefans.com/category/jswz/34/1751244.html style=KubeSphere v3.4.0 部署K8S Docker + Prometheus + grafana"/>

KubeSphere v3.4.0 部署K8S Docker + Prometheus + grafana

KubeSphere v3.4.0 部署K8S

  • 1、整体思路
  • 2、修改linux主机名
  • 3、 离线安装
    • 3.1 问题列表
    • 3.2 执行命令成功列表

1、整体思路

  • 将KubeSphere v3.4.0 安装包传输到其中一台机器
  • 修改Linux主机名(选取3台,修改为master01、master02、master03)
  • 安装官方文档安装

2、修改linux主机名

背景:一共7台机器,3台作为master,4台作为node

# 查看当前主机名
hostname
# 修改主机名
hostnamectl set-hostname master01
hostnamectl set-hostname node01

分别进入3台 master机器,修改主机名为master01、master02、master03
分别进入4从节点台机,修改主机名为noder01、node02、node03

3、 离线安装

参考地址:.4/installing-on-linux/introduction/air-gapped-installation/

3.1 问题列表

  • 问题1:不支持版本

    ** kubesphere 3.3.1对应 kubernetes版本是1.22.12**
  • 重要:registry 的type 设置成 harbor;address 和 internalAddress 设置成同样的ip

    问题2: 需要设置对应ip的用户名密码

    问题3: 创建harbor 提示 “未授权”

    解决:
    在config-sample.yaml 修改如下:
  ...registry:type: harborauths:"dockerhub.kubekey.local":username: adminpassword: Harbor12345privateRegistry: "dockerhub.kubekey.local"namespaceOverride: "kubesphereio"registryMirrors: []insecureRegistries: []addons: []

重要: 密码不能变,必须是Harbor12345

3.2 执行命令成功列表

  • 将下载的 KubeKey 和制品 artifact 通过 U 盘等介质拷贝至离线环境安装节点。
  • 执行以下命令创建离线集群配置文件:
./kk create config --with-kubesphere v3.3.1 --with-kubernetes v1.23.15 -f config-sample.yaml


修改 config-sample.yaml 文件,3个master,4个node。kubernetes版本改为1.22.12.

  • 执行以下命令安装镜像仓库
./kk init registry -f config-sample.yaml -a kubesphere.tar.gz

  • 创建 Harbor 项目。
vim create_project_harbor.sh

在harbor_projects 的 library 中添加自己的代码仓库,如testTeam

#!/usr/bin/env bashurl=""  #修改url的值为="admin"passwd="Harbor12345"harbor_projects=(librarykubesphereiokubesphereargoprojcalicocorednsopenebscsipluginminiomirrorgooglecontainersosixiapromthanosiojimmidysongrafanaelasticistiojaegertracingjenkinsweaveworksopenpitrixjoosthofmannginxdemosfluentkubeedgeopenpolicyagenttestTeam)for project in "${harbor_projects[@]}"; doecho "creating $project"curl -u "${user}:${passwd}" -X POST -H "Content-Type: application/json" "${url}/api/v2.0/projects" -d "{ \"project_name\": \"${project}\", \"public\": true}" -k #curl命令末尾加上 -kdone

执行创建Harbor脚本

./create_project_harbor.sh

结果:

  • 执行以下命令安装 KubeSphere 集群

  • 执行以下命令查看集群状态
kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l 'app in (ks-install, ks-installer)' -o jsonpath='{.items[0].metadata.name}') -f


访问界面:

更多推荐

KubeSphere v3.4.0 部署K8S Docker + Prometheus + grafana

本文发布于:2023-11-15 23:56:01,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1610113.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:KubeSphere   K8S   grafana   Prometheus   Docker

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!