The Watcher CR configures the Kyma Control Plane (KCP) setup and Runtime Watcher on Kyma runtimes. Read the following document to see the parameters that the CR consists of.
apiVersion: operator.kyma-project.io/v1beta2
kind: Watcher
metadata:
name: <name>
namespace: kcp-system
spec:
resourceToWatch:
group: <api-group>
version: <version>
resource: <kind>
labelsToWatch:
"<some>": "<label>"
field: <"spec" or "status">
manager: <manager-name>
serviceInfo:
name: <service-name>
port: <port>
namespace: <namespace>
gateway: # don't change
selector:
matchLabels:
"operator.kyma-project.io/watcher-gateway": "default"The spec.resourceToWatch field specifies the GVK of the resources Runtime Watcher watches. Note that spec.resourceToWatch.resource must be the API resource name, not the kind of the resource. For example, it must be "configmaps" instead of "ConfigMap". It is possible to specify the wildcard * for spec.resourceToWatch.version.
Optionally, the spec.labelsToWatch field allows to filter the resources by a specific label value.
Note
Runtime Watcher does not provide a mechanism to add this label to the resources. You must ensure that the resources you want to watch have this label.
The spec.field field specifies what parts of the watched object trigger events. Allowed values are spec and status.
If status is specified, watch events are only emitted if the .status subresource of the watched object changes. The ValidatingWebhookConfiguration is configured to watch only the status subresource. For example, "pods/status" instead of "pods".
If spec is specified, watch events are only emitted if the .spec field of the watched object changes. If the object doesn't contain a .spec field, it falls back to emit a watch event on any change to the object, including changes to metadata or status.
The spec.manager field defines the URL path to which the Runtime Watcher sends events. The entire path follows the format /v2/<spec.manager>/event. Accordingly, a VirtualService is created that matches the prefix /v2/<spec.manager>/event and routes received requests to the Service defined in spec.serviceInfo.
Note
In Kyma runtime, this setting configures the ValidatingWebhookConfiguration to call /validate/<spec.manager> of the Runtime Watcher deployment.
The spec.serviceInfo specifies the name, namespace, and port to which events received from the Runtime Watcher are routed.
The spec.gateway field defines the label selector of the Istio Gateway in KCP. Don't change the default value.