<p>Using CRD of SeldonDeployment I want to configure HPA following this <a href="https://docs.seldon.io/projects/seldon-core/en/latest/examples/autoscaling_example.html" rel="nofollow noreferrer">example</a>
. The seldon deployment config is -</p>
<pre><code>apiVersion: machinelearning.seldon.io/v1
kind: SeldonDeployment
metadata:
  name: seldon-model
spec:
  name: test-deployment
  predictors:
  - componentSpecs:
    - hpaSpec:
        maxReplicas: 3
        metrics:
        - resource:
            name: cpu
            targetAverageUtilization: 10
          type: Resource
        minReplicas: 1
      spec:
        containers:
        - image: seldonio/mock_classifier:1.5.0-dev
          imagePullPolicy: IfNotPresent
          name: classifier
          resources:
            requests:
              cpu: '0.5'
        terminationGracePeriodSeconds: 1
    graph:
      children: []
      name: classifier
      type: MODEL
    name: example
</code></pre>
<p>When the above is applied this generates a deployment and a declarative HPA (along with other components). The deployment file is identical for QA, Alpha and Prod environments leading to the number of max / min replicas being the same. <strong>1. Can the number of replicas be made configurable for different environments?</strong> i.e different values for max / min replicas for different envs (in the CRD SeldonDeployment config file).</p>
<p>Note: for other (non-Seldon) deployments, we use declarative HPA for each environment. But this is not possible in this case since the Seldon controller manager reverts any diff between the applied CRD and current (generated from the CRD) deployment.</p>
<p><strong>2. More generalized question: how would we inject dynamic variables in CRD-based deployments?</strong></p>

<p>I don't think that's a seldon-specific question.</p>
<p>I think you should define 3 charts like this for QA, Alpha and Prod. Each chart should have different values, and that's it!</p>
<p>Another thing is that this solution would duplicates the code - your static chart would be copied 3 times with just HPA params changed. One of the solutions for that is using <code>helm</code> charts. In this case, you write the chart <code>template</code>, that has a placeholder for the HPA values, and you just write 3 <code>values</code> files. That way you have one chart written and 3 <code>values</code> files that dynamically set the values for HPA.</p>
