-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Feat: Add HPA & PDB Helm Chart Support #13391 #13512
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
Open
carlosmt86
wants to merge
11
commits into
DefectDojo:dev
Choose a base branch
from
carlosmt86:feat/chart_hpa_pdb_13391
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+303
−5
Open
Changes from 4 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
feeec15
feat(helm): add HPA and PDB support for Django and Celery Beat
carlosmt86 f81de67
add changes requested
carlosmt86 4544224
Merge branch 'dev' into feat/chart_hpa_pdb_13391
carlosmt86 98da46a
fix .Values.django.replicas
carlosmt86 4c70a7b
add changes requested
carlosmt86 b5bb985
Merge branch 'dev' into feat/chart_hpa_pdb_13391
carlosmt86 80f2d5c
fix lint
carlosmt86 0cd2da2
move doc to v2.53
carlosmt86 8bce01c
Merge branch 'dev' into feat/chart_hpa_pdb_13391
carlosmt86 50d0fdc
fix Chart.yaml
carlosmt86 e9bb3ad
Merge branch 'dev' into feat/chart_hpa_pdb_13391
carlosmt86 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| {{- if .Values.celery.worker.autoscaling.enabled -}} | ||
| {{- $fullName := include "defectdojo.fullname" . -}} | ||
| apiVersion: autoscaling/v2 | ||
| kind: HorizontalPodAutoscaler | ||
| metadata: | ||
| {{- with mergeOverwrite dict .Values.extraAnnotations .Values.celery.annotations .Values.celery.worker.annotations }} | ||
| annotations: | ||
| {{- range $key, $value := . }} | ||
| {{ $key }}: {{ quote $value }} | ||
| {{- end }} | ||
| {{- end }} | ||
| name: {{ $fullName }}-celery-worker | ||
| namespace: {{ .Release.Namespace }} | ||
| labels: | ||
| defectdojo.org/component: celery | ||
| defectdojo.org/subcomponent: worker | ||
| app.kubernetes.io/name: {{ include "defectdojo.name" . }} | ||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||
| app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
| helm.sh/chart: {{ include "defectdojo.chart" . }} | ||
| {{- range $key, $value := .Values.extraLabels }} | ||
| {{ $key }}: {{ quote $value }} | ||
| {{- end }} | ||
| spec: | ||
| scaleTargetRef: | ||
| apiVersion: apps/v1 | ||
| kind: "Deployment" | ||
| name: {{ $fullName }}-celery-worker | ||
| minReplicas: {{ .Values.celery.worker.autoscaling.minReplicas }} | ||
| maxReplicas: {{ .Values.celery.worker.autoscaling.maxReplicas }} | ||
| metrics: | ||
| {{- with .Values.celery.worker.autoscaling.targetCPUUtilizationPercentage }} | ||
| - type: Resource | ||
| resource: | ||
| name: cpu | ||
| target: | ||
| averageUtilization: {{ . }} | ||
| type: Utilization | ||
| {{- end }} | ||
| {{- with .Values.celery.worker.autoscaling.targetMemoryUtilizationPercentage }} | ||
| - type: Resource | ||
| resource: | ||
| name: memory | ||
| target: | ||
| averageUtilization: {{ . }} | ||
| type: Utilization | ||
| {{- end }} | ||
| {{- if .Values.celery.worker.autoscaling.autoscaleBehavior }} | ||
carlosmt86 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| behavior: {{ toYaml .Values.celery.worker.autoscaling.autoscaleBehavior | nindent 4 }} | ||
carlosmt86 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| {{- end }} | ||
| {{- end }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| {{- if and .Values.celery.worker.podDisruptionBudget.enabled (or (gt (int .Values.celery.worker.replicas) 1) .Values.celery.worker.autoscaling.enabled) }} | ||
| {{- $fullName := include "defectdojo.fullname" . -}} | ||
| apiVersion: policy/v1 | ||
| kind: PodDisruptionBudget | ||
| metadata: | ||
| {{- with mergeOverwrite dict .Values.extraAnnotations .Values.celery.annotations .Values.celery.worker.annotations }} | ||
| annotations: | ||
| {{- range $key, $value := . }} | ||
| {{ $key }}: {{ quote $value }} | ||
| {{- end }} | ||
| {{- end }} | ||
| labels: | ||
| defectdojo.org/component: celery | ||
| defectdojo.org/subcomponent: worker | ||
| app.kubernetes.io/name: {{ include "defectdojo.name" . }} | ||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||
| app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
| helm.sh/chart: {{ include "defectdojo.chart" . }} | ||
| {{- range $key, $value := .Values.extraLabels }} | ||
| {{ $key }}: {{ quote $value }} | ||
| {{- end }} | ||
| name: {{ $fullName }}-celery-worker | ||
| namespace: {{ .Release.Namespace }} | ||
| spec: | ||
| selector: | ||
| matchLabels: | ||
| app.kubernetes.io/name: {{ include "defectdojo.name" . }} | ||
| defectdojo.org/component: celery | ||
| defectdojo.org/subcomponent: worker | ||
| {{ toYaml (omit .Values.celery.worker.podDisruptionBudget "enabled" ) | indent 2 }} | ||
| {{- end }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| {{- if .Values.django.autoscaling.enabled -}} | ||
| {{- $fullName := include "defectdojo.fullname" . -}} | ||
| apiVersion: autoscaling/v2 | ||
| kind: HorizontalPodAutoscaler | ||
| metadata: | ||
| {{- with mergeOverwrite dict .Values.extraAnnotations .Values.django.annotations }} | ||
| annotations: | ||
| {{- range $key, $value := . }} | ||
| {{ $key }}: {{ quote $value }} | ||
| {{- end }} | ||
| {{- end }} | ||
| name: {{ $fullName }}-django | ||
| namespace: {{ .Release.Namespace }} | ||
| labels: | ||
| defectdojo.org/component: django | ||
| app.kubernetes.io/name: {{ include "defectdojo.name" . }} | ||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||
| app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
| helm.sh/chart: {{ include "defectdojo.chart" . }} | ||
| {{- range $key, $value := .Values.extraLabels }} | ||
| {{ $key }}: {{ quote $value }} | ||
| {{- end }} | ||
| spec: | ||
| scaleTargetRef: | ||
| apiVersion: apps/v1 | ||
| kind: "Deployment" | ||
| name: {{ $fullName }}-django | ||
| minReplicas: {{ .Values.django.autoscaling.minReplicas }} | ||
| maxReplicas: {{ .Values.django.autoscaling.maxReplicas }} | ||
| metrics: | ||
| {{- with .Values.django.autoscaling.targetCPUUtilizationPercentage }} | ||
| - type: Resource | ||
| resource: | ||
| name: cpu | ||
| target: | ||
| averageUtilization: {{ . }} | ||
| type: Utilization | ||
| {{- end }} | ||
| {{- with .Values.django.autoscaling.targetMemoryUtilizationPercentage }} | ||
| - type: Resource | ||
| resource: | ||
| name: memory | ||
| target: | ||
| averageUtilization: {{ . }} | ||
| type: Utilization | ||
| {{- end }} | ||
| {{- if .Values.django.autoscaling.autoscaleBehavior }} | ||
carlosmt86 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| behavior: {{ toYaml .Values.django.autoscaling.autoscaleBehavior | nindent 4 }} | ||
carlosmt86 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| {{- end }} | ||
| {{- end }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| {{- if and .Values.django.podDisruptionBudget.enabled (or (gt (int .Values.django.replicas) 1) .Values.django.autoscaling.enabled) }} | ||
| {{- $fullName := include "defectdojo.fullname" . -}} | ||
| apiVersion: policy/v1 | ||
| kind: PodDisruptionBudget | ||
| metadata: | ||
| {{- with mergeOverwrite dict .Values.extraAnnotations .Values.django.annotations }} | ||
| annotations: | ||
| {{- range $key, $value := . }} | ||
| {{ $key }}: {{ quote $value }} | ||
| {{- end }} | ||
| {{- end }} | ||
| labels: | ||
| defectdojo.org/component: django | ||
| app.kubernetes.io/name: {{ include "defectdojo.name" . }} | ||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||
| app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
| helm.sh/chart: {{ include "defectdojo.chart" . }} | ||
| {{- range $key, $value := .Values.extraLabels }} | ||
| {{ $key }}: {{ quote $value }} | ||
| {{- end }} | ||
| name: {{ $fullName }}-django | ||
| namespace: {{ .Release.Namespace }} | ||
| spec: | ||
| selector: | ||
| matchLabels: | ||
| app.kubernetes.io/name: {{ include "defectdojo.name" . }} | ||
| defectdojo.org/component: django | ||
| {{ toYaml (omit .Values.django.podDisruptionBudget "enabled" ) | indent 2 }} | ||
| {{- end }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.