kopf

A Python framework to write Kubernetes operators in just a few lines of code

MIT License

Downloads
400.1K
Stars
2K
Committers
53

Bot releases are hidden (Show)

kopf - 0.22

Published by nolar about 4 years ago

Originally released on 2019-10-23 17:19:02+00:00 (link).

Bugfixes:

  • Implicit logging events obey the configured level. #192 #188
  • Field-changes detect the sub-fields of change's dict-containers. #191 #190

Internal changes:

  • Diffs are turned from tuples to classes, diff ops — from strings to enums. #191
kopf - 0.23rc1

Published by nolar about 4 years ago

Originally released on 2019-11-13 14:07:04+00:00 (link).

TL;DR: Massive refactoring, renames, code moves. Generally, should be backward-compatible.

RISKY CHANGES (can be BREAKING, should be not):

  • Authentication and API talking are fully reworked: pykube-ng and kubernetes clients are now piggybacked by default to extract the endpoints and credentials, but are not used for the API communication. This can break API connectivity in some cases. #226 #227
  • In-memory containers introduced to carry the technical information/objects/flags for individual resources. This can lead to increased memory usage in huge clusters with thousands of monitored resources. #230
  • @kopf.on.resume() handlers were fixed, and can now execute when previously they were not executed by mistake, but this could be taken as an expected behaviour. This can lead to massive patches of all objects on every operator startup. #230
  • Massive internal renames and code moves; not exposed publicly, unless hacks or monkey-patching were used. #209 #210 #211
  • cause.event is renamed to cause.reason to avoid terminology conflicts. #201

New features:

  • @kopf.on.startup() handlers for operator initialisation. #225
  • @kopf.on.cleanup() handlers for operator shutdown. #225
  • @kopf.on.login() custom authentication handlers. #226
  • @kopf.on.probe() handlers for liveness metrics. #226
  • Pod's liveness probes with kopf run --liveness. #228
  • Explicit owner is not needed in kopf.adopt() and hierarchy methods, current object is used by default. #203
  • retries= limiter for handlers in addition to timeout=. #222
  • errors=TEMPORARY, errors=PERMANENT, errors=IGNORED modes for handlers. #222

Bugfixes:

  • @kopf.on.resume() handlers are not repeated every few minutes for no reason. #229 #230
  • @kopf.on.resume() are executed if they go after the on-create/on-update handlers. #230
  • @kopf.on.resume() can be retried in case of temporary or arbitrary errors. #230
  • @kopf.on.resume() can have sub-handlers. #230
  • There can be 2+ of the@kopf.on.resume() handlers. #230
  • spec, status, metadata fields are not added to the body when absent. #198
  • Ignore asyncio signal handlers on Windows. #220

Internal changes:

  • Fully type-annotated in the code (not in the tests). #195 #196 #197 #200 #201
  • Fully asynchronous internally (asyncio/aiohttp); synchronous pykube-ng client is removed. #217 #227
  • Handler outcomes and persistent state management separated from each other. #221
  • E2E tests are now isolated from each other, preventing false-positives. #205
  • The latest k8s & minikube versions are used in e2e tests. #193
kopf - 0.23rc2

Published by nolar about 4 years ago

Originally released on 2019-11-14 11:10:09+00:00 (link).

Improvements:

  • @kopf.on.resume() handlers are not invoked if the object is being deleted. #233
  • @kopf.on.resume() can be explicitly marked as a deletion-safe handler. #233
kopf - 0.23rc3

Published by nolar about 4 years ago

Originally released on 2019-11-14 13:47:58+00:00 (link).

New features:

  • memo kwargs to keep the runtime-only operator-lifetime-limited arbitrary values. #234
kopf - 0.23rc4

Published by nolar about 4 years ago

Originally released on 2019-11-15 11:42:02+00:00 (link).

Internal changes:

  • Avoid logging of empty meaningless diffs in on-resume handlers. #236
  • Avoid patching the objects if there is no need to patch (and skip logging). #236
  • Avoid purging the handler progress if there is only one handler (and skip logging). #236
  • Add kex as an alias for KopfExample CRD for demos/docs. #235
kopf - 0.23

Published by nolar about 4 years ago

Originally released on 2019-11-20 10:15:07+00:00 (link).

TL;DR: Massive refactoring, renames, code moves. Generally, should be backward-compatible.

RISKY CHANGES (can be BREAKING, should be not):

  • Authentication and API talking are fully reworked: pykube-ng and kubernetes clients are now piggybacked by default to extract the endpoints and credentials, but are not used for the API communication. This can break API connectivity in some cases. #226 #227
  • In-memory structures were introduced to carry the technical information/objects/flags for individual resources. This can lead to increased memory usage in huge clusters with thousands of monitored resources. #230
  • @kopf.on.resume() handlers were fixed, and now execute when previously they were not executed by mistake, but this could be taken as an expected behaviour. This can lead to massive patches of all resumable objects on every operator startup (if there are 2+ handlers), which can be a problem in huge clusters. #230 #236
  • Massive internal renames and code moves; not exposed publicly, unless hacks or monkey-patching were used. #209 #210 #211

