Skip to content

Commit

Permalink
http-add-on: ability to specify number of operator replicas (#661)
Browse files Browse the repository at this point in the history
Signed-off-by: Zbynek Roubalik <[email protected]>
  • Loading branch information
zroubalik authored Jul 10, 2024
1 parent 1286024 commit fcc7b2f
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions http-add-on/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ their default values.
| `operator.nodeSelector` | object | `{}` | Node selector for pod scheduling ([docs](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/)) |
| `operator.port` | int | `8443` | The port for the operator main server to run on |
| `operator.pullPolicy` | string | `"Always"` | The image pull policy for the operator component |
| `operator.replicas` | int | `1` | Number of replicas, oerator k8s resources will not be installed if this is set to 0 |
| `operator.resources.limits` | object | `{"cpu":0.5,"memory":"64Mi"}` | The CPU/memory resource limit for the operator component |
| `operator.resources.requests` | object | `{"cpu":"250m","memory":"20Mi"}` | The CPU/memory resource request for the operator component |
| `operator.tolerations` | list | `[]` | Tolerations for pod scheduling ([docs](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/)) |
Expand Down
4 changes: 3 additions & 1 deletion http-add-on/templates/operator/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if gt (int .Values.operator.replicas) 0 }}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand All @@ -7,7 +8,7 @@ metadata:
name: {{ .Chart.Name }}-controller-manager
namespace: {{ .Release.Namespace }}
spec:
replicas: 1
replicas: {{ .Values.operator.replicas }}
selector:
matchLabels:
app.kubernetes.io/component: operator
Expand Down Expand Up @@ -99,3 +100,4 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions http-add-on/templates/operator/rbac.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if gt (int .Values.operator.replicas) 0 }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
Expand Down Expand Up @@ -175,3 +176,4 @@ subjects:
- kind: ServiceAccount
name: {{ .Chart.Name }}
namespace: {{ .Release.Namespace }}
{{- end }}
2 changes: 2 additions & 0 deletions http-add-on/templates/operator/service.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if gt (int .Values.operator.replicas) 0 }}
apiVersion: v1
kind: Service
metadata:
Expand All @@ -14,3 +15,4 @@ spec:
selector:
app.kubernetes.io/component: operator
{{- include "keda-http-add-on.matchLabels" . | indent 4 }}
{{- end }}
2 changes: 2 additions & 0 deletions http-add-on/templates/operator/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if gt (int .Values.operator.replicas) 0 }}
apiVersion: v1
kind: ServiceAccount
metadata:
Expand All @@ -6,3 +7,4 @@ metadata:
{{- include "keda-http-add-on.labels" . | indent 4 }}
name: {{ .Chart.Name }}
namespace: {{ .Release.Namespace }}
{{- end }}
2 changes: 2 additions & 0 deletions http-add-on/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ logging:

# operator-specific configuration values
operator:
# -- Number of replicas, oerator k8s resources will not be installed if this is set to 0
replicas: 1
# -- The image pull secrets for the operator component
imagePullSecrets: []
# -- The namespace to watch for new `HTTPScaledObject`s. Leave this blank (i.e. `""`) to tell the operator to watch all namespaces.
Expand Down

0 comments on commit fcc7b2f

Please sign in to comment.