-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge "Remove Replicas definition from Zuul CRD"
- Loading branch information
Showing
9 changed files
with
29 additions
and
55 deletions.
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 |
---|---|---|
@@ -1,15 +1,5 @@ | ||
--- | ||
# The scale_up_replicas values are hardcoded now, due it is using update-custom-resource | ||
# role. More info: https://softwarefactory-project.io/r/c/software-factory/sf-operator/+/28387/comments/15f3bffd_f834d8f8 | ||
scale_up_replicas: 4 | ||
scale_down_replicas: 2 | ||
scaling_services: | ||
- name: zuul-executor | ||
scale_up_resources: | ||
zuul: | ||
executor: | ||
replicas: "{{ scale_up_replicas }}" | ||
scale_down_resources: | ||
zuul: | ||
executor: | ||
replicas: "{{ scale_down_replicas }}" | ||
kind: sts | ||
replicas: 2 |
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 |
---|---|---|
@@ -1,22 +1,18 @@ | ||
--- | ||
- name: "Collect executor log before the scaleup" | ||
- name: "Collect {{ service.kind }} log before executing the scale command" | ||
shell: | | ||
mkdir -p ~/zuul-output/logs/k8s-resources/sf/pod | ||
kubectl logs zuul-executor-0 > ~/zuul-output/logs/k8s-resources/sf/pod/zuul-executor-0-zuul-executor-logs0.txt | ||
kubectl logs {{ service.kind }}/{{ service.name }} > ~/zuul-output/logs/k8s-resources/sf/pod/{{ service.name }}-0-{{ service.name }}-logs0.txt | ||
- name: "Scale {{ operation }} on statefulset {{ service.name }}" | ||
ansible.builtin.include_role: | ||
name: "update-custom-resource" | ||
vars: | ||
cr_spec: "{{ service['scale_' + operation + '_resources'] }}" | ||
- name: "Scale on {{ service.kind }} {{ service.name }}" | ||
ansible.builtin.command: | ||
cmd: kubectl scale {{ service.kind }} {{ service.name }} --replicas {{ service.replicas }} | ||
|
||
- name: "Get replica count for {{ service.name }} to operation {{ operation }}" | ||
- name: "Get replica count for {{ service.name }}" | ||
ansible.builtin.command: > | ||
kubectl get statefulsets {{ service.name }} | ||
kubectl get {{ service.kind }} {{ service.name }} | ||
-o jsonpath='{.status.readyReplicas}' | ||
register: _scale_ready | ||
|
||
- name: Check if replica count is correct | ||
fail: | ||
msg: "The replica count for service {{ service.name }} is not {{ vars['scale_' + operation + '_replicas'] }}" | ||
when: _scale_ready.stdout | int != vars['scale_' + operation + '_replicas'] | ||
until: _scale_ready.stdout | int == service.replicas | ||
retries: "{{ service.replicas }}" | ||
delay: 10 |
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