New features:

  • @kopf.on.startup() handlers for operator initialisation. #225
  • @kopf.on.cleanup() handlers for operator shutdown. #225
  • @kopf.on.login() custom authentication handlers. #226
  • @kopf.on.probe() handlers for liveness metrics. #226
  • Liveness probes with kopf run --liveness. #228
  • memo kwargs to keep runtime-only operator-lifetime-limited arbitrary values. #234
  • retries= limiter for handlers in addition to timeout=. #222
  • errors=TEMPORARY, errors=PERMANENT, errors=IGNORED modes for handlers. #222
  • Explicit owner is not needed in kopf.adopt() and hierarchy methods, current object is used by default. #203

Bugfixes:

  • @kopf.on.resume() handlers fixed:
    • There can be more than one resuming handler. #230
    • Are executed if they go after the on-create/on-update handlers. #230
    • Are not repeated every few minutes for no reason, guaranteed to be called once. #229 #230
    • Can be retried in case of temporary or arbitrary errors. #230
    • Can have sub-handlers. #230
    • Are not invoked if the object is being deleted. #233
    • Can be explicitly marked as deletion-safe, and hence be invoked on resuming during deletion. #233
  • spec, status, metadata fields are not added to the body when originally absent. #198
  • OS signal handlers are ignored on Windows (not supported by asyncio). #220

Internal changes:

  • Fully type-annotated in the code (not in the tests). #195 #196 #197 #200 #201
  • Fully asynchronous internally (asyncio/aiohttp); synchronous pykube-ng client is removed. #217 #227
  • Handler outcomes and persistent state management separated from each other. #221
  • E2E tests are now isolated from each other, preventing false-positives. #205
  • The latest k8s & minikube versions are used in e2e tests. #193
  • No logging of empty meaningless diffs in on-resume and other handlers. #236
  • No patching of the objects if there is no need to patch (and no logging). #236
  • No purging of the handler progress if there is only one handler (and no logging). #236
  • cause.event is renamed to cause.reason to avoid terminology conflicts. #201
  • kex is added as an alias for KopfExample CRD for demos/docs. #235
kopf - 0.23rc5

Published by nolar about 4 years ago

Originally released on 2019-11-20 01:11:43+00:00 (link).

Bugfixes:

  • Raw data for CA, client certificates and private keys are accepted. #244
  • Authorization: Bearer is not injected by default, breaking username+password auth. #243
kopf - 0.23.1

Published by nolar about 4 years ago

Originally released on 2019-11-20 18:06:35+00:00 (link).

Bugfixes:

  • Hot-fix the cluster-scoped resource discovery in the namespaced operators. #250
kopf - 0.23.2

Published by nolar about 4 years ago

Originally released on 2019-11-21 12:53:24+00:00 (link).

Bugfixes:

  • Fix an issue with crashing on startup due to 404 on peerings in the default auto-detection mode. #252
kopf - 0.24rc1

Published by nolar about 4 years ago

Originally released on 2019-12-19 13:44:56+00:00 (link).

Improvements:

  • Process the changes happened during the freeze mode once unfrozen. #256 #257
  • CRD's status field references fixed to match the examples. #262
  • cooldown is renamed to backoff to match the usual terminology. #266

Bugfixes:

  • "Line is too long" for objects longer than 128 KB in JSON (e.g. encrypted secrets). #276

Internal changes:

  • CI/CD dependencies pinned to fight the unexpected changes. #265 #274
  • Minikube's RBAC-only mode is relaxed to "Node,RBAC". #270
kopf - 0.24

Published by nolar about 4 years ago

Originally released on 2019-12-19 13:44:56+00:00 (link).

Improvements:

  • Process the changes happened during the freeze mode once unfrozen. #256 #257
  • CRD's status field references fixed to match the examples. #262
  • cooldown is renamed to backoff to match the usual terminology. #266

Bugfixes:

  • "Line is too long" for objects longer than 128 KB in JSON (e.g. encrypted secrets). #276

Internal changes:

  • CI/CD dependencies pinned to fight the unexpected changes. #265 #274
  • Minikube's RBAC-only mode is relaxed to "Node,RBAC". #270
kopf - 0.25rc1

Published by nolar about 4 years ago

Originally released on 2020-01-17 16:32:12+00:00 (link).

New features:

  • Handler/resource filtering with arbitrary callbacks in when= option. #258 #288

Bugfixes:

  • Reaction cycle stops in the middle with no messages (improper "now" comparison). #285

Internal improvements:

  • aiohttp 4.x readiness (restriction to stay on 3.x). #277
  • Better GitHub issue/PR templates. #278
kopf - 0.25

Published by nolar about 4 years ago

Originally released on 2020-01-29 14:04:33+00:00 (link).

