Skip to main content

Kubernetes Resource Manager with retry logic and reconciliation utilities

Project description

charmarr-lib-krm

Kubernetes Resource Manager with retry logic and reconciliation utilities.

Features

  • Generic CRUD operations for any K8s resource type via lightkube
  • Automatic retry on transient errors (409 Conflict, 429 Rate Limit, 5xx)
  • Strategic merge patch and server-side apply support
  • Reconciliation result types for idempotent operations

Installation

pip install charmarr-lib-krm

Usage

from charmarr_lib.krm import K8sResourceManager, ReconcileResult
from lightkube.resources.apps_v1 import StatefulSet

# Create manager (uses in-cluster config or kubeconfig)
manager = K8sResourceManager()

# Get a resource
sts = manager.get(StatefulSet, "my-app", "my-namespace")

# Patch with automatic retry on conflict
manager.patch(StatefulSet, "my-app", patch_data, "my-namespace")

# Server-side apply for idempotent create/update
manager.apply(resource)

# Check existence
if manager.exists(StatefulSet, "my-app", "my-namespace"):
    ...

# Delete with 404 handling
deleted = manager.delete(StatefulSet, "my-app", "my-namespace")

License

LGPL-3.0-or-later

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

charmarr_lib_krm-0.1.1.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

charmarr_lib_krm-0.1.1-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file charmarr_lib_krm-0.1.1.tar.gz.

File metadata

  • Download URL: charmarr_lib_krm-0.1.1.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for charmarr_lib_krm-0.1.1.tar.gz
Algorithm Hash digest
SHA256 cebc5b970039eacfe26ca5958a9f2434fd63a4798cbb95185998195210b07981
MD5 45483d36d3461ee04ffac8a444207f7f
BLAKE2b-256 96f530d996f98eefce2641573150188950218e1df00ad1c8653c8f09b24080d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for charmarr_lib_krm-0.1.1.tar.gz:

Publisher: release.yml on charmarr/charmarr-lib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file charmarr_lib_krm-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for charmarr_lib_krm-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 60f53f315e26b70a3a87e0406fcaf3e9d5007a04600e867b6de141f36a99f974
MD5 53bc299e1ec91c6536bd62012483bbc8
BLAKE2b-256 f8f087a813810a7e26bc4b729d37834a3a4100e91f6f26055655af2b8aa13f4c

See more details on using hashes here.

Provenance

The following attestation bundles were made for charmarr_lib_krm-0.1.1-py3-none-any.whl:

Publisher: release.yml on charmarr/charmarr-lib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page