Skip to content

Commit

Permalink
chore(add-on): Apply HTTP Add-on changes on Helm chart (#598)
Browse files Browse the repository at this point in the history
  • Loading branch information
JorTurFer authored Jan 22, 2024
1 parent f561a3b commit 20e9ce7
Show file tree
Hide file tree
Showing 13 changed files with 76 additions and 65 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
fail-fast: false
matrix:
enableAzureWorkloadIdentity: [false, true]
kubernetesVersion: [v1.28, v1.27, v1.26, v1.23]
kubernetesVersion: [v1.29, v1.28, v1.27, v1.23]
namespace: ["keda", "not-keda"]
enableCertManager: [false, true]
include:
Expand All @@ -55,12 +55,12 @@ jobs:
clientId: ""
# Images are defined on every Kind release
# See https://github.com/kubernetes-sigs/kind/releases
- kubernetesVersion: v1.29
kindImage: kindest/node:v1.29.0@sha256:eaa1450915475849a73a9227b8f201df25e55e268e5d619312131292e324d570
- kubernetesVersion: v1.28
kindImage: kindest/node:v1.28.0@sha256:b7a4cad12c197af3ba43202d3efe03246b3f0793f162afb40a33c923952d5b31
- kubernetesVersion: v1.27
kindImage: kindest/node:v1.27.3@sha256:3966ac761ae0136263ffdb6cfd4db23ef8a83cba8a463690e98317add2c9ba72
- kubernetesVersion: v1.26
kindImage: kindest/node:v1.26.6@sha256:6e2d8b28a5b601defe327b98bd1c2d1930b49e5d8c512e1895099e4504007adb
- kubernetesVersion: v1.23
kindImage: kindest/node:v1.23.17@sha256:59c989ff8a517a93127d4a536e7014d28e235fb3529d9fba91b3951d461edfdb
steps:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci-http-add-on.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ jobs:
strategy:
fail-fast: false
matrix:
kubernetesVersion: [v1.28, v1.27, v1.26, v1.25]
kubernetesVersion: [v1.29, v1.28, v1.27, v1.26]
include:
- kubernetesVersion: v1.29
kindImage: kindest/node:v1.29.0@sha256:eaa1450915475849a73a9227b8f201df25e55e268e5d619312131292e324d570
- kubernetesVersion: v1.28
kindImage: kindest/node:v1.28.0@sha256:b7a4cad12c197af3ba43202d3efe03246b3f0793f162afb40a33c923952d5b31
- kubernetesVersion: v1.27
kindImage: kindest/node:v1.27.3@sha256:3966ac761ae0136263ffdb6cfd4db23ef8a83cba8a463690e98317add2c9ba72
- kubernetesVersion: v1.26
kindImage: kindest/node:v1.26.6@sha256:6e2d8b28a5b601defe327b98bd1c2d1930b49e5d8c512e1895099e4504007adb
- kubernetesVersion: v1.25
kindImage: kindest/node:v1.25.11@sha256:227fa11ce74ea76a0474eeefb84cb75d8dad1b08638371ecf0e86259b35be0c8
steps:
- name: Check out code
uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions http-add-on/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ their default values.
|-----------|------|---------|-------------|
| `scaler.affinity` | object | `{}` | Affinity for pod scheduling ([docs](https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/)) |
| `scaler.grpcPort` | int | `9090` | The port for the scaler's gRPC server. This is the server that KEDA will send scaling requests to. |
| `scaler.healthPort` | int | `9091` | The port for the scaler's health check and admin server |
| `scaler.imagePullSecrets` | list | `[]` | The image pull secrets for the scaler component |
| `scaler.nodeSelector` | object | `{}` | Node selector for pod scheduling ([docs](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/)) |
| `scaler.pendingRequestsInterceptor` | int | `200` | The number of "target requests" that the external scaler will report to KEDA for the interceptor's scaling metrics. See the [KEDA external scaler documentation](https://keda.sh/docs/2.4/concepts/external-scalers/) for details on target requests. |
| `scaler.pullPolicy` | string | `"Always"` | The image pull policy for the scaler component |
| `scaler.replicas` | int | `3` | Number of replicas |
| `scaler.resources.limits.cpu` | float | `0.5` | |
| `scaler.resources.limits.memory` | string | `"64Mi"` | |
| `scaler.resources.requests.cpu` | string | `"250m"` | |
Expand All @@ -148,7 +148,7 @@ their default values.
| `interceptor.admin.port` | int | `9090` | The port for the interceptor's admin server to run on |
| `interceptor.admin.service` | string | `"interceptor-admin"` | The name of the Kubernetes `Service` for the interceptor's admin service |
| `interceptor.affinity` | object | `{}` | Affinity for pod scheduling ([docs](https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/)) |
| `interceptor.deploymentCachePollingIntervalMS` | int | `250` | How often (in milliseconds) the interceptor does a full refresh of its deployment cache. The interceptor will also use Kubernetes events to stay up-to-date with the deployment cache changes. This duration is the maximum time it will take to see changes to the deployment state. |
| `interceptor.endpointsCachePollingIntervalMS` | int | `250` | How often (in milliseconds) the interceptor does a full refresh of its endpoints cache. The interceptor will also use Kubernetes events to stay up-to-date with the endpoints cache changes. This duration is the maximum time it will take to see changes to the endpoints. |
| `interceptor.expectContinueTimeout` | string | `"1s"` | Special handling for responses with "Expect: 100-continue" response headers. see https://pkg.go.dev/net/http#Transport under the 'ExpectContinueTimeout' field for more details |
| `interceptor.forceHTTP2` | bool | `false` | Whether or not the interceptor should force requests to use HTTP/2 |
| `interceptor.idleConnTimeout` | string | `"90s"` | The timeout after which any idle connection is closed and removed from the interceptor's in-memory connection pool. |
Expand Down
45 changes: 23 additions & 22 deletions http-add-on/templates/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,12 @@ spec:
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .spec.scaleTargetRef.deploymentName
name: ScaleTargetDeploymentName
- jsonPath: .status.targetWorkload
name: TargetWorkload
type: string
- jsonPath: .spec.scaleTargetRef
name: ScaleTargetServiceName
- jsonPath: .status.targetService
name: TargetService
type: string
- jsonPath: .spec.scaleTargetRef
name: ScaleTargetPort
type: integer
- jsonPath: .spec.replicas.min
name: MinReplicas
type: integer
Expand Down Expand Up @@ -58,19 +55,12 @@ spec:
spec:
description: HTTPScaledObjectSpec defines the desired state of HTTPScaledObject
properties:
host:
description: (optional) (deprecated) The host to route. All requests
which the "Host" header matches .spec.host and the Request Target
matches any .spec.pathPrefixes will be routed to the Service and
Port specified in the scaleTargetRef. The .spec.host field is mutually
exclusive with the .spec.hosts field.
type: string
hosts:
description: (optional) The hosts to route. All requests which the
"Host" header matches any .spec.hosts and the Request Target matches
any .spec.pathPrefixes will be routed to the Service and Port specified
in the scaleTargetRef. The .spec.hosts field is mutually exclusive
with the .spec.host field.
description: The hosts to route. All requests which the "Host" header
matches any .spec.hosts and the Request Target matches any .spec.pathPrefixes
will be routed to the Service and Port specified in the scaleTargetRef.
The .spec.hosts field is mutually exclusive with the .spec.host
field.
items:
type: string
type: array
Expand Down Expand Up @@ -102,9 +92,15 @@ spec:
description: The name of the deployment to route HTTP requests to
(and to autoscale).
properties:
apiVersion:
type: string
deployment:
description: The name of the deployment to scale according to
HTTP traffic
description: 'Deprecated: The name of the deployment to scale
according to HTTP traffic'
type: string
kind:
type: string
name:
type: string
port:
description: The port to route to
Expand All @@ -114,7 +110,6 @@ spec:
description: The name of the service to route to
type: string
required:
- deployment
- port
- service
type: object
Expand Down Expand Up @@ -173,6 +168,12 @@ spec:
- type
type: object
type: array
targetService:
description: TargetService reflects details about the scaled service.
type: string
targetWorkload:
description: TargetWorkload reflects details about the scaled workload.
type: string
type: object
type: object
served: true
Expand Down
17 changes: 12 additions & 5 deletions http-add-on/templates/interceptor/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ metadata:
name: {{ .Chart.Name }}-interceptor
namespace: {{ .Release.Namespace }}
spec:
replicas: {{ .Values.interceptor.replicas.min }}
selector:
matchLabels:
app.kubernetes.io/component: interceptor
Expand Down Expand Up @@ -51,8 +50,8 @@ spec:
value: "{{ .Values.interceptor.responseHeaderTimeout }}"
- name: KEDA_CONDITION_WAIT_TIMEOUT
value: "{{ .Values.interceptor.replicas.waitTimeout }}"
- name: KEDA_HTTP_DEPLOYMENT_CACHE_POLLING_INTERVAL_MS
value: "{{ .Values.interceptor.deploymentCachePollingIntervalMS }}"
- name: KEDA_HTTP_ENDPOINTS_CACHE_POLLING_INTERVAL_MS
value: "{{ .Values.interceptor.endpointsCachePollingIntervalMS }}"
- name: KEDA_HTTP_FORCE_HTTP2
value: "{{ .Values.interceptor.forceHTTP2 }}"
- name: KEDA_HTTP_MAX_IDLE_CONNS
Expand All @@ -65,9 +64,17 @@ spec:
value: "{{ .Values.interceptor.expectContinueTimeout }}"
ports:
- containerPort: {{ .Values.interceptor.admin.port }}
name: inter-admin
name: admin
- containerPort: {{ .Values.interceptor.proxy.port }}
name: inter-proxy
name: proxy
livenessProbe:
httpGet:
path: /livez
port: proxy
readinessProbe:
httpGet:
path: /readyz
port: proxy
resources:
{{- toYaml .Values.interceptor.resources | nindent 10 }}
{{- if .Values.securityContext.interceptor }}
Expand Down
4 changes: 2 additions & 2 deletions http-add-on/templates/interceptor/rbac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ metadata:
name: {{ .Chart.Name }}-interceptor
rules:
- apiGroups:
- apps
- ""
resources:
- deployments
- endpoints
verbs:
- get
- list
Expand Down
5 changes: 3 additions & 2 deletions http-add-on/templates/interceptor/service-admin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ metadata:
namespace: {{ .Release.Namespace }}
spec:
ports:
- name: https
- name: admin
port: {{ default 9091 .Values.interceptor.admin.port }}
targetPort: inter-admin
targetPort: admin
selector:
app.kubernetes.io/component: interceptor
{{- include "keda-http-add-on.labels" . | indent 4 }}
5 changes: 3 additions & 2 deletions http-add-on/templates/interceptor/service-proxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ metadata:
namespace: {{ .Release.Namespace }}
spec:
ports:
- name: http
- name: proxy
port: {{ default 9091 .Values.interceptor.proxy.port }}
targetPort: inter-proxy
targetPort: proxy
selector:
app.kubernetes.io/component: interceptor
{{- include "keda-http-add-on.labels" . | indent 4 }}
4 changes: 2 additions & 2 deletions http-add-on/templates/operator/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ metadata:
namespace: {{ .Release.Namespace }}
spec:
ports:
- name: https
- name: metrics
port: {{ default 8443 .Values.operator.port }}
targetPort: https
targetPort: metrics
selector:
app.kubernetes.io/component: operator
{{- include "keda-http-add-on.labels" . | indent 4 }}
24 changes: 18 additions & 6 deletions http-add-on/templates/scaler/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
name: {{ .Chart.Name }}-external-scaler
namespace: {{ .Release.Namespace }}
spec:
replicas: 1
replicas: {{ .Values.scaler.replicas }}
selector:
matchLabels:
app.kubernetes.io/component: scaler
Expand Down Expand Up @@ -37,17 +37,13 @@ spec:
imagePullPolicy: {{ .Values.scaler.pullPolicy | default "Always" }}
name: "{{ .Chart.Name }}-external-scaler"
ports:
- containerPort: {{ .Values.scaler.healthPort }}
name: scaler-health
- containerPort: {{ .Values.scaler.grpcPort }}
name: scaler-grpc
name: grpc
env:
- name: KEDA_HTTP_SCALER_TARGET_ADMIN_DEPLOYMENT
value: "{{ .Chart.Name }}-interceptor"
- name: KEDA_HTTP_SCALER_PORT
value: "{{ .Values.scaler.grpcPort }}"
- name: KEDA_HTTP_HEALTH_PORT
value: "{{ .Values.scaler.healthPort }}"
- name: KEDA_HTTP_SCALER_TARGET_ADMIN_NAMESPACE
value: "{{ .Release.Namespace }}"
- name: KEDA_HTTP_SCALER_TARGET_ADMIN_SERVICE
Expand All @@ -58,6 +54,22 @@ spec:
value: "{{ .Values.scaler.streamInterval }}"
resources:
{{- toYaml .Values.scaler.resources | nindent 10 }}
livenessProbe:
grpc:
port: {{ .Values.scaler.grpcPort }}
service: liveness
timeoutSeconds: 5
periodSeconds: 5
successThreshold: 1
failureThreshold: 6
readinessProbe:
grpc:
port: {{ .Values.scaler.grpcPort }}
service: readiness
timeoutSeconds: 1
periodSeconds: 5
successThreshold: 1
failureThreshold: 3
{{- if .Values.securityContext.scaler }}
securityContext:
{{- toYaml .Values.securityContext.scaler | nindent 10 }}
Expand Down
8 changes: 0 additions & 8 deletions http-add-on/templates/scaler/rbac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@ rules:
- get
- list
- watch
- apiGroups:
- apps
resources:
- deployments
verbs:
- get
- list
- watch
- apiGroups:
- http.keda.sh
resources:
Expand Down
5 changes: 1 addition & 4 deletions http-add-on/templates/scaler/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ spec:
ports:
- name: grpc
port: {{ default 9090 .Values.scaler.grpcPort }}
targetPort: scaler-grpc
- name: health
port: {{ default 9091 .Values.scaler.healthPort }}
targetPort: scaler-health
targetPort: grpc
selector:
app.kubernetes.io/component: scaler
{{- include "keda-http-add-on.labels" . | indent 4 }}
8 changes: 4 additions & 4 deletions http-add-on/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ operator:
memory: 20Mi

scaler:
# -- Number of replicas
replicas: 3
# -- The image pull secrets for the scaler component
imagePullSecrets: []
# -- The name of the Kubernetes `Service` for the scaler component
Expand All @@ -89,8 +91,6 @@ scaler:
pullPolicy: Always
# -- The port for the scaler's gRPC server. This is the server that KEDA will send scaling requests to.
grpcPort: 9090
# -- The port for the scaler's health check and admin server
healthPort: 9091
# -- The number of "target requests" that the external scaler will report to KEDA for the interceptor's scaling metrics. See the [KEDA external scaler documentation](https://keda.sh/docs/2.4/concepts/external-scalers/) for details on target requests.
pendingRequestsInterceptor: 200
# -- Interval in ms for communicating IsActive to KEDA
Expand Down Expand Up @@ -150,8 +150,8 @@ interceptor:
keepAlive: 1s
# -- How long the interceptor will wait between forwarding a request to a backend and receiving response headers back before failing the request
responseHeaderTimeout: 500ms
# -- How often (in milliseconds) the interceptor does a full refresh of its deployment cache. The interceptor will also use Kubernetes events to stay up-to-date with the deployment cache changes. This duration is the maximum time it will take to see changes to the deployment state.
deploymentCachePollingIntervalMS: 250
# -- How often (in milliseconds) the interceptor does a full refresh of its endpoints cache. The interceptor will also use Kubernetes events to stay up-to-date with the endpoints cache changes. This duration is the maximum time it will take to see changes to the endpoints.
endpointsCachePollingIntervalMS: 250
# -- Whether or not the interceptor should force requests to use HTTP/2
forceHTTP2: false
# -- The maximum number of idle connections allowed in the interceptor's in-memory connection pool. Set to 0 to indicate no limit
Expand Down

0 comments on commit 20e9ce7

Please sign in to comment.