首页 > 其他分享 >欧拉OpenEuler基于Kubeasz部署k8s.250114

欧拉OpenEuler基于Kubeasz部署k8s.250114

时间:2025-01-14 11:32:51浏览次数:1  
标签:PRD cluster Kubeasz ezctl 172.62 k8s1.27 k8s.250114 OpenEuler setup

欧拉OpenEuler基于Kubeasz部署k8s

系统优化

修改主机名

hostnamectl set-hostname PRD-MS-K8S01

vim /etc/hosts
172.62.17.101 PRD-MS-K8S01
172.62.17.102 PRD-MS-K8S02
172.62.17.103 PRD-MS-K8S03

关闭防火墙

systemctl stop firewalld
systemctl disable firewalld

关闭selinux

sed -ri 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
setenforce 0

配置SSH免密登录

ssh-keygen -t rsa
免密到Kubernetes01:
ssh-copy-id PRD-MS-K8S01
免密到Kubernetes02:
ssh-copy-id PRD-MS-K8S02
免密到Kubernetes03:
ssh-copy-id PRD-MS-K8S03
验证免密登录
ssh root@PRD-MS-K8S02

以上步骤所有节点全部操作一遍,然后在主节点进行以下操作。

安装 ansible

yum -y install vconfig
yum install -y ansible

下载kubeasz3.6
wget https://github.com/easzlab/kubeasz/releases/download/3.6.0/ezdown
chmod +x ./ezdown
./ezdown -D
docker images | wc -l
ezctl new k8s1.27.1-cluster
cd /etc/kubeasz/clusters/k8s1.27.1-cluster/

vim hosts
[etcd]
172.62.17.101
172.62.17.102
172.62.17.103

[kube_master]
172.62.17.101 k8s_nodename='prd-ms-k8s01'

[kube_node]
172.62.17.101 k8s_nodename='prd-ms-k8s01'
172.62.17.102 k8s_nodename='prd-ms-k8s02'
172.62.17.103 k8s_nodename='prd-ms-k8s03'

安装K8S
cd /etc/kubeasz
ezctl setup k8s1.27.1-cluster all

./ezctl setup --help (可以看到每步具体安装什么)
./ezctl setup k8s1.27.1-cluster 01 ---》 系统环境 初始化
./ezctl setup k8s1.27.1-cluster 02 ---》安装etcd 集群

etcd 集群验证
export NODE_IPS="17
2.62.17.101 172.62.17.102 172.62.17.103"

for ip in ${NODE_IPS}; do ETCDCTL_API=3 etcdctl --endpoints=https://${ip}:2379 --cacert=/etc/kubernetes/ssl/ca.pem --cert=/etc/kubernetes/ssl/etcd.pem --key=/etc/kubernetes/ssl/etcd-key.pem endpoint health; done

结果
https://172.62.17.101:2379 is healthy: successfully committed proposal: took = 31.443754ms
https://172.62.17.102:2379 is healthy: successfully committed proposal: took = 37.993094ms
https://172.62.17.103:2379 is healthy: successfully committed proposal: took = 42.216398ms

./ezctl setup k8s1.27.1-cluster 03 ---》 安装 容器运行时runtime
ps -ef |grep container

./ezctl setup k8s1.27.1-cluster 04 ---》 安装master
ps -ef |grep kube

./ezctl setup k8s1.27.1-cluster 05 ---》 安装node
kubectl get node

./ezctl setup k8s1.27.1-cluster 06 ---》 安装网络插件
kubectl get pod -n kube-system

./ezctl setup k8s1.27.1-cluster 07 ---》 安装系统的其它应用插件
kubectl get pod -n kube-system

kubectl get svc -kube-system
kubernetes-dashboard NodePort 10.68.136.202 443:32444/TCP 2m45s
https://172.62.17.101:32444/

kubectl set env daemonset/calico-node -n kube-system IP_AUTODETECTION_METHOD=interface=ens18
daemonset.apps/calico-node env updated

标签:PRD,cluster,Kubeasz,ezctl,172.62,k8s1.27,k8s.250114,OpenEuler,setup
From: https://www.cnblogs.com/amadeuslee/p/18670447

