diff --git a/stable/anchore-engine/Chart.yaml b/stable/anchore-engine/Chart.yaml index 9d774b9f..cc160969 100644 --- a/stable/anchore-engine/Chart.yaml +++ b/stable/anchore-engine/Chart.yaml @@ -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: diff --git a/stable/anchore-engine/templates/api_deployment.yaml b/stable/anchore-engine/templates/api_deployment.yaml index 197a9da5..f245ca97 100644 --- a/stable/anchore-engine/templates/api_deployment.yaml +++ b/stable/anchore-engine/templates/api_deployment.yaml @@ -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 diff --git a/stable/anchore-engine/templates/catalog_deployment.yaml b/stable/anchore-engine/templates/catalog_deployment.yaml index f957ca7d..01fc84fc 100644 --- a/stable/anchore-engine/templates/catalog_deployment.yaml +++ b/stable/anchore-engine/templates/catalog_deployment.yaml @@ -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 diff --git a/stable/anchore-engine/templates/policy_engine_deployment.yaml b/stable/anchore-engine/templates/policy_engine_deployment.yaml index eed5c6d2..26fcb234 100644 --- a/stable/anchore-engine/templates/policy_engine_deployment.yaml +++ b/stable/anchore-engine/templates/policy_engine_deployment.yaml @@ -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 diff --git a/stable/anchore-engine/templates/simplequeue_deployment.yaml b/stable/anchore-engine/templates/simplequeue_deployment.yaml index c684c595..a4238bd1 100644 --- a/stable/anchore-engine/templates/simplequeue_deployment.yaml +++ b/stable/anchore-engine/templates/simplequeue_deployment.yaml @@ -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 diff --git a/stable/anchore-engine/values.yaml b/stable/anchore-engine/values.yaml index ab083ec4..8ac68347 100644 --- a/stable/anchore-engine/values.yaml +++ b/stable/anchore-engine/values.yaml @@ -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 @@ -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 @@ -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 @@ -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