Skip to content

Commit 78d39a1

Browse files
Automation to validate autoscaling of nodes on IPI cluster
Signed-off-by: prajwal-gawande492 <[email protected]>
1 parent accd1fa commit 78d39a1

File tree

9 files changed

+533
-0
lines changed

9 files changed

+533
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ This repository consists of additional ansible playbooks for the following:
5353
1. Verify IPI day2 operations
5454
1. Deploy Openshift Data Foundation operator
5555
1. Enabling Kdump
56+
1. Validate Autoscaling of nodes on IPI cluster
5657

5758
## Assumptions:
5859

examples/all.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
---
22

3+
## node-autoscaling required vars
4+
autoscaling_enabled: false
5+
6+
37
## clusterresourceoverride-operator role variables
48
cro_role_enable: false
59
cro_e2e: false
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
## node-autoscaling required vars
2+
autoscaling_enabled: false

playbooks/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
---
2+
- import_playbook: ocp-node-autoscaling.yml
3+
when: ocp-node-autoscaling is defined and ocp-node-autoscaling
4+
25
- import_playbook: ocp-scale.yml
36
when: scale_test_enabled
47

playbooks/ocp-node-autoscaling.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
- name: Validate autoscaling of nodes on PowerVS IPI
3+
hosts: localhost
4+
roles:
5+
- ocp-node-autoscaling
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
OCP Autoscaling of Nodes on IPI (Installer Provision Infrastructure) cluster
2+
=========
3+
This ansible playbook can be used for Validating the autoscaling of nodes, by scaling up and down the machines using machineAutoscaler and clusterAutoscaler functions.
4+
5+
This playbook verifies two Autoscaling functions:
6+
1. Scale Up
7+
2. Scale Down
8+
9+
10+
Requirements
11+
------------
12+
13+
- Access to the cluster as a user with the cluster-admin role.
14+
- The cluster is in a known good state, without any errors.
15+
16+
17+
Role Variables
18+
--------------
19+
20+
| Variable | Required | Default | Comments |
21+
|-----------------------------|----------|--------------------------------------------|-----------------------------------------------------|
22+
| autoscaling_enabled| no | false | Flag to be set to true to run this playbook |
23+
24+
Dependencies
25+
------------
26+
27+
- None
28+
29+
Example Playbook
30+
----------------
31+
```
32+
---
33+
- name: Validate autoscaling of nodes on PowerVS IPI
34+
hosts: localhost
35+
roles:
36+
- ocp-node-autoscaling
37+
```
38+
39+
License
40+
-------
41+
42+
See LICENCE.txt
43+
44+
Author Information
45+
------------------
46+
47+
48+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# node-autoscaling required vars
2+
autoscaling_enabled: false
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
labels:
5+
app: busybox
6+
name: busybox-deployment
7+
namespace: test
8+
spec:
9+
progressDeadlineSeconds: 600
10+
replicas: 2
11+
revisionHistoryLimit: 10
12+
selector:
13+
matchLabels:
14+
app: busybox
15+
strategy:
16+
rollingUpdate:
17+
maxSurge: 25%
18+
maxUnavailable: 25%
19+
type: RollingUpdate
20+
template:
21+
metadata:
22+
creationTimestamp: null
23+
labels:
24+
app: busybox
25+
spec:
26+
containers:
27+
- name: busybox
28+
image: busybox:latest
29+
command:
30+
- sleep
31+
- "3600"
32+
resources:
33+
requests:
34+
cpu: "4"
35+
memory: 14G
36+
terminationMessagePath: /dev/termination-log
37+
terminationMessagePolicy: File
38+
dnsPolicy: ClusterFirst
39+
restartPolicy: Always
40+
schedulerName: default-scheduler
41+
securityContext: {}
42+
terminationGracePeriodSeconds: 30

0 commit comments

Comments
 (0)