Cloud Governance Tool
Project description
Cloud Governance
This tool provides an engineer with a lightweight and flexible framework for deploying cloud management policies and OpenShift management capabilities.
General
-
policies: The policies that run by cloud custodian tool
-
tag_cluster_resource: Update cluster tags by cluster name
-
zombie_cluster_resource: Delete cluster's zombies resources
-
The cloud-governance package is placed in PyPi
-
The cloud-governance pipeline is placed in Jenkins
Table of Contents
Installation
# need to run it as root and aws admin user
aws configure
python3 -m venv governance
source governance/bin/activate
python -m pip install --upgrade pip
pip3 install cloud-governance
Policies
ec2_idle.yml
ebs_unattached.yml
run steps:
(governance) $ git clone https://github.com/redhat-performance/cloud-governance
(governance) $ mkdir governance_output
(governance) $ custodian run --dryrun -s governance_output cloud-governance/policies/ebs_unattached.yml
Update Cluster Tags
(governance) $ python3
>>> from cloud_governance.tag_cluster.run_tag_cluster_resouces import scan_cluster_resource, tag_cluster_resource
>>> from time import gmtime, strftime
# Choose region
>>> region = 'us-east-2'
# Cluster name to be tagged
>>> cluster_name = 'test'
# mandatory tags for all cluster resources
>>> mandatory_tags = {
"Owner": "Name",
"Email": "name@redhat.com",
"Purpose": "test",
"Date": strftime("%Y/%m/%d %H:%M:%S")
}
# dry run: scan for cluster resources
>>> scan_cluster_resource(cluster_name=cluster_name, region=region)
# update tags
>>> tag_cluster_resource(cluster_name=cluster_name, mandatory_tags=mandatory_tags, region=region)
Delete Zombies Clusters
(governance) $ python3
>>> from cloud_governance.zombie_cluster.run_zombie_cluster_resources import zombie_cluster_resource, delete_zombie_cluster_resource
# Choose region
>>> region = 'us-east-2'
# dry run: scan for zombie clusters resource
>>> zombie_cluster_resource(delete=False, region=region)
# delete zombie clusters resource
>>> delete_zombie_cluster_resource(delete=True, region=region)
Pytest
(governance) $ pip install coverage
(governance) $ pip install pytest
(governance) $ git clone https://github.com/redhat-performance/cloud-governance
(governance) $ cd cloud-governance
(governance) $ coverage run -m pytest
Post Installation
deactivate
rm -rf *governance*
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for cloud_governance-1.0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8caeb4f1d2d8d9f0648159478e90df4cef1964b1515f729c5d9959b7e0b5081 |
|
MD5 | 44869c5dd6f071fd991cf6c5385264b2 |
|
BLAKE2b-256 | 928b7507bb4fb376d912107ddac4991d1a7f859fae4233be4408206685eb34ca |