metadata : name : webapp-config-watcher spec : configMap : webapp-config podSelector : app : webapp 

Reference to ConfigMap to watch 

Label selector to determine Pods to restart 

In this definition, the attribute configMap  references the name of the ConfigMap  to watch. The field podSelector  is a collection of labels and their values, which identify the Pods to restart. 

We can define the type of this custom resource with a CRD, as shown in Example 23-6. 

apiVersion : apiextensions.k8s.io/v1beta1 kind : CustomResourceDefinition metadata : name : configwatchers.k8spatterns.io spec : scope : Namespaced group : k8spatterns.io version : v1 names : kind : ConfigWatcher singular : configwatcher plural : configwatchers validation : openAPIV3Schema : properties : spec : properties : configMap : type : string description : "Name of the ConfigMap" podSelector : type : object description : "Label selector for Pods" additionalProperties : type : string 

Connected to a namespace 

Dedicated API group 

