Skip to content
Open
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 charts/apisix-ingress-controller/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ keywords:
- nginx
- crd
type: application
version: 1.5.0
version: 1.5.1
appVersion: 2.2.0
sources:
- https://github.com/apache/apisix-helm-chart
Expand Down
7 changes: 5 additions & 2 deletions charts/apisix-ingress-controller/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,11 @@ The same for container level, you need to set:
| apisix.adminService.name | string | `"apisix-admin"` | |
| apisix.adminService.namespace | string | `"apisix-ingress"` | |
| apisix.adminService.port | int | `9180` | |
| autoscaling.enabled | bool | `false` | |
| autoscaling.minReplicas | int | `1` | |
| autoscaling.enabled | bool | `false` | Create a HorizontalPodAutoscaler for the controller. When true, the chart stops setting `deployment.replicas`. Utilization targets need `deployment.resources.requests` to be set. Only the leader reconciles, so extra replicas add failover, not throughput |
| autoscaling.maxReplicas | int | `3` | Maximum number of controller replicas |
| autoscaling.minReplicas | int | `1` | Minimum number of controller replicas |
| autoscaling.targetCPUUtilizationPercentage | int | `80` | Target average CPU utilization percentage. 0 turns this metric off |
| autoscaling.targetMemoryUtilizationPercentage | int | `0` | Target average memory utilization percentage. 0 turns this metric off |
| config.controllerName | string | `"apisix.apache.org/apisix-ingress-controller"` | |
| config.disableGatewayAPI | bool | `false` | |
| config.enableHTTP2 | bool | `false` | |
Expand Down
2 changes: 2 additions & 0 deletions charts/apisix-ingress-controller/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ metadata:
labels:
{{- include "apisix-ingress-controller-manager.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.deployment.replicas }}
{{- end }}
selector:
matchLabels:
{{- include "apisix-ingress-controller-manager.selectorLabels" . | nindent 6 }}
Expand Down
49 changes: 49 additions & 0 deletions charts/apisix-ingress-controller/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "apisix-ingress-controller-manager.name.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "apisix-ingress-controller-manager.labels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "apisix-ingress-controller-manager.name.fullname" . }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
8 changes: 8 additions & 0 deletions charts/apisix-ingress-controller/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,16 @@ podDisruptionBudget:
maxUnavailable: 1

autoscaling:
# -- Create a HorizontalPodAutoscaler for the controller. When true, the chart stops setting `deployment.replicas`. Utilization targets need `deployment.resources.requests` to be set. Only the leader reconciles, so extra replicas add failover, not throughput
enabled: false
# -- Minimum number of controller replicas
minReplicas: 1
# -- Maximum number of controller replicas
maxReplicas: 3
# -- Target average CPU utilization percentage. 0 turns this metric off
targetCPUUtilizationPercentage: 80
# -- Target average memory utilization percentage. 0 turns this metric off
targetMemoryUtilizationPercentage: 0

deployment:
# -- Add annotations to Apache APISIX ingress controller resource
Expand Down