Skip to content

Commit

Permalink
http-add-on: Add nodeSelector, tolerations and affinity
Browse files Browse the repository at this point in the history
Signed-off-by: Morgan Christiansson <git@mog.se>
  • Loading branch information
morganchristiansson committed Dec 7, 2021
1 parent 1e61c5a commit c3d1d11
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 0 deletions.
9 changes: 9 additions & 0 deletions http-add-on/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,17 @@ their default values.
| `operator.port` | The port for the operator main server to run on | `8443` |
| `operator.adminService` | The name of the [`Service`](https://kubernetes.io/docs/concepts/services-networking/service/) for the operator's admin server | `operator-admin` |
| `operator.adminPort` | The port for the operator's admin server to run on | `9090` |
| `operator.nodeSelector` | Node selector for pod scheduling ([docs](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/)) | `{}` |
| `operator.tolerations` | Tolerations for pod scheduling ([docs](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/)) | `{}` |
| `operator.affinity` | Affinity for pod scheduling ([docs](https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/)) | `{}` |
| `scaler.service` | The name of the Kubernetes `Service` for the scaler component | `external-scaler` |
| `scaler.pullPolicy` | The image pull policy for the scaler component | `Always` |
| `scaler.grpcPort` | The port for the scaler's gRPC server. This is the server that KEDA will send scaling requests to. | `9090` |
| `scaler.healthPort` | The port for the scaler's health check and admin server | `9091` |
| `scaler.pendingRequestsInterceptor` | 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. | `200` |
| `scaler.nodeSelector` | Node selector for pod scheduling ([docs](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/)) | `{}` |
| `scaler.tolerations` | Tolerations for pod scheduling ([docs](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/)) | `{}` |
| `scaler.affinity` | Affinity for pod scheduling ([docs](https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/)) | `{}` |
| `interceptor.pullPolicy` | The image pull policy for the interceptor component | `Always` |
| `interceptor.admin.service` | The name of the Kubernetes `Service` for the interceptor's admin service | `interceptor-admin` |
| `interceptor.admin.port` | The port for the interceptor's admin server to run on | `9090` |
Expand All @@ -120,6 +126,9 @@ their default values.
| `interceptor.idleConnTimeout` | The timeout after which any idle connection is closed and removed from the interceptor's in-memory connection pool. | `90s` |
| `interceptor.tlsHandshakeTimeout` | The maximum amount of time the interceptor will wait for a TLS handshake. Set to zero to indicate no timeout. | `10s` |
| `interceptor.expectContinueTimeout` | 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 | `1s` |
| `interceptor.nodeSelector` | Node selector for pod scheduling ([docs](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/)) | `{}` |
| `interceptor.tolerations` | Tolerations for pod scheduling ([docs](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/)) | `{}` |
| `interceptor.affinity` | Affinity for pod scheduling ([docs](https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/)) | `{}` |

Specify each parameter using the `--set key=value[,key=value]` argument to
`helm install`. For example:
Expand Down
12 changes: 12 additions & 0 deletions http-add-on/templates/deployment-interceptor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,15 @@ spec:
resources:
{{- toYaml .Values.resources | nindent 12 }}
terminationGracePeriodSeconds: 10
{{- with .Values.interceptor.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.interceptor.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.interceptor.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
12 changes: 12 additions & 0 deletions http-add-on/templates/deployment-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,15 @@ spec:
resources:
{{- toYaml .Values.resources | nindent 12 }}
terminationGracePeriodSeconds: 10
{{- with .Values.operator.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.operator.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.operator.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
12 changes: 12 additions & 0 deletions http-add-on/templates/deployment-scaler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,15 @@ spec:
resources:
{{- toYaml .Values.resources | nindent 12 }}
terminationGracePeriodSeconds: 10
{{- with .Values.scaler.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.scaler.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.scaler.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
10 changes: 10 additions & 0 deletions http-add-on/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,19 @@ operator:
port: 8443
adminService: operator-admin
adminPort: 9090
nodeSelector: {}
tolerations: []
affinity: {}

scaler:
service: external-scaler
pullPolicy: Always
grpcPort: 9090
healthPort: 9091
pendingRequestsInterceptor: 200
nodeSelector: {}
tolerations: []
affinity: {}

interceptor:
# the image pull policy of the interceptor
Expand Down Expand Up @@ -103,6 +109,10 @@ interceptor:
# under the 'ExpectContinueTimeout' field for more details
expectContinueTimeout: 1s

nodeSelector: {}
tolerations: []
affinity: {}

# configuration for the images to use for each component
images:
# tag is the image tag to use for all images.
Expand Down

0 comments on commit c3d1d11

Please sign in to comment.