Configuring horizontal auto-scaling in AuthHub
search cancel

Configuring horizontal auto-scaling in AuthHub

book

Article ID: 282421

calendar_today

Updated On: 04-22-2024

Products

VIP Authentication Hub

Issue/Introduction

If the incoming authentication request load reaches certain threshold, how AuthHub automatically scale up by increasing number of pods?

Environment

Release: VIP Authentication Hub all releases

Resolution

We use hpa (Horizontal Pod Autoscaler) to achieve pods auto-scaling. VIP Authentication Hub has the following hpa objects.

kubectl get hpa -n ssp

NAME                       REFERENCE                         TARGETS   MINPODS   MAXPODS   REPLICAS   AGE
ssp-ssp-admin-hpa          Deployment/ssp-ssp-admin          1%/80%    1         1         1          13d
ssp-ssp-adminconsole-hpa   Deployment/ssp-ssp-adminconsole   0%/80%    1         1         1          13d
ssp-ssp-auth-mgr-hpa       Deployment/ssp-ssp-auth-mgr       1%/80%    1         1         1          13d
ssp-ssp-azserver-hpa       Deployment/ssp-ssp-azserver       1%/80%    1         1         1          13d
ssp-ssp-factor-hpa         Deployment/ssp-ssp-factor         0%/80%    1         1         1          13d
ssp-ssp-geolocation-hpa    Deployment/ssp-ssp-geolocation    0%/80%    1         1         1          13d
ssp-ssp-iarisk-hpa         Deployment/ssp-ssp-iarisk         2%/80%    1         1         1          13d
ssp-ssp-identity-hpa       Deployment/ssp-ssp-identity       0%/80%    1         1         1          13d
ssp-ssp-opa-hpa            Deployment/ssp-ssp-opa            0%/80%    1         1         1          13d
ssp-ssp-signin-hpa         Deployment/ssp-ssp-signin         0%/80%    1         1         1          13d

You can check the yaml of each hpa object, e.g.

kubectl get hpa ssp-ssp-factor-hpa -n ssp -o yaml

apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  annotations:
    meta.helm.sh/release-name: ssp
    meta.helm.sh/release-namespace: ssp
  creationTimestamp: "2024-04-04T03:08:40Z"
  labels:
    app.kubernetes.io/instance: ssp
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: ssp-factor-hpa
  name: ssp-ssp-factor-hpa
  namespace: ssp
  resourceVersion: "1598198"
  uid: cef378ea-66fe-4459-936c-139621f73eb9
spec:
  maxReplicas: 1
  metrics:
  - resource:
      name: cpu
      target:
        averageUtilization: 80
        type: Utilization
    type: Resource
  minReplicas: 1
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: ssp-ssp-factor
...

You can edit the hpa object, i.e. minReplicas, maxReplicas and averageUtilization values to adjust to your requirements.