Skip to main content

Helmion Plugin: Kube Resource Report

PyPI version Supported Python versions

hmi_kuberesourcereport is a chart generator for Helmion that deploys a Kube Resource Report service in Kubernetes.

Helmion is a python library to download and customize Helm charts, and can also be used to generate custom charts.

Example

from kubragen2.output import OutputProject, OutputFile_ShellScript, OutputFile_Kubernetes, OD_FileTemplate, \
    OutputDriver_Print

from hmi_kuberesourcereport import KubeResourceReportChartRequest

out = OutputProject()

shell_script = OutputFile_ShellScript('create_gke.sh')
out.append(shell_script)

shell_script.append('set -e')

#
# OUTPUTFILE: app-namespace.yaml
#
file = OutputFile_Kubernetes('app-namespace.yaml')

file.append([
    {
        'apiVersion': 'v1',
        'kind': 'Namespace',
        'metadata': {
            'name': 'app-monitoring',
        },
    }
])

out.append(file)
shell_script.append(OD_FileTemplate(f'kubectl apply -f ${{FILE_{file.fileid}}}'))

shell_script.append(f'kubectl config set-context --current --namespace=app-monitoring')

#
# SETUP: kube-resource-report
#
kms_req = KubeResourceReportChartRequest(namespace='app-monitoring', values={
    'resources': {
        'requests': {
            'cpu': '5m',
            'memory': '50Mi'
        },
        'limits': {
            'cpu': '10m',
            'memory': '100Mi'
        },
    },
})
kms_chart = kms_req.generate()

#
# OUTPUTFILE: kuberesourcereport.yaml
#
file = OutputFile_Kubernetes('kuberesourcereport.yaml')
out.append(file)

file.append(kms_chart.data)

shell_script.append(OD_FileTemplate(f'kubectl apply -f ${{FILE_{file.fileid}}}'))

#
# Write files
#
out.output(OutputDriver_Print())
# out.output(OutputDriver_Directory('/tmp/build-gke'))

Output:

****** BEGIN FILE: 001-app-namespace.yaml ********
apiVersion: v1
kind: Namespace
metadata:
  name: app-monitoring

****** END FILE: 001-app-namespace.yaml ********
****** BEGIN FILE: 002-kuberesourcereport.yaml ********
apiVersion: v1
kind: ServiceAccount
metadata:
  name: kuberesourcereport
  namespace: app-monitoring
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: kuberesourcereport
rules:
- apiGroups:
  - ''
  resources:
  - nodes
  - pods
  - namespaces
  - services
<...more...>

****** END FILE: 002-kuberesourcereport.yaml ********
****** BEGIN FILE: create_gke.sh ********
#!/bin/bash

set -e
kubectl apply -f 001-app-namespace.yaml
kubectl config set-context --current --namespace=app-monitoring
kubectl apply -f 002-kuberesourcereport.yaml

****** END FILE: create_gke.sh ********

Author

Rangel Reale (rangelreale@gmail.com)

Metadata

Release files for hmi-kuberesourcereport 0.8.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hmi-kuberesourcereport 0.8.1
File Size Uploaded Provenance
hmi_kuberesourcereport-0.8.1.tar.gz 5.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for hmi-kuberesourcereport 0.8.1
File Interpreter ABI Platform
hmi_kuberesourcereport-0.8.1-py3-none-any.whl Python 3 none any Details

Total release size: 12.4 kB

Release files / hmi_kuberesourcereport-0.8.1.tar.gz

Download URL hmi_kuberesourcereport-0.8.1.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
10b7eacf7f587432fdffd720bf7d0117bcefcbb114987e505dfac6017791d999
BLAKE2b-256 checksum
How to use checksums
cfb8cbe4a46eaad9efece633ef5deccbaca13b21690fb88a4674fcb592a8c7c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.8.3

Release files / hmi_kuberesourcereport-0.8.1-py3-none-any.whl

Download URL hmi_kuberesourcereport-0.8.1-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c88195fa9ef3849ef5421aff2eaf9e2624d733fb5d7e76edbcb31e2cdb868809
BLAKE2b-256 checksum
How to use checksums
4ff8553a4513798b8980d5125b7b18594926b6907d78b4c19dadabfb6d85c44a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.8.3

Security for hmi-kuberesourcereport 0.8.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.8.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page