-
Notifications
You must be signed in to change notification settings - Fork 0
Helmchanges #48
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
base: main
Are you sure you want to change the base?
Helmchanges #48
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| {{- if .Values.chatserver.podDisruptionBudget.enabled }} | ||
| apiVersion: policy/v1 | ||
| kind: PodDisruptionBudget | ||
| metadata: | ||
| name: {{ include "chatserver.name" . }}-pdb | ||
| namespace: {{ include "chatserver.namespace" . }} | ||
| labels: | ||
| {{ include "chatserver.labels" . | nindent 4 }} | ||
| spec: | ||
| {{- if .Values.chatserver.podDisruptionBudget.minAvailable }} | ||
| minAvailable: {{ .Values.chatserver.podDisruptionBudget.minAvailable }} | ||
| {{- else if .Values.chatserver.podDisruptionBudget.maxUnavailable }} | ||
| maxUnavailable: {{ .Values.chatserver.podDisruptionBudget.maxUnavailable }} | ||
| {{- end }} | ||
| selector: | ||
| matchLabels: | ||
| {{ include "chatserver.selectorLabels" . | nindent 6 }} | ||
| {{- end }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| {{- if .Values.deployment.podDisruptionBudget.enabled }} | ||
| apiVersion: policy/v1 | ||
| kind: PodDisruptionBudget | ||
| metadata: | ||
| name: {{ include "server.name" . }}-pdb | ||
| namespace: {{ include "gopie.namespace" . }} | ||
| labels: | ||
| {{ include "server.labels" . | nindent 4 }} | ||
| spec: | ||
| {{- if .Values.deployment.podDisruptionBudget.minAvailable }} | ||
| minAvailable: {{ .Values.deployment.podDisruptionBudget.minAvailable }} | ||
| {{- else if .Values.deployment.podDisruptionBudget.maxUnavailable }} | ||
| maxUnavailable: {{ .Values.deployment.podDisruptionBudget.maxUnavailable }} | ||
| {{- end }} | ||
|
Comment on lines
+10
to
+14
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same issue as web PDB: spec may be empty if neither value is configured. Consider adding a default fallback to ensure a valid PDB spec when enabled. This mirrors the pattern needed in Suggested fix {{- if .Values.deployment.podDisruptionBudget.minAvailable }}
minAvailable: {{ .Values.deployment.podDisruptionBudget.minAvailable }}
{{- else if .Values.deployment.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ .Values.deployment.podDisruptionBudget.maxUnavailable }}
+ {{- else }}
+ maxUnavailable: 1
{{- end }}🤖 Prompt for AI Agents |
||
| selector: | ||
| matchLabels: | ||
| {{ include "server.selectorLabels" . | nindent 6 }} | ||
| {{- end }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| apiVersion: monitoring.coreos.com/v1 | ||
| kind: ServiceMonitor | ||
| metadata: | ||
| name: {{ include "server.name" . }} | ||
| namespace: {{ include "gopie.namespace" . }} | ||
| labels: | ||
| {{- include "server.labels" . | nindent 4 }} | ||
| spec: | ||
| selector: | ||
| matchLabels: | ||
| {{- include "server.selectorLabels" . | nindent 6 }} | ||
| endpoints: | ||
| - port: metrics | ||
| path: /metrics | ||
| interval: 30s | ||
| scrapeTimeout: 10s | ||
| honorLabels: true | ||
|
Comment on lines
+1
to
+17
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ServiceMonitor should be conditional to avoid failures when Prometheus Operator is not installed. Unlike the PDB templates which check Consider wrapping this in a conditional and making the scrape settings configurable. Suggested fix+{{- if .Values.server.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "server.name" . }}
namespace: {{ include "gopie.namespace" . }}
labels:
{{- include "server.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "server.selectorLabels" . | nindent 6 }}
endpoints:
- port: metrics
path: /metrics
- interval: 30s
- scrapeTimeout: 10s
+ interval: {{ .Values.server.serviceMonitor.interval | default "30s" }}
+ scrapeTimeout: {{ .Values.server.serviceMonitor.scrapeTimeout | default "10s" }}
honorLabels: true
+{{- end }}Also add the corresponding values in server:
serviceMonitor:
enabled: false
interval: 30s
scrapeTimeout: 10s🧰 Tools🪛 YAMLlint (1.37.1)[error] 7-7: syntax error: expected the node content, but found '-' (syntax) 🤖 Prompt for AI Agents |
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,18 @@ | ||||||||||||||||||||||||||
| {{- if .Values.web.podDisruptionBudget.enabled }} | ||||||||||||||||||||||||||
| apiVersion: policy/v1 | ||||||||||||||||||||||||||
| kind: PodDisruptionBudget | ||||||||||||||||||||||||||
| metadata: | ||||||||||||||||||||||||||
| name: {{ include "web.name" . }}-pdb | ||||||||||||||||||||||||||
| namespace: {{ include "gopie.namespace" . }} | ||||||||||||||||||||||||||
| labels: | ||||||||||||||||||||||||||
| {{ include "web.labels" . | nindent 4 }} | ||||||||||||||||||||||||||
| spec: | ||||||||||||||||||||||||||
| {{- if .Values.web.podDisruptionBudget.minAvailable }} | ||||||||||||||||||||||||||
| minAvailable: {{ .Values.web.podDisruptionBudget.minAvailable }} | ||||||||||||||||||||||||||
| {{- else if .Values.web.podDisruptionBudget.maxUnavailable }} | ||||||||||||||||||||||||||
| maxUnavailable: {{ .Values.web.podDisruptionBudget.maxUnavailable }} | ||||||||||||||||||||||||||
| {{- end }} | ||||||||||||||||||||||||||
|
Comment on lines
+10
to
+14
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PDB spec may be empty if neither minAvailable nor maxUnavailable is configured. When Suggested fix with default {{- if .Values.web.podDisruptionBudget.minAvailable }}
minAvailable: {{ .Values.web.podDisruptionBudget.minAvailable }}
{{- else if .Values.web.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ .Values.web.podDisruptionBudget.maxUnavailable }}
+ {{- else }}
+ maxUnavailable: 1
{{- end }}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||
| selector: | ||||||||||||||||||||||||||
| matchLabels: | ||||||||||||||||||||||||||
| {{ include "web.selectorLabels" . | nindent 6 }} | ||||||||||||||||||||||||||
| {{- end }} | ||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PDB template structure is correct; static analysis hint is a false positive.
The YAMLlint error is expected since this is a Helm template file, not raw YAML—the
{{- if ...}}directive is valid Go templating.However, if
podDisruptionBudget.enabledistruebut neitherminAvailablenormaxUnavailableis configured, the rendered PDB will have an empty spec (missing both fields), which Kubernetes will reject. Consider adding a default or validation.Suggested fix: Add a default minAvailable
spec: {{- if .Values.chatserver.podDisruptionBudget.minAvailable }} minAvailable: {{ .Values.chatserver.podDisruptionBudget.minAvailable }} {{- else if .Values.chatserver.podDisruptionBudget.maxUnavailable }} maxUnavailable: {{ .Values.chatserver.podDisruptionBudget.maxUnavailable }} + {{- else }} + minAvailable: 1 {{- end }}🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 1-1: syntax error: expected the node content, but found '-'
(syntax)
🤖 Prompt for AI Agents