New features:

  • Handler/resource filtering with arbitrary callbacks in when= option. #258 #288

Bugfixes:

  • Reaction cycle stops in the middle with no messages (improper "now" comparison). #285

Internal improvements:

  • aiohttp 4.x readiness (restriction to stay on 3.x). #277
  • Better GitHub issue/PR templates. #278
kopf - 0.26rc1

Published by nolar about 4 years ago

Originally released on 2020-02-20 16:05:16+00:00 (link).

Improvements:

  • Status as a sub-resource is detected and patched via separate API endpoints. #313
  • Security: Stop exposing the Authorization: and other HTTP headers in logs. #306
  • Documentation's little fixes. #97 #303

CI/CD automation:

  • Warnings now do fail the tests (warnings must be fixed — same as regular errors). #312
  • Python 3.8 in CI/CD. Python 3.7 is still tested. Python 3.9-dev for preview. #314
  • LGTM checks added to CI/CD, code improved. #302

Internal changes:

  • Rebalanced modules for lower complexity: classes & functions moved. #298
  • Deprecate prefixes and proxying methods of registries, make registries simpler. #315
kopf - 0.26

Published by nolar about 4 years ago

Originally released on 2020-02-20 16:05:16+00:00 (link).

Improvements:

  • Status as a sub-resource is detected and patched via separate API endpoints. #313
  • Security: Stop exposing the Authorization: and other HTTP headers in logs. #306
  • Documentation's little fixes. #97 #303

CI/CD automation:

  • Warnings now do fail the tests (warnings must be fixed — same as regular errors). #312
  • Python 3.8 in CI/CD. Python 3.7 is still tested. Python 3.9-dev for preview. #314
  • LGTM checks added to CI/CD, code improved. #302

Internal changes:

  • Rebalanced modules for lower complexity: classes & functions moved. #298
  • Deprecate prefixes and proxying methods of registries, make registries simpler. #315
kopf - 0.27rc1

Published by nolar about 4 years ago

Originally released on 2020-04-01 10:17:05+00:00 (link).

WARNING: The changes are backward-compatible (in theory). But the changes are also massive, so things can break unexpectedly (in practice). Test this upgrade carefully.

New features:

  • @kopf.daemon for background resource-accompanying tasks/threads. #330
  • @kopf.timer for regular and/or delayed activities & checks. #330
  • kopf.PRESENT for labels/annotations filters (instead of misleading None). #327
  • kopf.ABSENT for labels/annotations filters. #327
  • Arbitrary callbacks for labels/annotations filters. #328
  • A proper official documented way to configure operators; plus docs. #336 #337
  • Operators can be configured to use their own names for persistence, allowing multiple non-colliding operators for the same resources. #331

Improvements:

  • Internals instant functions (lifecycles, when-filters) do not use thread pools anymore. #326
  • Documentation is restructured for separate pages for all aspects of handling (kwargs, filters, etc). #325
  • Bodies & patches now have magical properties for metadata, spec, status, with "live view" into data. #327
  • Labels and annotations are passed as additional kwargs (similar to body/spec/meta/status). #327
  • Configurable client-side timeouts for watch requests. #322 #336
  • Configurable storages for handling state & diff-bases. #331

Fixes:

  • Threads from the sync handlers executors are not leaked (not left orphaned) at exit. #326
  • Handlers' state is now persisted in annotations, not in status: for custom & built-in resources. This solves the issues with built-ins not handled properly in K8s 1.16+. #331

Internal changes:

  • Compatibility with Kubernetes 1.18 in CI/CD. #335
kopf - 0.27rc2

Published by nolar about 4 years ago

Originally released on 2020-04-07 12:07:16+00:00 (link).

Improvements:

  • Make finalizer's name configurable. #344
  • Daemons-with-filters' behaviour is clarified: stop when mismatches, re-spawn when matches again. #342
  • All user-facing types and classes are published as framework's public interface (via top-level package). #341

Fixes:

  • Fix the on-field handler not being invoked when the diff is too generic (relative to the field). #340
  • Provoke after-sleep handling cycles even on resources with no arbitrary field preservation. #343
kopf - 0.27rc3

Published by nolar about 4 years ago

Originally released on 2020-04-08 14:52:29+00:00 (link).

Improvements:

  • kopf.all_(), kopf.any_(), kopf.not_(), kopf.none_() helpers for callbacks aggregation. #345
kopf - 0.27rc4

Published by nolar about 4 years ago

Originally released on 2020-04-16 17:02:14+00:00 (link).

Fixes:

  • Limit annotation names for handlers' statuses to 63 characters. #346
kopf - 0.27rc5

Published by nolar about 4 years ago

Originally released on 2020-04-28 12:29:32+00:00 (link).

Fixes:

  • Restrict annotation names to end with alphanumeric characters only. #353

Internal changes:

  • pytest & pytest-asyncio are pinned temporarily until fixed on their side. #352