Provides deployment status details for any Kubernetes pod
Reason this release was yanked:
Issues with config file
Project description
Kubernetes Deployment Status
Retrieves commit details from a GitHub API endpoint, deployment timestamp from Kubernetes API.
It encapsulates methods to interact with the APIs, 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 k8s_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 object 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
File details
Details for the file k8s_deployment_status-0.0.3.tar.gz
.
File metadata
- Download URL: k8s_deployment_status-0.0.3.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d7a11b83c184d1cbefeb76f2cb016e5a9412efe6f35de3460545bd509e2556d |
|
MD5 | b8c8ad3c1e85bf7416f4fb56a055dd24 |
|
BLAKE2b-256 | b0225f65734d32d13b16e7a9df41861a3b0aa8db3da56aa58fb0b8338b04026b |
File details
Details for the file k8s_deployment_status-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: k8s_deployment_status-0.0.3-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f037418f810c8695ebd1c842f57c5322985fc63942d1f1f1d9f0f5bbb007304c |
|
MD5 | f608b35d6504fa1615b34503b5194895 |
|
BLAKE2b-256 | 759affc8dec7f54f147429ce189fae1e57f76f708b711c85faa7c04ee9f3d588 |