废弃ansible hosts中变量CLUSTER_DNS_SVC_IP等

dev1
gjmzj 2019-06-09 15:55:35 +08:00
parent c238b3ba12
commit 813db54a2f
11 changed files with 28 additions and 48 deletions

View File

@ -47,12 +47,6 @@ CLUSTER_CIDR="172.20.0.0/16"
# 服务端口范围 (NodePort Range)
NODE_PORT_RANGE="20000-40000"
# kubernetes 服务 IP (预分配,一般是 SERVICE_CIDR 中第一个IP)
CLUSTER_KUBERNETES_SVC_IP="10.68.0.1"
# 集群 DNS 服务 IP (从 SERVICE_CIDR 中预分配)
CLUSTER_DNS_SVC_IP="10.68.0.2"
# 集群 DNS 域名
CLUSTER_DNS_DOMAIN="cluster.local."

View File

@ -48,12 +48,6 @@ CLUSTER_CIDR="172.20.0.0/16"
# NodePort Range
NODE_PORT_RANGE="20000-40000"
# Kubernetes SVC IP (usually assigned with the first available IP of 'SERVICE_CIDR')
CLUSTER_KUBERNETES_SVC_IP="10.68.0.1"
# Cluster DNS Server's IP (assigned with an available IP of 'SERVICE_CIDR')
CLUSTER_DNS_SVC_IP="10.68.0.2"
# Cluster DNS Domain
CLUSTER_DNS_DOMAIN="cluster.local."

View File

@ -47,12 +47,6 @@ CLUSTER_CIDR="172.20.0.0/16"
# 服务端口范围 (NodePort Range)
NODE_PORT_RANGE="20000-40000"
# kubernetes 服务 IP (预分配,一般是 SERVICE_CIDR 中第一个IP)
CLUSTER_KUBERNETES_SVC_IP="10.68.0.1"
# 集群 DNS 服务 IP (从 SERVICE_CIDR 中预分配)
CLUSTER_DNS_SVC_IP="10.68.0.2"
# 集群 DNS 域名
CLUSTER_DNS_DOMAIN="cluster.local."

View File

@ -48,12 +48,6 @@ CLUSTER_CIDR="172.20.0.0/16"
# NodePort Range
NODE_PORT_RANGE="20000-40000"
# Kubernetes SVC IP (usually assigned with the first available IP of 'SERVICE_CIDR')
CLUSTER_KUBERNETES_SVC_IP="10.68.0.1"
# Cluster DNS Server's IP (assigned with an available IP of 'SERVICE_CIDR')
CLUSTER_DNS_SVC_IP="10.68.0.2"
# Cluster DNS Domain
CLUSTER_DNS_DOMAIN="cluster.local."

View File

@ -57,12 +57,6 @@ CLUSTER_CIDR="172.20.0.0/16"
# 服务端口范围 (NodePort Range)
NODE_PORT_RANGE="20000-40000"
# kubernetes 服务 IP (预分配,一般是 SERVICE_CIDR 中第一个IP)
CLUSTER_KUBERNETES_SVC_IP="10.68.0.1"
# 集群 DNS 服务 IP (从 SERVICE_CIDR 中预分配)
CLUSTER_DNS_SVC_IP="10.68.0.2"
# 集群 DNS 域名
CLUSTER_DNS_DOMAIN="cluster.local."

View File

@ -58,12 +58,6 @@ CLUSTER_CIDR="172.20.0.0/16"
# NodePort Range
NODE_PORT_RANGE="20000-40000"
# Kubernetes SVC IP (usually assigned with the first available IP of 'SERVICE_CIDR')
CLUSTER_KUBERNETES_SVC_IP="10.68.0.1"
# Cluster DNS Server's IP (assigned with an available IP of 'SERVICE_CIDR')
CLUSTER_DNS_SVC_IP="10.68.0.2"
# Cluster DNS Domain
CLUSTER_DNS_DOMAIN="cluster.local."

View File

@ -48,12 +48,6 @@ CLUSTER_CIDR="172.20.0.0/16"
# 服务端口范围 (NodePort Range)
NODE_PORT_RANGE="20000-40000"
# kubernetes 服务 IP (预分配,一般是 SERVICE_CIDR 中第一个IP)
CLUSTER_KUBERNETES_SVC_IP="10.68.0.1"
# 集群 DNS 服务 IP (从 SERVICE_CIDR 中预分配)
CLUSTER_DNS_SVC_IP="10.68.0.2"
# 集群 DNS 域名
CLUSTER_DNS_DOMAIN="cluster.local."

View File

@ -49,12 +49,6 @@ CLUSTER_CIDR="172.20.0.0/16"
# NodePort Range
NODE_PORT_RANGE="20000-40000"
# Kubernetes SVC IP (usually assigned with the first available IP of 'SERVICE_CIDR')
CLUSTER_KUBERNETES_SVC_IP="10.68.0.1"
# Cluster DNS Server's IP (assigned with an available IP of 'SERVICE_CIDR')
CLUSTER_DNS_SVC_IP="10.68.0.2"
# Cluster DNS Domain
CLUSTER_DNS_DOMAIN="cluster.local."

View File

@ -1,3 +1,11 @@
# 设置 dns svc ip (这里选用 SERVICE_CIDR 中第2个IP)
- name: 注册变量 DNS_SVC_IP
shell: echo {{ SERVICE_CIDR }}|cut -d/ -f1|awk -F. '{print $1"."$2"."$3"."$4+2}'
register: DNS_SVC_IP
- name: 设置变量 CLUSTER_DNS_SVC_IP
set_fact: CLUSTER_DNS_SVC_IP={{ DNS_SVC_IP.stdout }}
- block:
- name: 在deploy 节点创建相关目录
file: path={{ item }} state=directory

View File

@ -16,6 +16,16 @@
- ca-config.json
delegate_to: "{{ groups.deploy[0] }}"
# 设置 kubernetes svc ip (一般是 SERVICE_CIDR 中第一个IP)
- name: 注册变量 KUBERNETES_SVC_IP
shell: echo {{ SERVICE_CIDR }}|cut -d/ -f1|awk -F. '{print $1"."$2"."$3"."$4+1}'
register: KUBERNETES_SVC_IP
tags: change_cert
- name: 设置变量 CLUSTER_KUBERNETES_SVC_IP
set_fact: CLUSTER_KUBERNETES_SVC_IP={{ KUBERNETES_SVC_IP.stdout }}
tags: change_cert
- name: 创建 kubernetes 证书签名请求
template: src=kubernetes-csr.json.j2 dest={{ ca_dir }}/kubernetes-csr.json
tags: change_cert

View File

@ -89,6 +89,16 @@
- name: 准备 cni配置文件
template: src=cni-default.conf.j2 dest=/etc/cni/net.d/10-default.conf
# 设置 dns svc ip (这里选用 SERVICE_CIDR 中第2个IP)
- name: 注册变量 DNS_SVC_IP
shell: echo {{ SERVICE_CIDR }}|cut -d/ -f1|awk -F. '{print $1"."$2"."$3"."$4+2}'
register: DNS_SVC_IP
tags: restart_node
- name: 设置变量 CLUSTER_DNS_SVC_IP
set_fact: CLUSTER_DNS_SVC_IP={{ DNS_SVC_IP.stdout }}
tags: restart_node
- name: 创建kubelet的systemd unit文件
template: src=kubelet.service.j2 dest=/etc/systemd/system/kubelet.service
tags: upgrade_k8s, restart_node