【Paspberry Pi】部署Kubernetes

abuliu · · 288 次点击 · · 开始浏览    
这是一个创建于 的文章,其中的信息可能已经有所发展或是发生改变。

运行环境

  • 树莓派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

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

288 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传