Refactor: simpify cloud_provider is defined condition
For this change, `cloud_provider` change the default value to empty string. Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com>pull/11633/head
parent
c27cc33bd7
commit
38cd05c503
|
@ -2,7 +2,6 @@
|
|||
dependencies:
|
||||
- role: kubernetes-apps/external_cloud_controller/openstack
|
||||
when:
|
||||
- cloud_provider is defined
|
||||
- cloud_provider == "external"
|
||||
- external_cloud_provider is defined
|
||||
- external_cloud_provider == "openstack"
|
||||
|
@ -12,7 +11,6 @@ dependencies:
|
|||
- external-openstack
|
||||
- role: kubernetes-apps/external_cloud_controller/vsphere
|
||||
when:
|
||||
- cloud_provider is defined
|
||||
- cloud_provider == "external"
|
||||
- external_cloud_provider is defined
|
||||
- external_cloud_provider == "vsphere"
|
||||
|
@ -22,7 +20,6 @@ dependencies:
|
|||
- external-vsphere
|
||||
- role: kubernetes-apps/external_cloud_controller/hcloud
|
||||
when:
|
||||
- cloud_provider is defined
|
||||
- cloud_provider == "external"
|
||||
- external_cloud_provider is defined
|
||||
- external_cloud_provider == "hcloud"
|
||||
|
@ -32,7 +29,6 @@ dependencies:
|
|||
- external-hcloud
|
||||
- role: kubernetes-apps/external_cloud_controller/huaweicloud
|
||||
when:
|
||||
- cloud_provider is defined
|
||||
- cloud_provider == "external"
|
||||
- external_cloud_provider is defined
|
||||
- external_cloud_provider == "huaweicloud"
|
||||
|
@ -42,7 +38,6 @@ dependencies:
|
|||
- external-huaweicloud
|
||||
- role: kubernetes-apps/external_cloud_controller/oci
|
||||
when:
|
||||
- cloud_provider is defined
|
||||
- cloud_provider == "external"
|
||||
- external_cloud_provider is defined
|
||||
- external_cloud_provider == "oci"
|
||||
|
|
|
@ -24,7 +24,7 @@ nodeRegistration:
|
|||
taints: []
|
||||
{% endif %}
|
||||
criSocket: {{ cri_socket }}
|
||||
{% if cloud_provider is defined and cloud_provider in ["external"] %}
|
||||
{% if cloud_provider == "external" %}
|
||||
kubeletExtraArgs:
|
||||
cloud-provider: external
|
||||
{% endif %}
|
||||
|
|
|
@ -21,7 +21,7 @@ KUBELET_VOLUME_PLUGIN="--volume-plugin-dir={{ kubelet_flexvolumes_plugins_dir }}
|
|||
{% if kube_network_plugin is defined and kube_network_plugin == "cloud" %}
|
||||
KUBELET_NETWORK_PLUGIN="--hairpin-mode=promiscuous-bridge --network-plugin=kubenet"
|
||||
{% endif %}
|
||||
{% if cloud_provider is defined and cloud_provider in ["external"] %}
|
||||
{% if cloud_provider == "external" %}
|
||||
KUBELET_CLOUDPROVIDER="--cloud-provider={{ cloud_provider }}"
|
||||
{% else %}
|
||||
KUBELET_CLOUDPROVIDER=""
|
||||
|
|
|
@ -166,10 +166,9 @@
|
|||
|
||||
- name: Check cloud_provider value
|
||||
assert:
|
||||
that: cloud_provider in ['external']
|
||||
msg: "If set the 'cloud_provider' var must be set either to 'external'"
|
||||
that: cloud_provider == 'external'
|
||||
when:
|
||||
- cloud_provider is defined
|
||||
- cloud_provider
|
||||
- not ignore_assert_errors
|
||||
tags:
|
||||
- cloud-provider
|
||||
|
|
|
@ -271,6 +271,9 @@ kubelet_shutdown_grace_period: 60s
|
|||
# to give normal pods time to be gracefully evacuated
|
||||
kubelet_shutdown_grace_period_critical_pods: 20s
|
||||
|
||||
# Cloud Provider
|
||||
# This variable can only be set to "external" or empty string, otherwise the check will fail.
|
||||
cloud_provider: ""
|
||||
# Whether to deploy the container engine
|
||||
deploy_container_engine: "{{ 'k8s_cluster' in group_names or etcd_deployment_type == 'docker' }}"
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
register: calico_kubelet_name
|
||||
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
||||
when:
|
||||
- "cloud_provider is defined"
|
||||
- cloud_provider
|
||||
|
||||
- name: Calico | Gather os specific variables
|
||||
include_vars: "{{ item }}"
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
args:
|
||||
executable: /bin/bash
|
||||
when:
|
||||
- (calico_ipip_mode is defined and calico_ipip_mode != 'Never' or cloud_provider is defined)
|
||||
- (calico_ipip_mode is defined and calico_ipip_mode != 'Never')
|
||||
- kube_network_plugin | default('calico') == 'calico'
|
||||
|
||||
- name: Advanced testcases for network
|
||||
|
|
Loading…
Reference in New Issue