-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Affinity values result in error #1819
Comments
What's the chart you're using? If it's an internal chart, perhaps you could suggest the minimal conditions necessary to reproduce the problem (my guess is: a chart that inlines a string as YAML in a template) |
This is indeed an internal chart which was made with |
I do have the same issue with the above affinity settings with the public |
Perfect, we can use that to try and reproduce the problem. |
You are declaring your affinity rules as a so called 'literal block' (using a pipe You will also note this when trying to replicate this issue using the $ helm install stable/nginx-ingress --name nginx-ingress -f values.yaml
Error: release nginx-ingress failed: Deployment in version "v1beta1" cannot be handled as a Deployment: v1beta1.Deployment.Spec: v1beta1.DeploymentSpec.Template: v1.PodTemplateSpec.Spec: v1.PodSpec.Affinity: readObjectStart: expect { or n, but found ", error found in #10 byte of ...|ffinity":"podAntiAff|..., bigger context ...|,"release":"nginx-ingress"}},"spec":{"affinity":"podAntiAffinity:\n preferredDuringSchedulingIgnor|...` To summarize: the following ---
apiVersion: flux.weave.works/v1beta1
kind: HelmRelease
metadata:
name: nginx-ingress
namespace: default
spec:
releaseName: nginx-ingress
chart:
repository: https://kubernetes-charts.storage.googleapis.com/
name: nginx-ingress
version: 1.4.0
values:
controller:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
topologyKey: kubernetes.io/hostname
labelSelector:
matchLabels:
app: nginx-ingress
release: nginx-ingres and generates the following
|
I thought I'd tried it without the pipe and got the same error but this is working perfectly for me now. Thanks @hiddeco! |
I normally set the following in my charts for affinity settings:
Setting something like this in flux for a chart's
values:
results in:Even if I put
topologyKey
,app
andrelease
in strings.After deleting the release, flux outputs:
The text was updated successfully, but these errors were encountered: