<p dir="auto">We are planning to implement horizontal pod autoscaling base on custom metrics.</p>
<p dir="auto">The custom metrics need to be exposed by each of pods from RC/deployment as described in <a href="https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/custom-metrics.md#custom-metrics-in-kubernetes">custom metrics proposal</a>.</p>
<p dir="auto">Spec of HPA will contain a list of custom metric names together with their target utilizations. If the desired numbers of pods resulting from different custom metrics utilizations are different, the autoscaler will choose the bigger number. HPA Status will contain latest observed values of the custom metrics.</p>
<p dir="auto">Proposed modification in the API:</p>
<div class="highlight highlight-source-go notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="type CustomMetricTargetUtilization struct {
    Metric string
    Target float64
}

type HorizontalPodAutoscalerSpec struct {
    ...
    CustomMetricUtilizations []CustomMetricTargetUtilization
}

type CustomMetricCurrentValue struct {
    Metric string
    Value float64
}

type HorizontalPodAutoscalerStatus struct {
    ...
    CustomMetricValues []CustomMetricCurrentValue
}
"><pre class="notranslate"><span class="pl-k">type</span> <span class="pl-smi">CustomMetricTargetUtilization</span> <span class="pl-k">struct</span> {
    <span class="pl-c1">Metric</span> <span class="pl-smi">string</span>
    <span class="pl-c1">Target</span> <span class="pl-smi">float64</span>
}

<span class="pl-k">type</span> <span class="pl-smi">HorizontalPodAutoscalerSpec</span> <span class="pl-k">struct</span> {
    <span class="pl-c1">...</span>
    <span class="pl-c1">CustomMetricUtilizations</span> []<span class="pl-smi">CustomMetricTargetUtilization</span>
}

<span class="pl-k">type</span> <span class="pl-smi">CustomMetricCurrentValue</span> <span class="pl-k">struct</span> {
    <span class="pl-c1">Metric</span> <span class="pl-smi">string</span>
    <span class="pl-c1">Value</span> <span class="pl-smi">float64</span>
}

<span class="pl-k">type</span> <span class="pl-smi">HorizontalPodAutoscalerStatus</span> <span class="pl-k">struct</span> {
    <span class="pl-c1">...</span>
    <span class="pl-c1">CustomMetricValues</span> []<span class="pl-smi">CustomMetricCurrentValue</span>
}</pre></div>
<p dir="auto"><strong>What happened</strong>:<br>
We created a scheduled jobs from example mentioned on documentation.<br>
kubectl run hello --schedule="0/1 * * * ?" --restart=OnFailure --image=busybox -- /bin/sh -c "date; echo Hello from the Kubernetes cluster"</p>
<p dir="auto">kubectl get scheduledjob hello<br>
NAME      SCHEDULE      SUSPEND   ACTIVE    LAST-SCHEDULE<br>
hello     0/1 * * * ?   False     0         </p>
<p dir="auto">It never create a associated jobs.</p>
<p dir="auto"><strong>What you expected to happen</strong>:<br>
It should create jobs as per scheduled job specification.</p>
<p dir="auto"><strong>How to reproduce it</strong> (as minimally and precisely as possible):<br>
We noticed this problem with v1.4.3 however on stage cluster we run v1.4.4 and it does create associated jobs there.</p>
<p dir="auto"><strong>Output from stage cluster:</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="kubectl get jobs
NAME                     DESIRED   SUCCESSFUL   AGE
hello-1859028810         1         1            11m
hello-1934853965         1         1            12m
hello-1934985037         1         1            9m
hello-1935116109         1         1            6m
hello-2010810192         1         1            10m
hello-2010941264         1         1            7m
hello-2011072336         1         1            4m
hello-2011203408         1         1            1m
hello-2086766419         1         1            8m
hello-2086897491         1         1            5m
hello-2087028563         1         1            2m
hello-2162853718         1         1            3m
hello-2162984790         1         1            33s
"><pre class="notranslate"><code class="notranslate">kubectl get jobs
NAME                     DESIRED   SUCCESSFUL   AGE
hello-1859028810         1         1            11m
hello-1934853965         1         1            12m
hello-1934985037         1         1            9m
hello-1935116109         1         1            6m
hello-2010810192         1         1            10m
hello-2010941264         1         1            7m
hello-2011072336         1         1            4m
hello-2011203408         1         1            1m
hello-2086766419         1         1            8m
hello-2086897491         1         1            5m
hello-2087028563         1         1            2m
hello-2162853718         1         1            3m
hello-2162984790         1         1            33s

</code></pre></div>
<p dir="auto"><strong>Kubernetes version</strong> (use <code class="notranslate">kubectl version</code>):<br>
1.4.3</p>
<p dir="auto"><strong>Environment</strong>:</p>
<ul dir="auto">
<li><strong>Cloud provider or hardware configuration</strong>: AWS</li>
<li><strong>OS</strong> (e.g. from /etc/os-release): CoreOS 1122.3.0</li>
<li><strong>Kernel</strong> (e.g. <code class="notranslate">uname -a</code>): Linux -1 4.7.0-coreos-r1</li>
<li><strong>Others</strong>: Enabled  --runtime-config=batch/v2alpha1 in apiserver flag.</li>
</ul>
<p dir="auto">Is this issue related to specific kubernetes version like v1.4.3 where it couldn't create associated jobs as per scheduled job specification?</p>
<p dir="auto">Please let us know if you need any more information on this.<br>
Thanks!</p>