mirror of https://github.com/easzlab/kubeasz.git
废弃ansible hosts变量K8S_VER,改为自动识别
parent
64350c4b5c
commit
bf2c9353b5
|
@ -2,7 +2,7 @@
|
|||
|
||||
集群升级存在一定风险,请谨慎操作。
|
||||
|
||||
- 项目分支`master`安装的集群可以在k8s 1.8/1.9/1.10/1.11/1.12/1.13 任意小版本、大版本间升级(特别注意如果跨大版本升级需要修改/etc/ansible/hosts文件中的参数K8S_VER)
|
||||
- 项目分支`master`安装的集群可以在k8s 1.8/1.9/1.10/1.11/1.12/1.13 任意小版本、大版本间升级
|
||||
- 项目分支`closed`(已停止更新)安装的集群目前只能进行小版本1.8.x的升级
|
||||
|
||||
### 备份etcd数据
|
||||
|
|
|
@ -62,9 +62,6 @@
|
|||
#集群部署模式:allinone, single-master, multi-master
|
||||
DEPLOY_MODE=multi-master
|
||||
|
||||
#集群主版本号,目前支持: v1.8, v1.9, v1.10,v1.11,v1.12
|
||||
K8S_VER="v1.11"
|
||||
|
||||
# 创建内网云负载均衡,然后配置:前端监听 tcp 8443,后端 tcp 6443,后端节点即 master 节点
|
||||
MASTER_IP="10.1.0.200" # 即负载均衡内网地址
|
||||
KUBE_APISERVER="https://{{ MASTER_IP }}:8443"
|
||||
|
|
|
@ -28,9 +28,6 @@
|
|||
#集群部署模式:allinone, single-master, multi-master
|
||||
DEPLOY_MODE=allinone
|
||||
|
||||
#集群主版本号,目前支持: v1.8, v1.9, v1.10,v1.11, v1.12, v1.13
|
||||
K8S_VER="v1.10"
|
||||
|
||||
#集群 MASTER IP,自动生成
|
||||
MASTER_IP="{{ groups['kube-master'][0] }}"
|
||||
KUBE_APISERVER="https://{{ MASTER_IP }}:6443"
|
||||
|
|
|
@ -29,9 +29,6 @@
|
|||
# Cluster Deployment Mode: allinone, single-master, multi-master
|
||||
DEPLOY_MODE=allinone
|
||||
|
||||
# Versions supported: v1.8, v1.9, v1.10, v1.11, v1.12, v1.13
|
||||
K8S_VER="v1.10"
|
||||
|
||||
# Cluster's Master IP, auto generated
|
||||
MASTER_IP="{{ groups['kube-master'][0] }}"
|
||||
KUBE_APISERVER="https://{{ MASTER_IP }}:6443"
|
||||
|
|
|
@ -27,9 +27,6 @@
|
|||
#集群部署模式:allinone, single-master, multi-master
|
||||
DEPLOY_MODE=multi-master
|
||||
|
||||
#集群主版本号,目前支持: v1.8, v1.9, v1.10,v1.11, v1.12, v1.13
|
||||
K8S_VER="v1.10"
|
||||
|
||||
# 公有云上一般都有提供负载均衡产品,且不允许自己创建lb
|
||||
# 创建公有云内网负载均衡,然后配置:前端监听 tcp 8443,后端 tcp 6443,后端节点即 master 节点
|
||||
MASTER_IP="192.168.1.10" # 即负载均衡内网地址
|
||||
|
|
|
@ -28,9 +28,6 @@
|
|||
# Cluster Deployment Mode: allinone, single-master, multi-master
|
||||
DEPLOY_MODE=multi-master
|
||||
|
||||
# Versions supported: v1.8, v1.9, v1.10, v1.11, v1.12, v1.13
|
||||
K8S_VER="v1.10"
|
||||
|
||||
# use loadballance service by the Cloud Providor, no 'lb' nodes needed
|
||||
# cloud loadballance service: listen on tcp 8443, with kube-masters(apiservers) as backend servers
|
||||
MASTER_IP="192.168.1.10"
|
||||
|
|
|
@ -37,9 +37,6 @@
|
|||
#集群部署模式:allinone, single-master, multi-master
|
||||
DEPLOY_MODE=multi-master
|
||||
|
||||
#集群主版本号,目前支持: v1.8, v1.9, v1.10,v1.11, v1.12, v1.13
|
||||
K8S_VER="v1.10"
|
||||
|
||||
# 集群 MASTER IP即 LB节点VIP地址,为区别与默认apiserver端口,设置VIP监听的服务端口8443
|
||||
# 公有云上请使用云负载均衡内网地址和监听端口
|
||||
MASTER_IP="192.168.1.10"
|
||||
|
|
|
@ -38,9 +38,6 @@
|
|||
# Cluster Deployment Mode: allinone, single-master, multi-master
|
||||
DEPLOY_MODE=multi-master
|
||||
|
||||
# Versions supported: v1.8, v1.9, v1.10, v1.11, v1.12, v1.13
|
||||
K8S_VER="v1.10"
|
||||
|
||||
# Cluster's Master IP, generated by 'keepalived' daemon on a 'lb' node here
|
||||
# 'haproxy' daemon listens on port 8443, directs requests to real apiservers on port 6443
|
||||
MASTER_IP="192.168.1.10"
|
||||
|
|
|
@ -29,9 +29,6 @@
|
|||
#集群部署模式:allinone, single-master, multi-master
|
||||
DEPLOY_MODE=single-master
|
||||
|
||||
#集群主版本号,目前支持: v1.8, v1.9, v1.10,v1.11, v1.12, v1.13
|
||||
K8S_VER="v1.11"
|
||||
|
||||
#集群 MASTER IP,自动生成
|
||||
MASTER_IP="{{ groups['kube-master'][0] }}"
|
||||
KUBE_APISERVER="https://{{ MASTER_IP }}:6443"
|
||||
|
|
|
@ -30,9 +30,6 @@
|
|||
# Cluster Deployment Mode: allinone, single-master, multi-master
|
||||
DEPLOY_MODE=single-master
|
||||
|
||||
# Versions supported: v1.8, v1.9, v1.10, v1.11, v1.12, v1.13
|
||||
K8S_VER="v1.11"
|
||||
|
||||
# Cluster's Master IP, auto generated
|
||||
MASTER_IP="{{ groups['kube-master'][0] }}"
|
||||
KUBE_APISERVER="https://{{ MASTER_IP }}:6443"
|
||||
|
|
|
@ -45,15 +45,21 @@
|
|||
- name: 创建 basic-auth.csv
|
||||
template: src=basic-auth.csv.j2 dest={{ ca_dir }}/basic-auth.csv
|
||||
|
||||
# 为兼容v1.8版本,配置不同 kube-apiserver的systemd unit文件
|
||||
- name: 获取 k8s 版本信息
|
||||
shell: "{{ bin_dir }}/kube-apiserver --version"
|
||||
register: k8s_ver
|
||||
tags: upgrade_k8s, restart_master
|
||||
|
||||
- name: 创建kube-apiserver的systemd unit文件
|
||||
template: src=kube-apiserver.service.j2 dest=/etc/systemd/system/kube-apiserver.service
|
||||
tags: upgrade_k8s, restart_master
|
||||
when: "'v1.8' not in k8s_ver.stdout"
|
||||
|
||||
# 为兼容之前的模式,需特别对v1.8版本重新配置kube-apiserver的systemd unit文件
|
||||
- name: 创建kube-apiserver v1.8的systemd unit文件
|
||||
template: src=kube-apiserver-{{ K8S_VER }}.service.j2 dest=/etc/systemd/system/kube-apiserver.service
|
||||
template: src=kube-apiserver-v1.8.service.j2 dest=/etc/systemd/system/kube-apiserver.service
|
||||
tags: upgrade_k8s, restart_master
|
||||
when: "K8S_VER is defined and K8S_VER == 'v1.8'"
|
||||
when: "'v1.8' in k8s_ver.stdout"
|
||||
|
||||
- name: 创建kube-controller-manager的systemd unit文件
|
||||
template: src=kube-controller-manager.service.j2 dest=/etc/systemd/system/kube-controller-manager.service
|
||||
|
|
Loading…
Reference in New Issue