-
Notifications
You must be signed in to change notification settings - Fork 638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow {web_,task_,}replicas to be 0 and split out molecule tests #1468
Merged
rooftopcellist
merged 5 commits into
ansible:devel
from
relrod:zero-replicas-are-replicas-too
Jul 18, 2023
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d4cefc8
[deployment] allow replicas to be 0
relrod ed3e4d5
Allow CI to run on personal feature branches
relrod e9d7967
Rework molecule tests a bit so we can test the effects of adding vari…
relrod 1daf10b
try to split things into a matrix to make it faster
relrod e46a1de
tag the preparation/teardown tasks as always
relrod File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
- name: Get web pod details | ||
k8s_info: | ||
namespace: '{{ namespace }}' | ||
kind: Pod | ||
label_selectors: | ||
- app.kubernetes.io/name = example-awx-web | ||
register: awx_web_pod | ||
# This can take a while to actually make it to the cluster | ||
retries: 30 | ||
delay: 5 | ||
until: awx_web_pod.resources | length == expected_web_replicas | ||
ignore_errors: true | ||
|
||
- name: Get task pod details | ||
k8s_info: | ||
namespace: '{{ namespace }}' | ||
kind: Pod | ||
label_selectors: | ||
- app.kubernetes.io/name = example-awx-task | ||
register: awx_task_pod | ||
# This can take a while to actually make it to the cluster | ||
retries: 30 | ||
delay: 5 | ||
until: awx_task_pod.resources | length == expected_task_replicas | ||
ignore_errors: true | ||
|
||
- name: Ensure that the correct number of web and task pods exist | ||
assert: | ||
that: | ||
- awx_web_pod.resources | length == expected_web_replicas | ||
- awx_task_pod.resources | length == expected_task_replicas | ||
fail_msg: >- | ||
Web pods: Expected {{ expected_web_replicas }}, got {{ awx_web_pod.resources | length }}. | ||
Task pods: Expected {{ expected_task_replicas }}, got {{ awx_task_pod.resources | length }}. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
- name: Create or update the awx.ansible.com/v1alpha1.AWX | ||
k8s: | ||
state: present | ||
namespace: '{{ namespace }}' | ||
definition: "{{ lookup('template', 'awx_cr_molecule.yml.j2') | from_yaml }}" | ||
apply: true | ||
wait: yes | ||
wait_timeout: 900 | ||
wait_condition: | ||
type: Running | ||
reason: Successful | ||
status: "True" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- | ||
- block: | ||
- debug: | ||
msg: test - web_replicas and task_replicas should override replicas | ||
|
||
- include_tasks: apply_awx_spec.yml | ||
vars: | ||
additional_fields: | ||
replicas: 2 | ||
web_replicas: 0 | ||
task_replicas: 0 | ||
|
||
- include_tasks: _test_case_replicas.yml | ||
vars: | ||
expected_web_replicas: 0 | ||
expected_task_replicas: 0 | ||
|
||
#### | ||
|
||
- debug: | ||
msg: test - replicas should act as a default | ||
|
||
- include_tasks: apply_awx_spec.yml | ||
vars: | ||
additional_fields: | ||
replicas: 2 | ||
web_replicas: 1 | ||
|
||
- include_tasks: _test_case_replicas.yml | ||
vars: | ||
expected_web_replicas: 1 | ||
expected_task_replicas: 2 | ||
|
||
#### | ||
|
||
- debug: | ||
msg: test - replicas=0 should kill all pods | ||
|
||
- include_tasks: apply_awx_spec.yml | ||
vars: | ||
additional_fields: | ||
replicas: 0 | ||
|
||
- include_tasks: _test_case_replicas.yml | ||
vars: | ||
expected_web_replicas: 0 | ||
expected_task_replicas: 0 | ||
|
||
#### | ||
|
||
- debug: | ||
msg: test - replicas=3 should give 3 of each | ||
|
||
- include_tasks: apply_awx_spec.yml | ||
vars: | ||
additional_fields: | ||
replicas: 3 | ||
|
||
- include_tasks: _test_case_replicas.yml | ||
vars: | ||
expected_web_replicas: 3 | ||
expected_task_replicas: 3 | ||
tags: | ||
- replicas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to think about moving away from the tower naming scheme in errors since we changed the pod_names? I will leave this as a single comment since it isn't directly applied to the PR, more just for others to see and think about potentially changing it if there are others.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, but it doesn't have to prevent this from merging.