Skip to content
Draft
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
7 changes: 7 additions & 0 deletions cluster/config-defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,13 @@ prometheus_remote_max_backoff: "10s"
# Comma-separated list of user ids allowed to access Prometheus UI
prometheus_ui_users: ""

# Scheduled scaling events for Prometheus VPA (in the format
# <name>:<pre-start-min>:<cpu>:<memory>, multiple events separated by commas)
prometheus_scheduled_scaling_events: ""

# Enable scheduled scaling for VPA
scheduled_scaling_vpa_enabled: "false"

metrics_service_cpu: "100m"
metrics_service_mem_max: "4Gi"
metrics_server_metric_resolution: "15s"
Expand Down
37 changes: 37 additions & 0 deletions cluster/manifests/02-scheduled-scaling-vpa/cronjob.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{{- if eq .Cluster.ConfigItems.scheduled_scaling_vpa_enabled "true" }}
apiVersion: batch/v1
kind: CronJob
metadata:
name: scheduled-scaling-vpa
namespace: kube-system
labels:
application: kubernetes
component: scheduled-scaling-vpa
spec:
schedule: "*/5 * * * *"
concurrencyPolicy: Forbid
startingDeadlineSeconds: 30
successfulJobsHistoryLimit: 1
failedJobsHistoryLimit: 1
jobTemplate:
metadata:
labels:
application: kubernetes
component: scheduled-scaling-vpa
spec:
activeDeadlineSeconds: 30
backoffLimit: 1
template:
metadata:
labels:
application: kubernetes
component: scheduled-scaling-vpa
annotations:
logging/destination: "{{.Cluster.ConfigItems.log_destination_infra}}"
spec:
serviceAccountName: scheduled-scaling-vpa
restartPolicy: Never
containers:
- name: main
image: container-registry-test.zalando.net/cloud-platform/scheduled-scaling-vpa:pr-1-4
{{- end }}
44 changes: 44 additions & 0 deletions cluster/manifests/02-scheduled-scaling-vpa/rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{{ if eq .Cluster.ConfigItems.scheduled_scaling_vpa_enabled "true" }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: scheduled-scaling-vpa
namespace: kube-system
labels:
application: kubernetes
component: scheduled-scaling-vpa
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: scheduled-scaling-vpa
labels:
application: kubernetes
component: scheduled-scaling-vpa
rules:
- apiGroups: ["autoscaling.k8s.io"]
resources: ["verticalpodautoscalers"]
verbs: ["get", "list", "watch", "create", "update", "patch"]
- apiGroups: ["zalando.org"]
resources:
- "verticalpodautoscalers"
- "scalingschedules"
- "clusterscalingschedules"
verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: scheduled-scaling-vpa
labels:
application: kubernetes
component: scheduled-scaling-vpa
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: scheduled-scaling-vpa
subjects:
- kind: ServiceAccount
name: scheduled-scaling-vpa
namespace: kube-system
{{- end }}
Loading