fix waiting for terminating pods

This commit is contained in:
Matthew Mosesohn 2017-09-24 11:08:18 +01:00
parent 5a60d8e9b6
commit 919713af28
3 changed files with 19 additions and 17 deletions

View file

@ -262,18 +262,18 @@ before_script:
tests/testcases/040_check-network-adv.yml $LOG_LEVEL; tests/testcases/040_check-network-adv.yml $LOG_LEVEL;
fi fi
# after_script: after_script:
# - > - >
# ansible-playbook -i inventory/inventory.ini tests/cloud_playbooks/delete-gce.yml -c local $LOG_LEVEL ansible-playbook -i inventory/inventory.ini tests/cloud_playbooks/delete-gce.yml -c local $LOG_LEVEL
# -e mode=${CLUSTER_MODE} -e mode=${CLUSTER_MODE}
# -e test_id=${TEST_ID} -e test_id=${TEST_ID}
# -e kube_network_plugin=${KUBE_NETWORK_PLUGIN} -e kube_network_plugin=${KUBE_NETWORK_PLUGIN}
# -e gce_project_id=${GCE_PROJECT_ID} -e gce_project_id=${GCE_PROJECT_ID}
# -e gce_service_account_email=${GCE_ACCOUNT} -e gce_service_account_email=${GCE_ACCOUNT}
# -e gce_credentials_file=${HOME}/.ssh/gce.json -e gce_credentials_file=${HOME}/.ssh/gce.json
# -e cloud_image=${CLOUD_IMAGE} -e cloud_image=${CLOUD_IMAGE}
# -e inventory_path=${PWD}/inventory/inventory.ini -e inventory_path=${PWD}/inventory/inventory.ini
# -e cloud_region=${CLOUD_REGION} -e cloud_region=${CLOUD_REGION}
# Test matrix. Leave the comments for markup scripts. # Test matrix. Leave the comments for markup scripts.
.coreos_calico_aio_variables: &coreos_calico_aio_variables .coreos_calico_aio_variables: &coreos_calico_aio_variables

View file

@ -17,7 +17,6 @@ networking:
podSubnet: {{ kube_pods_subnet }} podSubnet: {{ kube_pods_subnet }}
kubernetesVersion: {{ kube_version }} kubernetesVersion: {{ kube_version }}
cloudProvider: {{ cloud_provider|default('') }} cloudProvider: {{ cloud_provider|default('') }}
#TODO: cloud provider conf file
authorizationModes: authorizationModes:
- Node - Node
{% for mode in authorization_modes %} {% for mode in authorization_modes %}
@ -53,7 +52,6 @@ apiServerExtraArgs:
runtime-config: {{ kube_api_runtime_config }} runtime-config: {{ kube_api_runtime_config }}
{% endif %} {% endif %}
allow-privileged: "true" allow-privileged: "true"
#TODO: Custom flags compatible with kubeadm
controllerManagerExtraArgs: controllerManagerExtraArgs:
node-monitor-grace-period: {{ kube_controller_node_monitor_grace_period }} node-monitor-grace-period: {{ kube_controller_node_monitor_grace_period }}
node-monitor-period: {{ kube_controller_node_monitor_period }} node-monitor-period: {{ kube_controller_node_monitor_period }}
@ -61,7 +59,6 @@ controllerManagerExtraArgs:
{% if kube_feature_gates %} {% if kube_feature_gates %}
feature-gates: {{ kube_feature_gates|join(',') }} feature-gates: {{ kube_feature_gates|join(',') }}
{% endif %} {% endif %}
#schedulerExtraArgs:
apiServerCertSANs: apiServerCertSANs:
{% for san in apiserver_sans.split(' ') | unique %} {% for san in apiserver_sans.split(' ') | unique %}
- {{ san }} - {{ san }}

View file

@ -13,8 +13,8 @@
when: not ansible_os_family in ["CoreOS", "Container Linux by CoreOS"] when: not ansible_os_family in ["CoreOS", "Container Linux by CoreOS"]
- name: Get pod names - name: Wait for pods to be ready
shell: "{{bin_dir}}/kubectl get pods -o json" shell: "{{bin_dir}}/kubectl get pods"
register: pods register: pods
until: until:
- '"ContainerCreating" not in pods.stdout' - '"ContainerCreating" not in pods.stdout'
@ -24,6 +24,11 @@
delay: 2 delay: 2
no_log: true no_log: true
- name: Get pod names
shell: "{{bin_dir}}/kubectl get pods -o json"
register: pods
no_log: true
- name: Get hostnet pods - name: Get hostnet pods
command: "{{bin_dir}}/kubectl get pods -o command: "{{bin_dir}}/kubectl get pods -o
jsonpath='{range .items[?(.spec.hostNetwork)]}{.metadata.name} {.status.podIP} {.status.containerStatuses} {end}'" jsonpath='{range .items[?(.spec.hostNetwork)]}{.metadata.name} {.status.podIP} {.status.containerStatuses} {end}'"