Open whaleqiss opened 1 year ago
Remove the |
from after affinity.
It should be a map, not a string, as the error implies.
Remove the
|
from after affinity.It should be a map, not a string, as the error implies.
I deleted the |
, it's the same. For other components the code written in the same way doesn't give an error.
It's because compactor
under loki-distributed
chart does not take the same syntax as others:
https://github.com/grafana/helm-charts/blob/610ee0630581667fe06af39a5a11059faa54b85d/charts/loki-distributed/templates/compactor/deployment-compactor.yaml#L109
Should be
{{- tpl . $ | nindent 8 }}
comparing other components: https://github.com/grafana/helm-charts/blob/610ee0630581667fe06af39a5a11059faa54b85d/charts/loki-distributed/templates/gateway/deployment-gateway.yaml#L95 https://github.com/grafana/helm-charts/blob/610ee0630581667fe06af39a5a11059faa54b85d/charts/loki-distributed/templates/distributor/deployment-distributor.yaml#L107 https://github.com/grafana/helm-charts/blob/610ee0630581667fe06af39a5a11059faa54b85d/charts/loki-distributed/templates/index-gateway/statefulset-index-gateway.yaml#L102 https://github.com/grafana/helm-charts/blob/610ee0630581667fe06af39a5a11059faa54b85d/charts/loki-distributed/templates/ingester/deployment-ingester.yaml#L106 https://github.com/grafana/helm-charts/blob/610ee0630581667fe06af39a5a11059faa54b85d/charts/loki-distributed/templates/ingester/statefulset-ingester.yaml#L121 https://github.com/grafana/helm-charts/blob/610ee0630581667fe06af39a5a11059faa54b85d/charts/loki-distributed/templates/memcached-chunks/statefulset-memcached-chunks.yaml#L122 ...
comparing other components:
but the same {{- tpl . $ | nindent 8 }}
config for other components
@whaleqiss you might try to modify it locally to see if that fix your problem first, then PR it. i don't have any idea if that the syntax difference was just typo or purposed made. Something like this:
git checkout https://github.com/grafana/helm-charts.git grafana-helm-chart
cd grafana-helm-chart/charts/loki-distributed
vi ./templates/compactor/deployment-compactor.yaml
# change to {{- toYaml . | nindent 8 }}
helm install <your-release-name> .
Nothing changed :( it’s the same error
@whaleqiss
Here is my work manifest for Loki-distributed
compactor:
...
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: name
operator: In
values:
- infrastructure
- matchExpressions:
- key: type
operator: In
values:
- db
gateway:
...
affinity: |
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: name
operator: In
values:
- infrastructure
- matchExpressions:
- key: type
operator: In
values:
- db
I use |
everywhere in affinity section except compactor.
Hello, when in compactor section I write this code:
Flux give me this error:
Helm upgrade failed: error validating "": error validating data: ValidationError(Deployment.spec.template.spec.affinity): invalid type for io.k8s.api.core.v1.Affinity: got "string", expected "map"