Merge "[suse] Allow k8s cluster without floating ip"
This commit is contained in:
commit
d30df64f5c
|
@ -45,10 +45,21 @@ class JeOSK8sTemplateDefinition(k8s_template_def.K8sTemplateDefinition):
|
||||||
**kwargs)
|
**kwargs)
|
||||||
|
|
||||||
def get_env_files(self, cluster_template):
|
def get_env_files(self, cluster_template):
|
||||||
|
env_files = []
|
||||||
if cluster_template.master_lb_enabled:
|
if cluster_template.master_lb_enabled:
|
||||||
return [template_def.COMMON_ENV_PATH + 'with_master_lb.yaml']
|
env_files.append(
|
||||||
|
template_def.COMMON_ENV_PATH + 'with_master_lb.yaml')
|
||||||
else:
|
else:
|
||||||
return [template_def.COMMON_ENV_PATH + 'no_master_lb.yaml']
|
env_files.append(
|
||||||
|
template_def.COMMON_ENV_PATH + 'no_master_lb.yaml')
|
||||||
|
if cluster_template.floating_ip_enabled:
|
||||||
|
env_files.append(
|
||||||
|
template_def.COMMON_ENV_PATH + 'enable_floating_ip.yaml')
|
||||||
|
else:
|
||||||
|
env_files.append(
|
||||||
|
template_def.COMMON_ENV_PATH + 'disable_floating_ip.yaml')
|
||||||
|
|
||||||
|
return env_files
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def driver_module_path(self):
|
def driver_module_path(self):
|
||||||
|
|
|
@ -438,6 +438,18 @@ resources:
|
||||||
pool_private_ip: {get_attr: [etcd_loadbalancer, vip_address]}
|
pool_private_ip: {get_attr: [etcd_loadbalancer, vip_address]}
|
||||||
master_private_ip: {get_attr: [kube_masters, resource.0.kube_master_ip]}
|
master_private_ip: {get_attr: [kube_masters, resource.0.kube_master_ip]}
|
||||||
|
|
||||||
|
######################################################################
|
||||||
|
#
|
||||||
|
# resources that expose the IPs of either floating ip or a given
|
||||||
|
# fixed ip depending on whether FloatingIP is enabled for the cluster.
|
||||||
|
#
|
||||||
|
|
||||||
|
api_address_floating_switch:
|
||||||
|
type: Magnum::FloatingIPAddressSwitcher
|
||||||
|
properties:
|
||||||
|
public_ip: {get_attr: [api_address_lb_switch, public_ip]}
|
||||||
|
private_ip: {get_attr: [api_address_lb_switch, private_ip]}
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
#
|
#
|
||||||
# kubernetes masters. This is a resource group that will create
|
# kubernetes masters. This is a resource group that will create
|
||||||
|
@ -542,7 +554,7 @@ outputs:
|
||||||
str_replace:
|
str_replace:
|
||||||
template: api_ip_address
|
template: api_ip_address
|
||||||
params:
|
params:
|
||||||
api_ip_address: {get_attr: [api_address_switch, public_ip]}
|
api_ip_address: {get_attr: [api_address_floating_switch, ip_address]}
|
||||||
description: >
|
description: >
|
||||||
This is the API endpoint of the Kubernetes cluster. Use this to access
|
This is the API endpoint of the Kubernetes cluster. Use this to access
|
||||||
the Kubernetes API.
|
the Kubernetes API.
|
||||||
|
|
|
@ -168,20 +168,6 @@ resources:
|
||||||
handle: {get_resource: master_wait_handle}
|
handle: {get_resource: master_wait_handle}
|
||||||
timeout: {get_param: wait_condition_timeout}
|
timeout: {get_param: wait_condition_timeout}
|
||||||
|
|
||||||
######################################################################
|
|
||||||
#
|
|
||||||
# resource that exposes the IPs of either the kube master or the API
|
|
||||||
# LBaaS pool depending on whether LBaaS is enabled for the bay.
|
|
||||||
#
|
|
||||||
|
|
||||||
api_address_switch:
|
|
||||||
type: Magnum::ApiGatewaySwitcher
|
|
||||||
properties:
|
|
||||||
pool_public_ip: {get_param: api_public_address}
|
|
||||||
pool_private_ip: {get_param: api_private_address}
|
|
||||||
master_public_ip: {get_attr: [kube_master_floating, floating_ip_address]}
|
|
||||||
master_private_ip: {get_attr: [kube_master_eth0, fixed_ips, 0, ip_address]}
|
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
#
|
#
|
||||||
# software configs. these are components that are combined into
|
# software configs. these are components that are combined into
|
||||||
|
@ -302,7 +288,7 @@ resources:
|
||||||
replacement_policy: AUTO
|
replacement_policy: AUTO
|
||||||
|
|
||||||
kube_master_floating:
|
kube_master_floating:
|
||||||
type: OS::Neutron::FloatingIP
|
type: Magnum::Optional::KubeMaster::Neutron::FloatingIP
|
||||||
properties:
|
properties:
|
||||||
floating_network: {get_param: external_network}
|
floating_network: {get_param: external_network}
|
||||||
port_id: {get_resource: kube_master_eth0}
|
port_id: {get_resource: kube_master_eth0}
|
||||||
|
|
|
@ -303,7 +303,7 @@ resources:
|
||||||
replacement_policy: AUTO
|
replacement_policy: AUTO
|
||||||
|
|
||||||
kube_minion_floating:
|
kube_minion_floating:
|
||||||
type: OS::Neutron::FloatingIP
|
type: Magnum::Optional::KubeMinion::Neutron::FloatingIP
|
||||||
properties:
|
properties:
|
||||||
floating_network: {get_param: external_network}
|
floating_network: {get_param: external_network}
|
||||||
port_id: {get_resource: kube_minion_eth0}
|
port_id: {get_resource: kube_minion_eth0}
|
||||||
|
|
Loading…
Reference in New Issue