相关文章

  • Windows 11 Hyper-V 运行WSL2(Windows Subsystem for Linux ) openEuler 从 22.09升级24
    版本  Windows11专业版版本号  22H2安装日期  ‎2023/‎3/‎19操作系统版本  22621.4387体验  WindowsFeatureExperiencePack1000.22700.1047.0-[archives.openeuler.openatom.cn/openEuler-22.09/everything/x86\_64/](https://archives.openeuler.o......
  • 欧拉OpenEuler使用nfs和rsync复制文件夹到新服务器.250109
    案例:服务器A是新服务器服务器B为老服务器需要将服务器B的/data/storage,拷贝到服务器A的/home/sync-data下一、服务器A新服务器配置nfs1.安装nfssystemctlstopfirewallddf-hmkdir-p/home/sync-datayuminstallnfs-utilssystemctlstatusnfs-serv......
  • openEuler升级到openssh9.9p1,openssl3.4.0(20250107更新)
    ​测试成功系统:       升级前最好在测试环境先本地测试后再使用       测试环境系统都是全新系统(只做了关闭firewalld,selinux等基础初始化操作,也可以使用我前面发的linux系统初始化脚本)       本次脚本支持离线安装和在线下载安装包安装   ......
  • openEuler欧拉部署Redis.240108
    一、系统优化关闭防火墙systemctlstopfirewalldsystemctldisablefirewalld关闭selinuxsed-ri's/SELINUX=enforcing/SELINUX=disabled/'/etc/selinux/configsetenforce0​二、安装Redisdnf-yinstallredisvim/etc/redis.conf#bind127.0.0.1bind0.0.0.0pr......
  • openEuler欧拉部署Harbor.240108
    ​一、系统优化关闭防火墙systemctlstopfirewalldsystemctldisablefirewalld二、安装Harborwgethttps://github.com/goharbor/harbor/releases/download/v2.8.1/harbor-offline-installer-v2.8.1.tgztarxvfharbor-offline-installer-v2.8.1.tgzdf-hmvharbor//ho......
  • openEuler欧拉使用sshpass不输入密码远程登录其他服务器.240108
    ​​ssh登陆不能在命令行中指定密码,sshpass的出现则解决了这一问题。用-p参数指定明文密码,然后直接登录远程服务器,它支持密码从命令行、文件、环境变量中读取。操作步骤:一、关闭防火墙systemctlstopfirewalldsystemctldisablefirewalld二、安装sshpassdnf-yinstall......
  • openEuler欧拉系统重置root密码.240108
    步骤:系统启动时,出现如下页面,按e进入内核编辑模式进入如下页面按下光标后,找到linux开头这一行,修改ro为rw,并在行尾添加init=/bin/sh,修改后效果如下,在crtl+x保存后开始进入如下页面执行修改密码操作,指令如下#修改root密码命令echo'87654321'|passwd--stdinr......
  • openEuler欧拉配置MySQL8的MGR单主双从.240108
    ​一、系统优化(三个节点全部操作)关闭防火墙systemctlstopfirewalldsystemctldisablefirewalld关闭selinuxecho"SELINUX=disabled">/etc/selinux/configecho"SELINUXTYPE=targeted">>/etc/selinux/configcat/etc/selinux/configsetenforce0设置......
  • openEuler欧拉安装Gitlab.240109
    1.安装GitLabwgethttps://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.shsudoos=eldist=8bash./script.rpm.shsudoEXTERNAL_URL="http://xxx.xxx.xx.xx"yuminstall-ygitlab-ce2.查启动状态,等待个二十来分钟gitlab-ctltail3.关......
  • openEuler-怎么看服务器操作系统是不是欧拉系统?.240109
    ​[root@localhost~]#cat/etc/os-releaseNAME="openEuler"VERSION="22.03(LTS-SP2)"ID="openEuler"VERSION_ID="22.03"PRETTY_NAME="openEuler22.03(LTS-SP2)"ANSI_COLOR="0;31"lsb_release-a有些发......