【Paspberry Pi】部署Kubernetes


本文摘自网络,作者,侵删。

运行环境

  • 树莓派4B 4核8G
  • CentOS 7

关闭SELinux和Firewalld

getenforce
cat /etc/sysconfig/selinux
systemctl status firewalld
systemctl stop firewalld
systemctl disable firewalld

关闭SSH usedns

cat /etc/ssh/sshd_config
systemctl restart sshd

换源

sed -e 's|^mirrorlist=|#mirrorlist=|g' -e 's|^#baseurl=http://mirror.centos.org/altarch/|baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-altarch/|g' -e 's|^#baseurl=http://mirror.centos.org/$contentdir/|baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-altarch/|g'  -i.bak /etc/yum.repos.d/CentOS-*.repo
yum clean all
yum repolist
yum makecache

生成密钥&放置密钥

ssh-keygen -C "root@pi.abu.pub"
ssh-copy-id 127.0.0.1

修改时区

ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

关闭交换分区

cat /etc/fstab

安装命令提示

yum install bash-com* -y

查看WiFi

nmcli device wifi

连接WiFi

nmcli connection modify f66add19-f3d4-3b93-811b-26d8915273e6 con-name eth0
nmcli device wifi connect "Serverless" password "123456" name wlan0
nmcli connection modify wlan0 ipv4.method manual ipv4.addresses 192.168.1.50/24
nmcli connection modify wlan0 ipv4.gateway 192.168.1.1
nmcli connection modify wlan0 ipv4.dns-search abu.pub
nmcli connection modify wlan0 autoconnect yes
nmcli connection down wlan0
nmcli connection up wlan0

配置EPEL源

yum install wget
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

配置Kubernetes源

cat << EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
EOF

安装Docker-CE

yum install yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
sed -i s%download.docker.com%mirrors.aliyun.com/docker-ce%g /etc/yum.repos.d/docker-ce.repo
yum install docker-ce docker-ce-cli -y
systemctl enable docker
systemctl start docker
docker version
mkdir -p /etc/docker
tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://yln6o2wd.mirror.aliyuncs.com"]
}
EOF
systemctl daemon-reload
systemctl restart docker
docker pull hello-world
docker images
docker run --rm hello-world
docker ps -a
docker system prune -a

安装Golang

wget -O go1.15.7.src.tgz https://golang.google.cn/dl/go1.15.7.src.tar.gz
wget -O go1.15.7.linux-arm64.tar.gz https://dl.google.com/go/go1.15.7.linux-arm64.tar.gz
tar -C /usr/local/ -xvzf go1.15.7.linux-arm64.tar.gz
export PATH=$PATH:/usr/local/go/bin
go version

安装Etcd

wget -O etcd-v3.4.14.src.tgz https://github.com/etcd-io/etcd/archive/v3.4.14.tar.gz
yum install etcd -y
cat /etc/etcd/etcd.conf
etcd --version
etcdctl set /testdir/testkey "Hello world"
etcdctl get /testdir/testkey
etcdctl update /testdir/testkey "Hello"
etcdctl rm /testdir/testkey
etcdctl ls
etcdctl member list

安装基础工具

yum install git -y

安装Kubernetes


本文来自:简书

感谢作者:abuliu

查看原文:【Paspberry Pi】部署Kubernetes

相关阅读 >>

Golang返回错误时如何正确处理

聊聊dubbo-Go-proxy的route

快看!Go-carbon 1.2.2 版本发布了!新增了时间设置和时间差比较功能

Go的声明语法为什么是这样

Golang标准库database连接池实现

如何使用Golang的pprof包对程序进行性能分析

Golang能写操作系统吗

Go语言学习9-结构体类型

聊聊Gost的Gounterminated

搭建coolpy+mqtt 服务

更多相关阅读请进入《Go》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...