Skip to content

Commit

Permalink
Enable apiserver HVPA. (#275)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit91 authored Mar 25, 2024
1 parent 6b2d664 commit c9002d3
Show file tree
Hide file tree
Showing 6 changed files with 561 additions and 164 deletions.
4 changes: 4 additions & 0 deletions control-plane/roles/gardener/defaults/main/gardener.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ gardener_gardenlet_shoot_concurrent_syncs: 20
gardener_gardenlet_shoot_reconcile_in_maintenance_only: false
gardener_gardenlet_shoot_respect_sync_period_overwrite: true

gardener_gardenlet_feature_gates:
HVPA: false
HVPAForShootedSeed: false

gardener_shooted_seeds: []
# - name: shoot-1
# project_id: 00000000-0000-0000-0000-000000000001
Expand Down

Large diffs are not rendered by default.

16 changes: 11 additions & 5 deletions control-plane/roles/gardener/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,19 @@
- gardener_dns_provider is not none
- gardener_cloud_profile_metal_api_url is not none
- gardener_cloud_profile_metal_api_hmac is not none
# Gardener expects a VPA to be present, otherwise VPA enabled and soil bootstrapping do not work
# maybe this can be removed in a future version of Gardener?
- name: Deploy VerticalPodAutoscaler CRD if required

- name: Deploy required Seed CRDs
k8s:
definition: "{{ lookup('template', 'vpa.yaml') }}"
definition: "{{ item.definition }}"
apply: yes
when: not lookup('k8s', api_version='apiextensions.k8s.io/v1', kind='CustomResourceDefinition', resource_name='verticalpodautoscalers.autoscaling.k8s.io')
loop:
- name: hvpas
definition: "{{ (lookup('url', 'https://raw.githubusercontent.com/gardener/gardener/' + gardener_repo_ref + '/example/seed-crds/10-crd-autoscaling.k8s.io_hvpas.yaml', split_lines=False) | from_yaml_all | list)[0] }}"
# TODO: starting from g/g 1.82, this resource will be located in seed-crds, too
- name: vpas
definition: "{{ lookup('file', '10-crd-autoscaling.k8s.io_verticalpodautoscalers.yaml') }}"
loop_control:
label: "{{ item.name }}"

- name: Create garden namespace
k8s:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,38 +51,8 @@ global:
shootViewerKubeconfigMaxExpiration: {{ gardener_apiserver_shoot_kubeconfig_max_expiration }}

vpa: {{ gardener_apiserver_vpa }}
# this requires the Hvpa resource in autoscaling.k8s.io/v1alpha1, which is not in the GKE cluster... how to actually use this?
# hvpa:
# enabled: true
# maxReplicas: 4
# minReplicas: 1
# targetAverageUtilizationCpu: 400
# targetAverageUtilizationMemory: 400
# vpaScaleUpStabilization:
# stabilizationDuration: "3m"
# minChange:
# cpu:
# value: 300m
# percentage: 80
# memory:
# value: 600M
# percentage: 80
# vpaScaleDownStabilization:
# stabilizationDuration: "15m"
# minChange:
# cpu:
# value: 200m
# percentage: 80
# memory:
# value: 300M
# percentage: 80
# limitsRequestsGapScaleParams:
# cpu:
# value: "1"
# percentage: 40
# memory:
# value: "2G"
# percentage: 40
hvpa:
enabled: true

scheduler:
resources: {{ gardener_scheduler_resources | to_json }}
Expand Down
4 changes: 1 addition & 3 deletions control-plane/roles/gardener/templates/gardenlet-values.j2
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ config:
- key: seed.gardener.cloud/invisible
- key: seed.gardener.cloud/disable-capacity-reservation

featureGates:
HVPA: false
HVPAForShootedSeed: false
featureGates: {{ gardener_gardenlet_feature_gates | to_json }}

vpa: {{ gardener_soil_vertical_pod_autoscaler_enabled }}

Expand Down
124 changes: 0 additions & 124 deletions control-plane/roles/gardener/templates/vpa.yaml

This file was deleted.

0 comments on commit c9002d3

Please sign in to comment.