溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

sealyun如何安裝k8s

發(fā)布時間:2021-11-26 11:03:07 來源:億速云 閱讀:477 作者:小新 欄目:大數(shù)據(jù)

小編給大家分享一下sealyun如何安裝k8s,相信大部分人都還不怎么了解,因此分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后大有收獲,下面讓我們一起去了解一下吧!

官網(wǎng)

https://sealyun.com/

安裝運行環(huán)境

使用腳本:

#!/bin/bash

yum remove -y docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-selinux \
docker-engine-selinux \
docker-engine

# update
yum -y update

# 設(shè)置 yum repository
yum install -y yum-utils \
device-mapper-persistent-data \
bash-completion \
lvm2
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

# 安裝并啟動 docker
#yum install -y docker-ce-18.09.7 docker-ce-cli-18.09.7 containerd.io
yum install -y docker-ce-19.03.8 docker-ce-cli-19.03.8 containerd.io
systemctl enable docker
systemctl start docker

# 安裝 nfs-utils
# 必須先安裝 nfs-utils 才能掛載 nfs 網(wǎng)絡(luò)存儲
yum install -y nfs-utils
yum install -y wget

# 關(guān)閉 防火墻
systemctl stop firewalld
systemctl disable firewalld

# 關(guān)閉 SeLinux
setenforce 0
sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config

# 關(guān)閉 swap
swapoff -a
yes | cp /etc/fstab /etc/fstab_bak
cat /etc/fstab_bak |grep -v swap > /etc/fstab

# 修改 /etc/sysctl.conf
# 如果有配置,則修改
sed -i "s#^net.ipv4.ip_forward.*#net.ipv4.ip_forward=1#g"  /etc/sysctl.conf
sed -i "s#^net.bridge.bridge-nf-call-ip6tables.*#net.bridge.bridge-nf-call-ip6tables=1#g"  /etc/sysctl.conf
sed -i "s#^net.bridge.bridge-nf-call-iptables.*#net.bridge.bridge-nf-call-iptables=1#g"  /etc/sysctl.conf
# 可能沒有,追加
echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf
echo "net.bridge.bridge-nf-call-ip6tables = 1" >> /etc/sysctl.conf
echo "net.bridge.bridge-nf-call-iptables = 1" >> /etc/sysctl.conf
# 執(zhí)行命令以應(yīng)用
sysctl -p

systemctl daemon-reload
systemctl restart docker

wget -c https://sealyun.oss-cn-beijing.aliyuncs.com/latest/sealos && \
chmod +x sealos

mv sealos /usr/bin

下載離線資源包

wget -c https://sealyun.oss-cn-beijing.aliyuncs.com/7b6af025d4884fdd5cd51a674994359c-1.18.0/kube1.18.0.tar.gz

安裝一個三master的kubernetes集群

ip地址按實際情況修改,主機要求 2核心 2G內(nèi)存 或以上

sealos init --passwd 123456 \
	--master 192.168.0.2  --master 192.168.0.3  --master 192.168.0.4  \
	--node 192.168.0.5 \
	--pkg-url /root/kube1.18.0.tar.gz \
	--version v1.18.0

增加2個master

sealos join --master 192.168.0.6 --master 192.168.0.7

安裝應(yīng)用

kuboard

wget https://github.com/sealstore/dashboard/releases/download/v1.0-1/kuboard.tar
sealos install --pkg-url kuboard.tar
# 查看密碼
kubectl get secret -nkube-system \
	$(kubectl get secret -n kube-system|grep kuboard-user-token |awk '{print $1}') \
	-o jsonpath='{.data.token}'  | base64 --decode
# 端口32567,用http

dashboard

wget https://github.com/sealstore/dashboard/releases/download/v2.0.0-bata5/dashboard.tar
sealos install --pkg-url dashboard.tar
# 查看密碼
kubectl get secret -nkubernetes-dashboard \
	$(kubectl get secret -n kubernetes-dashboard|grep dashboard-token |awk '{print $1}') \
	-o jsonpath='{.data.token}'  | base64 --decode
# 端口32000,用https

以上是“sealyun如何安裝k8s”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對大家有所幫助,如果還想學(xué)習(xí)更多知識,歡迎關(guān)注億速云行業(yè)資訊頻道!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

k8s
AI