Skip to content

charts/vertical-pod-autoscaler: Extract common probe configurations to template helpers #252

@jparavisini

Description

@jparavisini

Summary

Improve maintainability of the vertical-pod-autoscaler chart by extracting repeated probe configurations into _helpers.tpl.

Background

Following the code review of PR #250, the vertical-pod-autoscaler chart has repeated probe configurations across all three components (recommender, updater, admission-controller). Each component uses similar liveness and readiness probe structures.

Proposed Changes

  1. Create template helpers in _helpers.tpl for:

    • Common liveness probe configuration
    • Common readiness probe configuration
    • Allow customization through values while maintaining DRY principles
  2. Update all component templates to use the new helpers:

    • charts/vertical-pod-autoscaler/templates/recommender.yaml
    • charts/vertical-pod-autoscaler/templates/updater.yaml
    • charts/vertical-pod-autoscaler/templates/admission-controller.yaml

Benefits

  • Reduces code duplication
  • Easier maintenance when updating probe configurations
  • Consistent probe behavior across all VPA components
  • Follows Helm best practices for template organization

Example Helper Structure

{{- define "vertical-pod-autoscaler.livenessProbe" -}}
httpGet:
  path: /health-check
  port: metrics
  scheme: HTTP
failureThreshold: {{ .Values.livenessProbe.failureThreshold | default 6 }}
periodSeconds: {{ .Values.livenessProbe.periodSeconds | default 5 }}
successThreshold: {{ .Values.livenessProbe.successThreshold | default 1 }}
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds | default 3 }}
{{- end }}

Labels

  • enhancement
  • vertical-pod-autoscaler
  • maintainability

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions