mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +00:00
Add common labels to pod affinity/anti-affinity label selector
This commit is contained in:
@@ -52,6 +52,32 @@ var defaultLabelsPathConfigs = []PathConfig{
|
|||||||
Path: []string{"spec", "template", "metadata", "labels"},
|
Path: []string{"spec", "template", "metadata", "labels"},
|
||||||
CreateIfNotPresent: true,
|
CreateIfNotPresent: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
GroupVersionKind: &schema.GroupVersionKind{Group: "apps", Kind: "Deployment"},
|
||||||
|
Path: []string{"spec", "template", "spec", "affinity", "podAffinity",
|
||||||
|
"preferredDuringSchedulingIgnoredDuringExecution",
|
||||||
|
"podAffinityTerm", "labelSelector", "matchLabels"},
|
||||||
|
CreateIfNotPresent: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
GroupVersionKind: &schema.GroupVersionKind{Group: "apps", Kind: "Deployment"},
|
||||||
|
Path: []string{"spec", "template", "spec", "affinity", "podAffinity",
|
||||||
|
"requiredDuringSchedulingIgnoredDuringExecution", "labelSelector", "matchLabels"},
|
||||||
|
CreateIfNotPresent: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
GroupVersionKind: &schema.GroupVersionKind{Group: "apps", Kind: "Deployment"},
|
||||||
|
Path: []string{"spec", "template", "spec", "affinity", "podAntiAffinity",
|
||||||
|
"preferredDuringSchedulingIgnoredDuringExecution",
|
||||||
|
"podAffinityTerm", "labelSelector", "matchLabels"},
|
||||||
|
CreateIfNotPresent: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
GroupVersionKind: &schema.GroupVersionKind{Group: "apps", Kind: "Deployment"},
|
||||||
|
Path: []string{"spec", "template", "spec", "affinity", "podAntiAffinity",
|
||||||
|
"requiredDuringSchedulingIgnoredDuringExecution", "labelSelector", "matchLabels"},
|
||||||
|
CreateIfNotPresent: false,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
GroupVersionKind: &schema.GroupVersionKind{Kind: "ReplicaSet"},
|
GroupVersionKind: &schema.GroupVersionKind{Kind: "ReplicaSet"},
|
||||||
Path: []string{"spec", "selector", "matchLabels"},
|
Path: []string{"spec", "selector", "matchLabels"},
|
||||||
@@ -82,6 +108,32 @@ var defaultLabelsPathConfigs = []PathConfig{
|
|||||||
Path: []string{"spec", "template", "metadata", "labels"},
|
Path: []string{"spec", "template", "metadata", "labels"},
|
||||||
CreateIfNotPresent: true,
|
CreateIfNotPresent: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
GroupVersionKind: &schema.GroupVersionKind{Group: "apps", Kind: "StatefulSet"},
|
||||||
|
Path: []string{"spec", "template", "spec", "affinity", "podAffinity",
|
||||||
|
"preferredDuringSchedulingIgnoredDuringExecution",
|
||||||
|
"podAffinityTerm", "labelSelector", "matchLabels"},
|
||||||
|
CreateIfNotPresent: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
GroupVersionKind: &schema.GroupVersionKind{Group: "apps", Kind: "StatefulSet"},
|
||||||
|
Path: []string{"spec", "template", "spec", "affinity", "podAffinity",
|
||||||
|
"requiredDuringSchedulingIgnoredDuringExecution", "labelSelector", "matchLabels"},
|
||||||
|
CreateIfNotPresent: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
GroupVersionKind: &schema.GroupVersionKind{Group: "apps", Kind: "StatefulSet"},
|
||||||
|
Path: []string{"spec", "template", "spec", "affinity", "podAntiAffinity",
|
||||||
|
"preferredDuringSchedulingIgnoredDuringExecution",
|
||||||
|
"podAffinityTerm", "labelSelector", "matchLabels"},
|
||||||
|
CreateIfNotPresent: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
GroupVersionKind: &schema.GroupVersionKind{Group: "apps", Kind: "StatefulSet"},
|
||||||
|
Path: []string{"spec", "template", "spec", "affinity", "podAntiAffinity",
|
||||||
|
"requiredDuringSchedulingIgnoredDuringExecution", "labelSelector", "matchLabels"},
|
||||||
|
CreateIfNotPresent: false,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
GroupVersionKind: &schema.GroupVersionKind{Group: "batch", Kind: "Job"},
|
GroupVersionKind: &schema.GroupVersionKind{Group: "batch", Kind: "Job"},
|
||||||
Path: []string{"spec", "selector", "matchLabels"},
|
Path: []string{"spec", "selector", "matchLabels"},
|
||||||
|
|||||||
Reference in New Issue
Block a user