update component for k8s v1.19

pull/951/head
gjmzj 2020-11-06 20:17:38 +08:00
parent d7613a2091
commit 7316c24939
5 changed files with 20 additions and 19 deletions

View File

@ -4,7 +4,7 @@ dns_backend: "coredns"
# 设置 dns svc ip (这里选用 SERVICE_CIDR 中第2个IP) # 设置 dns svc ip (这里选用 SERVICE_CIDR 中第2个IP)
CLUSTER_DNS_SVC_IP: "{{ SERVICE_CIDR | ipaddr('net') | ipaddr(2) | ipaddr('address') }}" CLUSTER_DNS_SVC_IP: "{{ SERVICE_CIDR | ipaddr('net') | ipaddr(2) | ipaddr('address') }}"
kubednsVer: "1.14.13" kubednsVer: "1.14.13"
corednsVer: "1.6.7" corednsVer: "1.7.1"
kubedns_offline: "kubedns_{{ kubednsVer }}.tar" kubedns_offline: "kubedns_{{ kubednsVer }}.tar"
coredns_offline: "coredns_{{ corednsVer }}.tar" coredns_offline: "coredns_{{ corednsVer }}.tar"
dns_offline: "{%- if dns_backend == 'coredns' -%} \ dns_offline: "{%- if dns_backend == 'coredns' -%} \
@ -21,7 +21,7 @@ metricsserver_offline: "metrics-server_{{ metricsVer }}.tar"
# dashboard 自动安装 # dashboard 自动安装
# dashboard v2.x.x 不依赖于heapster # dashboard v2.x.x 不依赖于heapster
dashboard_install: "yes" dashboard_install: "yes"
dashboardVer: "v2.0.1" dashboardVer: "v2.0.4"
dashboard_offline: "dashboard_{{ dashboardVer }}.tar" dashboard_offline: "dashboard_{{ dashboardVer }}.tar"
dashboardMetricsScraperVer: "v1.0.4" dashboardMetricsScraperVer: "v1.0.4"
metricsscraper_offline: "metrics-scraper_{{ dashboardMetricsScraperVer }}.tar" metricsscraper_offline: "metrics-scraper_{{ dashboardMetricsScraperVer }}.tar"

View File

@ -6,7 +6,7 @@ FLANNEL_BACKEND: "vxlan"
DIRECT_ROUTING: false DIRECT_ROUTING: false
#flanneld_image: "quay.io/coreos/flannel:v0.10.0-amd64" #flanneld_image: "quay.io/coreos/flannel:v0.10.0-amd64"
flannelVer: "v0.12.0-amd64" flannelVer: "v0.13.0-amd64"
flanneld_image: "easzlab/flannel:{{ flannelVer }}" flanneld_image: "easzlab/flannel:{{ flannelVer }}"
# 离线镜像tar包 # 离线镜像tar包

View File

@ -17,11 +17,11 @@ MASTER_CERT_HOSTS:
# head -c 16 /dev/urandom | od -An -t x | tr -d ' ' # head -c 16 /dev/urandom | od -An -t x | tr -d ' '
# 例子: 02b50b05283e98dd0fd71db496ef01e8,kubelet-bootstrap,10001,"system:bootstrappers" # 例子: 02b50b05283e98dd0fd71db496ef01e8,kubelet-bootstrap,10001,"system:bootstrappers"
# 是否启用基础认证 yes/no # 是否启用基础认证 yes/no
BASIC_AUTH_ENABLE: 'no' BASIC_AUTH_ENABLE: 'yes'
# 用户名: # 用户名:
BASIC_AUTH_USER: 'admin' BASIC_AUTH_USER: 'admin'
# 密码:初次运行时会生成随机密码 # 密码:初次运行时会生成随机密码
BASIC_AUTH_PASS: '_pwd_' BASIC_AUTH_PASS: '92c068405aa491239b56140ea6b3b44b'
# node 节点上 pod 网段掩码长度决定每个节点最多能分配的pod ip地址 # node 节点上 pod 网段掩码长度决定每个节点最多能分配的pod ip地址
# 如果flannel 使用 --kube-subnet-mgr 参数那么它将读取该设置为每个节点分配pod网段 # 如果flannel 使用 --kube-subnet-mgr 参数那么它将读取该设置为每个节点分配pod网段

