-
Notifications
You must be signed in to change notification settings - Fork 347
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
Support creating PodDisruptionBudget policies via helm chart #240
Comments
Agreed. I tried to use the "extraObjects" to do that, but I could not find any way to add the proper labels, because apparently all templated values inside the "extraObjects" list must be quoted. Examples of what I tried and did not work: # Error: failed to parse values.yml: error converting YAML to JSON: yaml: line 192: did not find expected node content
# helm.go:84: [debug] error converting YAML to JSON: yaml: line 192: did not find expected node content
extraObjects:
- apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: '{{ template "jaeger.collector.name" . }}'
labels: # This is line 192
{{- include "jaeger.labels" . | nindent 4 }}
app.kubernetes.io/component: collector
spec:
minAvailable: 1
selector:
matchLabels:
app.kubernetes.io/instance: '{{ .Release.Name }}'
app.kubernetes.io/component: collector
# Error: failed to parse values.yml: error converting YAML to JSON: yaml: line 193: did not find expected key
# helm.go:84: [debug] error converting YAML to JSON: yaml: line 193: did not find expected key
extraObjects:
- apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: '{{ template "jaeger.collector.name" . }}'
labels: # This is line 192
'{{- include "jaeger.labels" . | nindent 4 }}'
app.kubernetes.io/component: collector
spec:
minAvailable: 1
selector:
matchLabels:
app.kubernetes.io/instance: '{{ .Release.Name }}'
app.kubernetes.io/component: collector
# Renders an invalid PDB because "labels:" becomes a single multiline string
extraObjects:
- apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: '{{ template "jaeger.collector.name" . }}'
labels: # This is line 192
'{{- include "jaeger.labels" . | nindent 4 }}'
spec:
minAvailable: 1
selector:
matchLabels:
app.kubernetes.io/instance: '{{ .Release.Name }}'
app.kubernetes.io/component: collector Even the documentation's example does not work! Notice the absence of quotes in line 191. # Error: failed to parse values.yml: error converting YAML to JSON: yaml: line 190: did not find expected key
extraObjects:
- apiVersion: policy/v1
kind: PodDisruptionBudget
metadata: # This is line 190
name: {{ .Release.Name }}-somePDB
spec:
minAvailable: 1
selector:
matchLabels:
app.kubernetes.io/instance: '{{ .Release.Name }}'
app.kubernetes.io/component: collector I also tried using a template to set "spec.minAvailable" based on the minimum number of replicas of the Horizontal Pod Autoscaler, but since everything templated becomes a string it renders and invalid PDB. |
@oncipriani, You're seeing that error as values files must be valid YAML before being parsed by helm. The example in extraObjects:
- apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: '{{ template "jaeger.collector.name" . }}'
labels:
app.kubernetes.io/component: collector{{- include "jaeger.labels" . | nindent 4 }}
spec:
minAvailable: 1
selector:
matchLabels:
app.kubernetes.io/instance: '{{ .Release.Name }}'
app.kubernetes.io/component: collector
|
It would be nice to be able to specify values for podDisruptionBudget for deployments in helm chart. These policies can be created manually, but having them under same lifecycle as rest of chart is much more preferred.
The text was updated successfully, but these errors were encountered: