Syncrd is a custom-controller that allows automatic synchronization of any namespaced kubernetes resource, including custom resources. This controller includes a custom resource, "Syncr", that indicates that group/type of the resource to be copied along with the namespace and name. The resource also has a field for matchLabels to restrict which namespaces the resource is copied to.
The following fields of the Syncr spec indicate the source resource to be copied:
- apiGroup (for core resources, use an empty string)
- apiVersion
- kind
- namespace
- name
The following field is used to restrict the namespaces the resource is copied to:
- matchLabels
Here is a sample Syncr definition for syncing a core resource:
apiVersion: syncrd.atteg.com/v1beta1
kind: Syncr
metadata:
name: samplesyncr
namespace: default
spec:
apiGroup: ""
apiResource: kconfigs
apiVersion: v1alpha1
matchLabels:
mylabel: myvalue
name: sourceresourcename
namespace: default
Here is a sample Syncr definition for syncing a custom resource:
apiVersion: syncrd.atteg.com/v1beta1
kind: Syncr
metadata:
name: samplesyncr
namespace: default
spec:
apiGroup: customgroup.atteg.com
apiResource: customKind
apiVersion: v1beta1
matchLabels:
somelabel: somevalue
name: resourcename
namespace: default