View File

@ -32,7 +32,7 @@
- block: - block:
- name: 生成 basic-auth 随机密码 - name: 生成 basic-auth 随机密码
shell: 'PWD=`head -c 16 /dev/urandom | od -An -t x | tr -d ' '`; \ shell: 'PWD=`head -c 16 /dev/urandom | od -An -t x | tr -d " "`; \
sed -i "s/_pwd_/$PWD/g" {{ base_dir }}/roles/kube-master/defaults/main.yml; \ sed -i "s/_pwd_/$PWD/g" {{ base_dir }}/roles/kube-master/defaults/main.yml; \
echo $PWD;' echo $PWD;'
connection: local connection: local

View File

@ -14,13 +14,22 @@ set -o errexit
#set -o xtrace #set -o xtrace
# default version, can be overridden by cmd line options # default version, can be overridden by cmd line options
export DOCKER_VER=19.03.8 export DOCKER_VER=19.03.13
export KUBEASZ_VER=2.2.1 export KUBEASZ_VER=2.2.2
export K8S_BIN_VER=v1.18.3 export K8S_BIN_VER=v1.19.3
export EXT_BIN_VER=0.5.2 export EXT_BIN_VER=0.6.0
export SYS_PKG_VER=0.3.3 export SYS_PKG_VER=0.3.3
export CONTAINERD_VER=1.2.6 export CONTAINERD_VER=1.2.6
# images needed by k8s cluster
export calicoVer=v3.8.8
export corednsVer=1.7.1
export dashboardVer=v2.0.4
export dashboardMetricsScraperVer=v1.0.4
export flannelVer=v0.13.0-amd64
export metricsVer=v0.3.6
export pauseVer=3.2
function download_docker() { function download_docker() {
echo -e "[INFO] \033[33mdownloading docker binaries\033[0m $DOCKER_VER" echo -e "[INFO] \033[33mdownloading docker binaries\033[0m $DOCKER_VER"
if [[ "$REGISTRY_MIRROR" == CN ]];then if [[ "$REGISTRY_MIRROR" == CN ]];then
@ -187,14 +196,6 @@ function get_sys_pkg() {
} }
function get_offline_image() { function get_offline_image() {
# images needed by k8s cluster
calicoVer=v3.8.8
corednsVer=1.6.7
dashboardVer=v2.0.1
dashboardMetricsScraperVer=v1.0.4
flannelVer=v0.12.0-amd64
metricsVer=v0.3.6
pauseVer=3.2
imageDir=/etc/ansible/down imageDir=/etc/ansible/down
[[ -d "$imageDir" ]] || { echo "[ERROR] $imageDir not existed!"; exit 1; } [[ -d "$imageDir" ]] || { echo "[ERROR] $imageDir not existed!"; exit 1; }
@ -261,7 +262,7 @@ function get_containerd_bin() {
fi fi
tar zxf /etc/ansible/down/cri-containerd-${CONTAINERD_VER}.linux-amd64.tar.gz -C /etc/ansible/down/containerd && \ tar zxf /etc/ansible/down/cri-containerd-${CONTAINERD_VER}.linux-amd64.tar.gz -C /etc/ansible/down/containerd && \
/bin/cp -f /etc/ansible/down/containerd/usr/local/bin/{containerd,containerd-shim,containerd-shim-runc-v1,containerd-shim-runc-v2,crictl,ctr} /etc/ansible/bin/containerd-bin && \ /bin/cp -f /etc/ansible/down/containerd/usr/local/bin/{containerd,containerd-shim,containerd-shim-runc-v1,crictl,ctr} /etc/ansible/bin/containerd-bin && \
/bin/cp -f /etc/ansible/down/containerd/usr/local/sbin/runc /etc/ansible/bin/containerd-bin && \ /bin/cp -f /etc/ansible/down/containerd/usr/local/sbin/runc /etc/ansible/bin/containerd-bin && \
rm -rf /etc/ansible/down/containerd rm -rf /etc/ansible/down/containerd
} }