nwcdheap / kops-cn

AWS**宁夏区域/北京区域,快速Kops部署K8S集群

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

更換default AMI 使用Kops Debian官方AMI

pahud opened this issue · comments

根據這個thread, 目前default CoreOS AMI存在穩定性問題,包括Amazon Linux 2 AMI也有尚未解決的問題,我準備把default AMI改成Kops官方Deiban AMI, 目前在cn-north-1 and cn-northwest-1有看到這些Community AMI,但不確定是否為 kope.io 官方身分上傳 (參考這裡官方說明)

此外,根據這裡定義,目前建議版本應該是kope.io/k8s-1.12-debian-stretch-amd64-hvm-ebs-2019-05-13, 但這個image目前在北京寧夏Region都還找不到。

下面這兩個AMI可以被找到,但不確定是不是KOPS官方AMI,有可能是其他用戶自己打包上傳的,可能存在一些疑慮。

cn-north-1 ami-076828ef599fb3764
image

cn-northwest-1 ami-0b46e70fdcdae1aef
image

正在根據這篇文件說明,將海外 kope.io/k8s-1.12-debian-stretch-amd64-hvm-ebs-2019-05-13 這個kops default platform image搬到CN來試試看。

ref: https://github.com/kubernetes/kops/blob/bb4574b1d572d5e453c3570ebe06127d0adc3bda/channels/stable#L29-L31

已把海外官方鏡像搬進來,寧夏運行正常

image

我们最近新建集群的时候也遇到了这种情况,准备用你发的新AMI试试,不过我有个疑问,因为我们的新集群已经创建了,我要更改AMI是不是必须得把现在的集群删除重新创建呢还是可以edit然后update。

剛剛更新了Debian AMI

  • 把/etc/apt/sources.list更換成了國內的mirror,否則master無法InService
deb http://security.debian.org/ stretch/updates main
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security stretch/updates main contrib non-free

43e8d6a

已修改Makefile,現在開始改用Debian AMI

ifeq ($(TARGET_REGION) ,cn-north-1)
	CLUSTER_NAME ?= cluster.bjs.k8s.local
	# copy from kope.io/k8s-1.12-debian-stretch-amd64-hvm-ebs-2019-05-13
	# see https://github.com/nwcdlabs/kops-cn/issues/96
	AMI ?= ami-02dd4d384eb0e0b3a
	ZONES ?= cn-north-1a,cn-north-1b
endif

ifeq ($(TARGET_REGION) ,cn-northwest-1)
	CLUSTER_NAME ?= cluster.zhy.k8s.local
	# copy from kope.io/k8s-1.12-debian-stretch-amd64-hvm-ebs-2019-05-13
	# see https://github.com/nwcdlabs/kops-cn/issues/96
	AMI ?= ami-068b32c3754324d44
	ZONES ?= cn-northwest-1a,cn-northwest-1b,cn-northwest-1c
endif

實際測試,搭配最新kops-1.12.3沒問題

see #99

Debian AMI shipped.

@guohenghaha

我建議重新創建。