Provides deployment status details for any Kubernetes pod
Reason this release was yanked:
Does not install dependencies automatically
Project description
Kubernetes Deployment Status
Retrieves deployment status information from a GitHub API endpoint.
It encapsulates methods to interact with the API, handle retries, and extract relevant data from the API response.
Most of the data is memoized as well to avoid unnecessary API calls.
Installation
pip install k8s_deployment_status
Package dependencies(auto-install):
- kubernetes
- requests
Usage
To use the package follow these steps,
Kubernetes Environment Variables
Set necessary environment variables like so in your Kubernetes yaml file.
env:
- name: GITHUB_OWNER
value: "organisation/owner-name"
- name: GITHUB_REPO
value: "repo-name"
- name: GITHUB_DEPLOYMENT_BRANCH
value: "main"
- name: GITHUB_API_PAGE_SIZE
value: "5"
- name: GITHUB_API_MAXIMUM_RETRIES
value: "3"
All available options are mentioned above. GITHUB_OWNER, GITHUB_REPO are required.
Feel free to check config.py for default values per variable.
Import and Actual usage
Import package and respective class in the respective module
from deployment_status import DeploymentStatus
@app.route('/api/ros/v1/deployment_status', methods=['GET'])
def deployment_status():
deployment_status_data = DeploymentStatus().get()
return jsonify(deployment_status_data)
Response Data
The output data should look like so,
{
"branch": "main",
"commit_merged": "Thu, 15 Jun 2023 14:38:16 UTC",
"commit_msg": "Add redis as required dependency",
"commit_sha": "9c2ee47951a8d25c7aa1402998344c5470956eb7",
"deployed_at": "Thu, 15 Jun 2023 18:59:25 UTC"
}
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 Distribution
Built Distribution
Hashes for k8s_deployment_status-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b541d6a99b62ee4a0407a3ce520a4138985357ad1d5efeb79d05e8b9f0e9724 |
|
MD5 | 8ddf97072f2ebc044c4283473408b55a |
|
BLAKE2b-256 | ce7cf463bfd8cde6e918c89facc34e549a0e9545e1f531f1e8e5f418478351e8 |
Hashes for k8s_deployment_status-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8f31aae665d4535fc37299d90e03ef44825fffddd5429a91754b45c008a6d5c |
|
MD5 | 358d8678c5426a1aa2042c58a30a3d6f |
|
BLAKE2b-256 | 7b31518b52b47ca548ed7d98b8db1406582a5af617c34a0e8abb0bcf8b269c7a |