kubespray/tests/testcases/010_check-apiserver.yml

25 lines
718 B
YAML
Raw Normal View History

2016-02-10 18:51:39 +08:00
---
- name: Testcases for apiserver
hosts: kube_control_plane
2016-02-10 18:51:39 +08:00
tasks:
- name: Check the API servers are responding
uri:
2020-04-22 03:31:53 +08:00
url: "https://{{ access_ip | default(ansible_default_ipv4.address) }}:{{ kube_apiserver_port | default(6443) }}/version"
2016-02-10 18:51:39 +08:00
validate_certs: no
2020-04-22 03:31:53 +08:00
status_code: 200
register: apiserver_response
2022-07-21 23:23:39 +08:00
retries: 12
delay: 5
until: apiserver_response is success
2020-04-22 03:31:53 +08:00
- debug: # noqa name[missing]
2020-04-22 03:31:53 +08:00
msg: "{{ apiserver_response.json }}"
- name: Check API servers version
assert:
that:
- apiserver_response.json.gitVersion == kube_version
fail_msg: "apiserver version different than expected {{ kube_version }}"
2020-06-30 03:39:59 +08:00
when: kube_version is defined