TipsOnArm64K8s

TurnToJPG -->


系统安装

镜像为ubuntu16.04.3-server-arm64.iso, 安装盘用于安装系统, 预先需要配置为光盘启动:

/images/2018_10_19_10_32_17_425x261.jpg

安装引导界面, 选择HWE Kernel:

/images/2018_10_19_10_34_10_603x406.jpg

选择"Install Ubuntu Server”:

/images/2018_10_19_10_34_55_524x254.jpg

语言:

/images/2018_10_19_10_35_41_454x433.jpg

国家:

/images/2018_10_19_10_35_51_301x314.jpg

keyboard:

/images/2018_10_19_10_36_05_401x393.jpg

配置下主机名:

/images/2018_10_19_10_40_17_719x239.jpg

用户名/密码配置test/xxxker

之后就是一直安装,直到结束。

进入系统后,配置IP地址,需要手工检测网络是否联通:

/images/2018_10_19_11_06_46_423x302.jpg

Enable root用户,且设置opensshd的root用户登录权限,而后重新启动系统供下步配置使用。

配置系统

关闭swap分区,

# swapoff -a
# vim /etc/fatab
注释掉swap分区。
# lvremove /dev/mapper/armk8s--vg-swap_1
# lvextend -l +100%FREE /dev/mapper/armk8s--vg-root
# resize2fs /dev/mapper/armk8s--vg-root

从互联网上下载整个 arm repo的mirror包,大约60G, 而后修改/etc/apt/sources.list如下:

deb http://192.192.189.128:8000/ xenial main restricted universe multiverse
deb http://192.192.189.128:8000/ xenial-security main restricted universe multiverse
deb http://192.192.189.128:8000/ xenial-updates main restricted universe multiverse
deb http://192.192.189.128:8000/ xenial-proposed main restricted universe multiverse
deb http://192.192.189.128:8000/ xenial-backports main restricted universe multiverse

现在运行apt-get update可以安装包, 例如apt-get install nethogs.

安装docker:

# apt-get install docker.io
# docker version

/images/2018_10_19_11_34_09_488x421.jpg

离线下载deb包,传送到服务器,而后运行:

/images/2018_10_19_12_25_37_995x185.jpg

镜像准备

下载所需镜像并传送到机器:

docker pull k8s.gcr.io/kube-apiserver-arm64:v1.11.2
docker pull k8s.gcr.io/kube-controller-manager-arm64:v1.11.2
docker pull k8s.gcr.io/kube-scheduler-arm64:v1.11.2
docker pull k8s.gcr.io/kube-proxy-arm64:v1.11.2
docker pull k8s.gcr.io/etcd-arm64:3.2.18
docker pull k8s.gcr.io/pause:3.1
docker pull k8s.gcr.io/coredns:1.1.3
docker pull weaveworks/weave-npc:2.4.1
docker pull weaveworks/weave-kube:2.4.1
docker pull k8s.gcr.io/kubernetes-dashboard-arm:v1.10.0

构建过程:

# kubeadm init --apiserver-advertise-address 192.192.190.95 --kubernetes-version=v1.11.2
# mkdir -p ~/.kube
# cp -i /etc/kubernetes/admin.conf ~/.kube/config
# chown $(id -u):$(id -g) /root/.kube/config
# export kubever=$(kubectl version | base64 | tr -d '\n')
# kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$kubever"
# wget https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard-arm.yaml
# kubectl apply -f kubernetes-dashboard-arm.yaml
# kubectl create clusterrolebinding cluster-admin-fordashboard --clusterrole=cluster-admin --user=system:serviceaccount:kube-system:kubernetes-dashboard

Monitoring:

# git clone https://github.com/kubernetes/heapster.git
# cd heapster/deploy/kube-config/influxdb
# cp heapster.yaml heapster_arm.yaml
# cp influxdb.yaml influxdb_arm.yaml
# cp grafana.yaml grafana_arm.yaml
Change from amd64 to arm64
# kubectl create -f *_arm.yaml

This monitoring will not working OK. why?