Skip to content
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

Add horizontalPodAutoscaler definitions for all deployments #153

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stable/anchore-engine/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: anchore-engine
version: 1.20.2
version: 1.20.3
appVersion: 1.1.0
description: Anchore container analysis and policy evaluation engine service
keywords:
Expand Down
25 changes: 25 additions & 0 deletions stable/anchore-engine/templates/api_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,31 @@ spec:
serviceAccountName: {{ . }}
{{- end }}

{{- if .Values.anchoreApi.autoscaling.enabled }}
---
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: {{ template "anchore-engine.api.fullname" . }}
labels:
app: {{ template "anchore-engine.fullname" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
component: {{ $component }}
{{- with .Values.anchoreGlobal.labels }}
{{ toYaml . | nindent 4 }}
{{- end }}
spec:
maxReplicas: {{ .Values.anchoreApi.autoscaling.maxReplicas }}
minReplicas: {{ .Values.anchoreApi.autoscaling.minReplicas }}
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ template "anchore-engine.api.fullname" . }}
targetCPUUtilizationPercentage: {{ .Values.anchoreApi.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}

---
apiVersion: v1
kind: Service
Expand Down
25 changes: 25 additions & 0 deletions stable/anchore-engine/templates/catalog_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,31 @@ spec:
serviceAccountName: ""
{{- end }}

{{- if .Values.anchoreCatalog.autoscaling.enabled }}
---
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: {{ template "anchore-engine.catalog.fullname" . }}
labels:
app: {{ template "anchore-engine.fullname" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
component: {{ $component }}
{{- with .Values.anchoreGlobal.labels }}
{{ toYaml . | nindent 4 }}
{{- end }}
spec:
maxReplicas: {{ .Values.anchoreCatalog.autoscaling.maxReplicas }}
minReplicas: {{ .Values.anchoreCatalog.autoscaling.minReplicas }}
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ template "anchore-engine.catalog.fullname" . }}
targetCPUUtilizationPercentage: {{ .Values.anchoreCatalog.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}

---
apiVersion: v1
kind: Service
Expand Down
25 changes: 25 additions & 0 deletions stable/anchore-engine/templates/policy_engine_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,31 @@ spec:
serviceAccountName: {{ . }}
{{- end }}

{{- if .Values.anchorePolicyEngine.autoscaling.enabled }}
---
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: {{ template "anchore-engine.policy-engine.fullname" . }}
labels:
app: {{ template "anchore-engine.fullname" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
component: {{ $component }}
{{- with .Values.anchoreGlobal.labels }}
{{ toYaml . | nindent 4 }}
{{- end }}
spec:
maxReplicas: {{ .Values.anchorePolicyEngine.autoscaling.maxReplicas }}
minReplicas: {{ .Values.anchorePolicyEngine.autoscaling.minReplicas }}
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ template "anchore-engine.policy-engine.fullname" . }}
targetCPUUtilizationPercentage: {{ .Values.anchorePolicyEngine.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}

---
apiVersion: v1
kind: Service
Expand Down
25 changes: 25 additions & 0 deletions stable/anchore-engine/templates/simplequeue_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,31 @@ spec:
serviceAccountName: {{ . }}
{{- end }}

{{- if .Values.anchoreSimpleQueue.autoscaling.enabled }}
---
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: {{ template "anchore-engine.simplequeue.fullname" . }}
labels:
app: {{ template "anchore-engine.fullname" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
component: {{ $component }}
{{- with .Values.anchoreGlobal.labels }}
{{ toYaml . | nindent 4 }}
{{- end }}
spec:
maxReplicas: {{ .Values.anchoreSimpleQueue.autoscaling.maxReplicas }}
minReplicas: {{ .Values.anchoreSimpleQueue.autoscaling.minReplicas }}
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ template "anchore-engine.simplequeue.fullname" . }}
targetCPUUtilizationPercentage: {{ .Values.anchoreSimpleQueue.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}

---
apiVersion: v1
kind: Service
Expand Down
24 changes: 24 additions & 0 deletions stable/anchore-engine/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,12 @@ anchoreApi:
# cpu: 100m
# memory: 1G

autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 3
targetCPUUtilizationPercentage: 80

labels: {}
annotations: {}
# Add metadata annotations to api deployments
Expand Down Expand Up @@ -609,6 +615,12 @@ anchoreCatalog:
# cpu: 100m
# memory: 500M

autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 3
targetCPUUtilizationPercentage: 80

labels: {}
annotations: {}
# Add metadata annotations to catalog deployments
Expand Down Expand Up @@ -657,6 +669,12 @@ anchorePolicyEngine:
# cpu: 100m
# memory: 1G

autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 3
targetCPUUtilizationPercentage: 80

labels: {}
annotations: {}
# Add metadata annotations to policy engine deployments
Expand Down Expand Up @@ -694,6 +712,12 @@ anchoreSimpleQueue:
# cpu: 100m
# memory: 256M

autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 3
targetCPUUtilizationPercentage: 80

labels: {}
annotations: {}
# Add metadata annotations to simplequeue deployments
Expand Down