service_selector.proto

Package : core.zephyr.solo.io

Top

service_selector.proto

Table of Contents

ServiceSelector

Select Kubernetes services
Only one of (labels + namespaces + cluster) or (resource refs) may be provided. If all four are provided, it will be considered an error, and the Status of the top level resource will be updated to reflect an IllegalSelection.
Valid: 1. selector: matcher: labels: foo: bar hello: world namespaces: - default cluster: “cluster-name” 2. selector: matcher: refs: - name: foo namespace: bar
Invalid: 1. selector: matcher: labels: foo: bar hello: world namespaces: - default cluster: “cluster-name” refs: - name: foo namespace: bar
By default labels will select across all namespaces, unless a list of namespaces is provided, in which case it will only select from those. An empty list is equal to AllNamespaces.
If no labels are given, and only namespaces, all resources from the namespaces will be selected.
The following selector will select all resources with the following labels in every namespace, in the local cluster:
selector: matcher: labels: foo: bar hello: world
Whereas the next selector will only select from the specified namespaces (foo, bar), in the local cluster:
selector: matcher: labels: foo: bar hello: world namespaces - foo - bar
This final selector will select all resources of a given type in the target namespace (foo), in the local cluster:
selector matcher: namespaces - foo - bar labels: hello: world

Field Type Label Description
matcher ServiceSelector.Matcher
serviceRefs ServiceSelector.ServiceRefs

ServiceSelector.Matcher

Field Type Label Description
labels []ServiceSelector.Matcher.LabelsEntry repeated If specified, all labels must exist on k8s Service, else match on any labels.
namespaces []string repeated If specified, match k8s Services if they exist in one of the specified namespaces. If not specified, match on any namespace.
clusters []string repeated If specified, match k8s Services if they exist in one of the specified clusters. If not specified, match on any cluster.

ServiceSelector.Matcher.LabelsEntry

Field Type Label Description
key string
value string

ServiceSelector.ServiceRefs

Field Type Label Description
services []ResourceRef repeated Match k8s Services by direct reference.