Skip to content
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

scheduler-plugins automation #98

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Ananya-kumari
Copy link

No description provided.

@ppc64le-cloud-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Ananya-kumari
Once this PR has been reviewed and has the lgtm label, please assign pravin-dsilva for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ppc64le-cloud-bot
Copy link
Contributor

Welcome @Ananya-kumari! It looks like this is your first PR to ocp-power-automation/ocp4-playbooks-extras 🎉

@ppc64le-cloud-bot ppc64le-cloud-bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jan 6, 2025
@AniruddhaNayek
Copy link

AniruddhaNayek commented Jan 6, 2025

Adhere to the Ansible directory structure, configure a README.md file. For references you can check various readme files under specific roles like this - https://github.com/ocp-power-automation/ocp4-playbooks-extras/tree/main/playbooks/roles/ocp-cli-plugins#ocp-cli-plug-ins-deployment-and-testing

@AniruddhaNayek
Copy link

Add this scheduler-plugins role under playbook/main.yml file

@AniruddhaNayek
Copy link

Identify any dynamic variables for this playbook. If required configure a vars file which can used as an extra_vars

@Ananya-kumari Ananya-kumari changed the title Initial commit of project files scheduler-plugins Jan 9, 2025
@Ananya-kumari Ananya-kumari changed the title scheduler-plugins scheduler-plugins automation Jan 9, 2025
@ppc64le-cloud-bot ppc64le-cloud-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 10, 2025
@Ananya-kumari
Copy link
Author

@AniruddhaNayek the suggested changes are done, please review.

@Ananya-kumari
Copy link
Author

Ananya-kumari commented Jan 10, 2025

Adhere to the Ansible directory structure, configure a README.md file. For references you can check various readme files under specific roles like this - https://github.com/ocp-power-automation/ocp4-playbooks-extras/tree/main/playbooks/roles/ocp-cli-plugins#ocp-cli-plug-ins-deployment-and-testing

added a Readme.md file

@Ananya-kumari
Copy link
Author

Identify any dynamic variables for this playbook. If required configure a vars file which can used as an extra_vars

extra_vars are fetched and added in the examples/main.yaml

@Ananya-kumari
Copy link
Author

Add this scheduler-plugins role under playbook/main.yml file

Done

inventory Outdated Show resolved Hide resolved
all.yaml Outdated Show resolved Hide resolved
playbooks/roles/scheduler-plugins/README.md Show resolved Hide resolved
playbooks/main.yml Show resolved Hide resolved
examples/scheduler-plugins.yaml Show resolved Hide resolved
playbooks/main.yml Show resolved Hide resolved
Copy link
Contributor

@SurajGudaji SurajGudaji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Squash all commits and make it a single commit.


#scheduler-plugin vars:
ocp_scheduler_plugins_enable: false
kubeconfig_path: "/root/openstack-upi/auth/kubeconfig" # Path to the kubeconfig file for accessing the cluster
Copy link
Contributor

@SurajGudaji SurajGudaji Jan 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please define the KUBECONFIG path variable in the vars folder by appending it to ansible_env.HOME var, then that kubeconfig will be used by default in this role.


- name: Create quota2 namespace
k8s:
kubeconfig: "{{ kubeconfig_path }}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once you append the kubeconfig file path in ansible_env.HOME, you can remove this line, as the default kubeconfig will be used.

- name: Apply PodGroup configuration
command: oc apply -f /root/po.yaml
register: podgroup_create_output

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of defining the resource PodGroup in templates file and using it to create, you can define and create it here itself using k8s module.

- name: Apply Deployment configuration
command: oc apply -f /root/deploy.yaml
register: deploy_create_output

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, you can define and create the deployment here itself using k8s module.

retries: 5
delay: 10

- name: Clean up temporary files
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove this task, if the above comments are implemented

namespace: scheduler-plugins
dest: /root/cm.yaml
when: cm_exists.rc != 0

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the k8s module the create the resources, instead of defining the resource in a yaml file and copying it to /root folder

dest: '/root/scheduler-plugins'
version: 'master'

- name: Install scheduler-plugins Helm chart
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can add a task to check if helm is installed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants