nolar / kopf

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

Home Page:https://kopf.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to invoke kopf when only operating against cluster level resources

iciclespider opened this issue · comments

Keywords

cluster only

Problem

When kopf is invoked without either --namespace or --all-namespaces, the following warning is emitted:

/opt/aws-auth/.venv/lib/python3.11/site-packages/kopf/_core/reactor/running.py:176: FutureWarning: Absence of either namespaces or cluster-wide flag will become an error soon. For now, switching to the cluster-wide mode for backward compatibility.
  warnings.warn("Absence of either namespaces or cluster-wide flag will become an error soon."

My operator is only operating against cluster level crds.

How should kopf be invoked in this case?

You should use the --all-namespaces flag if your operator is operating cluster-wide, i.e. handling resources in all namespaces.

@iciclespider please close this issue if your question is answered.