diff --git a/contrib/drivers/k8s_opensuse_v1/template_def.py b/contrib/drivers/k8s_opensuse_v1/template_def.py index 2e1bc0a95c..1d5e497f4a 100644 --- a/contrib/drivers/k8s_opensuse_v1/template_def.py +++ b/contrib/drivers/k8s_opensuse_v1/template_def.py @@ -45,10 +45,21 @@ class JeOSK8sTemplateDefinition(k8s_template_def.K8sTemplateDefinition): **kwargs) def get_env_files(self, cluster_template): + env_files = [] 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: - 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 def driver_module_path(self): diff --git a/contrib/drivers/k8s_opensuse_v1/templates/kubecluster.yaml b/contrib/drivers/k8s_opensuse_v1/templates/kubecluster.yaml index 15dd4b1dda..514f333dd6 100644 --- a/contrib/drivers/k8s_opensuse_v1/templates/kubecluster.yaml +++ b/contrib/drivers/k8s_opensuse_v1/templates/kubecluster.yaml @@ -438,6 +438,18 @@ resources: pool_private_ip: {get_attr: [etcd_loadbalancer, vip_address]} 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 @@ -542,7 +554,7 @@ outputs: str_replace: template: api_ip_address params: - api_ip_address: {get_attr: [api_address_switch, public_ip]} + api_ip_address: {get_attr: [api_address_floating_switch, ip_address]} description: > This is the API endpoint of the Kubernetes cluster. Use this to access the Kubernetes API. diff --git a/contrib/drivers/k8s_opensuse_v1/templates/kubemaster.yaml b/contrib/drivers/k8s_opensuse_v1/templates/kubemaster.yaml index c322f30261..9bd05ce78e 100644 --- a/contrib/drivers/k8s_opensuse_v1/templates/kubemaster.yaml +++ b/contrib/drivers/k8s_opensuse_v1/templates/kubemaster.yaml @@ -168,20 +168,6 @@ resources: handle: {get_resource: master_wait_handle} 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 @@ -302,7 +288,7 @@ resources: replacement_policy: AUTO kube_master_floating: - type: OS::Neutron::FloatingIP + type: Magnum::Optional::KubeMaster::Neutron::FloatingIP properties: floating_network: {get_param: external_network} port_id: {get_resource: kube_master_eth0} diff --git a/contrib/drivers/k8s_opensuse_v1/templates/kubeminion.yaml b/contrib/drivers/k8s_opensuse_v1/templates/kubeminion.yaml index fae057b449..76d2e56804 100644 --- a/contrib/drivers/k8s_opensuse_v1/templates/kubeminion.yaml +++ b/contrib/drivers/k8s_opensuse_v1/templates/kubeminion.yaml @@ -303,7 +303,7 @@ resources: replacement_policy: AUTO kube_minion_floating: - type: OS::Neutron::FloatingIP + type: Magnum::Optional::KubeMinion::Neutron::FloatingIP properties: floating_network: {get_param: external_network} port_id: {get_resource: kube_minion_eth0}