feat: Add keda scalers.
This commit is contained in:
24
kubernetes/components/keda/nfs-cpu-scaler/kustomization.yaml
Normal file
24
kubernetes/components/keda/nfs-cpu-scaler/kustomization.yaml
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
|
||||
apiVersion: kustomize.config.k8s.io/v1alpha1
|
||||
kind: Component
|
||||
components:
|
||||
- ../nfs-scaler
|
||||
patches:
|
||||
- patch: |-
|
||||
- op: add
|
||||
path: /spec/triggers/-
|
||||
value:
|
||||
type: cpu
|
||||
metricType: Utilization
|
||||
metadata:
|
||||
value: '${SCALER_CPU_TARGET:="60"}'
|
||||
target: &target
|
||||
group: keda.sh
|
||||
kind: ScaledObject
|
||||
- patch: |-
|
||||
# undo the nfs-scaler patch
|
||||
- op: replace
|
||||
path: /metadata/name
|
||||
value: ${SCALER_SILENT}${APP}
|
||||
target: *target
|
||||
19
kubernetes/components/keda/nfs-scaler/kustomization.yaml
Normal file
19
kubernetes/components/keda/nfs-scaler/kustomization.yaml
Normal file
@@ -0,0 +1,19 @@
|
||||
---
|
||||
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
|
||||
apiVersion: kustomize.config.k8s.io/v1alpha1
|
||||
kind: Component
|
||||
components:
|
||||
- ../prometheus-scaler
|
||||
patches:
|
||||
- patch: |-
|
||||
- op: replace
|
||||
path: /spec/triggers/0/metadata/query
|
||||
value: max_over_time(probe_success{instance="10.0.0.14:2049"}[1m])
|
||||
target: &target
|
||||
group: keda.sh
|
||||
kind: ScaledObject
|
||||
- patch: |-
|
||||
- op: replace
|
||||
path: /metadata/name
|
||||
value: silent-${APP}
|
||||
target: *target
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
|
||||
apiVersion: kustomize.config.k8s.io/v1alpha1
|
||||
kind: Component
|
||||
resources:
|
||||
- ./scaledobject.yaml
|
||||
@@ -0,0 +1,23 @@
|
||||
---
|
||||
# yaml-language-server: $schema=https://schemas.tholinka.dev/keda.sh/scaledobject_v1alpha1.json
|
||||
apiVersion: keda.sh/v1alpha1
|
||||
kind: ScaledObject
|
||||
metadata:
|
||||
name: ${SCALER_SILENT}${APP}
|
||||
spec:
|
||||
advanced:
|
||||
restoreToOriginalReplicaCount: true
|
||||
scaleTargetRef:
|
||||
apiVersion: ${SCALER_API_VERSION:=apps/v1}
|
||||
kind: ${SCALER_TYPE:=Deployment}
|
||||
name: ${SCALER_NAME:=${APP}}
|
||||
cooldownPeriod: 0
|
||||
minReplicaCount: ${SCALER_MIN_REPLICAS:=0}
|
||||
maxReplicaCount: ${SCALER_MAX_REPLICAS:=1}
|
||||
triggers:
|
||||
- type: prometheus
|
||||
metadata:
|
||||
serverAddress: http://prometheus-operated.observability.svc.cluster.local.:9090
|
||||
query: ${SCALER_QUERY}
|
||||
threshold: '${SCALER_THRESHOLD:="1"}'
|
||||
ignoreNullValues: '${SCALER_IGNORE_NULL:="0"}'
|
||||
Reference in New Issue
Block a user