Is it possible to prevent a ReplicaSet from scaling up/down?

12/11/2019

Basically, I'm asking if ReplicaSets have something simillar to the suspend: "true" option for CronJobs but I'm open to other suggestions.

-- Daniel
kubernetes
kubernetes-pod

2 Answers

12/11/2019

From the official Kubernetes doc

apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
  name: frontend-scaler
spec:
  scaleTargetRef:
    kind: ReplicaSet
    name: frontend
  minReplicas: 3
  maxReplicas: 3
  targetCPUUtilizationPercentage: 50

A quick and easy workaround your problem is to have minReplicas and maxReplicas to the same amount.

Also for measuring traffic is better to use prometheus-operator and grafana, you can install them through Helm without any effort or problems.

That way you can achieve better results in scaling up and down

-- Iakovos Belonias
Source: StackOverflow

12/11/2019

There is no out of box support. But there might be a way to do that using combination of 'kind: PodDisruptionBudget' and 'kind: ResourceQuota'. i havent tried it though

-- P Ekambaram
Source: StackOverflow