Skip to content

Documentation: add documentation to explain the compatibility configuration between SlimFaas and Horizontal Pod Autoscaler #186

@antoineblancke

Description

@antoineblancke

❗Potential Conflict Between HPA and SlimFaas/ReplicasAtStart

When using Horizontal Pod Autoscaler (HPA) together with SlimFaas, the minReplicas value defined in the HPA must be greater than or equal to the SlimFaas annotation SlimFaas/ReplicasAtStart.

Failing to respect this rule may result in unexpected behavior:
the HPA will enforce its minimum replicas based on CPU utilization, while SlimFaas will attempt to set its initial replica count independently, potentially causing conflicting scaling decisions or oscillations.


✅ Example Configuration

HPA

apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: my-hpa
spec:
  maxReplicas: 8
  minReplicas: 2 # Must be >= SlimFaas/ReplicasAtStart
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: receiver
  metrics:
    - type: Resource
      resource:
        name: cpu
        target:
          type: Utilization
          averageUtilization: 65

SlimFaas

template:
  metadata:
    labels:
      app: my-service
    annotations:
      SlimFaas/Function: "true"
      SlimFaas/NumberParallelRequest: "2"
      SlimFaas/ReplicasAtStart: "2"

✅ Recommendation

Ensure that:

HPA.minReplicas >= SlimFaas/ReplicasAtStart

This guarantees consistent autoscaling behavior between SlimFaas and the Kubernetes HPA.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions