快速从零开始搭建服务网格(ubuntu+docker+k8s+istio)

因为之前搭建过centos上的服务网格,所以这次用ubuntu来快速搭建新的服务网格。只重点说与在centos上不同的部分。
准备条件:三个ubuntu服务器

1 关闭防火墙

sudo ufw disable

出来提示

Firewall stopped and disabled on system startup

2 永久关闭swap

vi /etc/fstab

在swap分区这行前加 # 禁用掉,保存退出。重启

reboot

3 修改hosts

省略

4 安装docker18.09.7

sudo apt install docker.io

5 修改docker的cgroups

cat << EOF > /etc/docker/daemon.json
{
  "exec-opts": ["native.cgroupdriver=systemd"]
}
{
  "registy-mirrors":["https://alzgoonw.mirror.aliyuncs.com"]
}
EOF

然后

systemctl daemon-reload
systemctl restart docker

查看

docker info

6 安装k8s

k8s.gcr.io/kube-apiserver:v1.16.0
k8s.gcr.io/kube-controller-manager:v1.16.0
k8s.gcr.io/kube-scheduler:v1.16.0
k8s.gcr.io/kube-proxy:v1.16.0
k8s.gcr.io/pause:3.1
k8s.gcr.io/etcd:3.3.15-0
k8s.gcr.io/coredns:1.6.2
Your Kubernetes control-plane has initialized successfully!

To start using your cluster, you need to run the following as a regular user:

  mkdir -p $HOME/.kube
  sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
  sudo chown $(id -u):$(id -g) $HOME/.kube/config

You should now deploy a pod network to the cluster.
Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:
  https://kubernetes.io/docs/concepts/cluster-administration/addons/

Then you can join any number of worker nodes by running the following on each as root:

kubeadm join 192.168.2.110:6443 --token vr0kbo.skkph939nmaza1h5 \
    --discovery-token-ca-cert-hash sha256:0db28c0ce72e85d48cae5c116644a117b9a176f87f6ebad2e7e95277575c53d7 

7 其他流程和在centos上类似,这里不再赘述,其实两者差不多,主要就是一些命令格式上有些不同。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值