-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"conflicting fieldspecs" when trying to enable creation of antiAffinity commonLabel selectors #1013
Comments
Looks like the only thing you need to do is add an empty matchLabels:. No need to override the default kustomizeconfig. I think you could close the bug This file as resource: ---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: elasticsearch-data
spec:
serviceName: elasticsearch-data
replicas: 3
updateStrategy:
type: RollingUpdate
selector:
matchLabels:
tier: logging-plane
template:
metadata:
labels:
tier: logging-plane
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchLabels:
matchExpressions:
- key: app.kubernetes.io/app
operator: In
values:
- elasticsearch
- key: role
operator: In
values:
- data
topologyKey: kubernetes.io/hostname produces: apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
app: elasticsearch
app.kubernetes.io/app: elasticsearch
role: master
name: elasticsearch-data
spec:
replicas: 3
selector:
matchLabels:
app: elasticsearch
app.kubernetes.io/app: elasticsearch
role: master
tier: logging-plane
serviceName: elasticsearch-data
template:
metadata:
labels:
app: elasticsearch
app.kubernetes.io/app: elasticsearch
role: master
tier: logging-plane
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/app
operator: In
values:
- elasticsearch
- key: role
operator: In
values:
- data
matchLabels:
app: elasticsearch
app.kubernetes.io/app: elasticsearch
role: master
topologyKey: kubernetes.io/hostname
weight: 100
updateStrategy:
type: RollingUpdate |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
I'm hitting the same issue, is the workaround of having an empty commonLabels:
- path: spec/selector/matchLabels
create: true
group: policy
kind: PodDisruptionBudget @natasha41575 sorry for the random ping, but I've seen you active around this project |
@aexvir I think PodDisruptionBudgets are included in commonLabels propagation by default! I had the same issue and just removing the configuration fixed it for me. |
Similar to #817 but in my case I want to enable the addition of commonLabels to specific selectors. I have a StatefulSet for Elasticsearch for which I currently have to define these manually:
The default transformer config disables auto-creation:
I figured I could just create a new file with
create
set totrue
and then reference it in thekustomization.yaml
file like so:But when I try and do a
kustomize build .
I get the following error:The text was updated successfully, but these errors were encountered: