<p>I'm trying to setup HPA v1 for my pods using Pulumi</p>
<pre><code>  new HorizontalPodAutoscaler(
    `${prefixedHPAName}`,
    {
        apiVersion: 'autoscaling/v1',
        kind: 'HorizontalPodAutoscaler',
        metadata: {
            name: 'worker',
            clusterName: 'redacted',
            namespace: namespaceName
       },
        spec: {
            maxReplicas: 3,
            minReplicas: 1,
            scaleTargetRef: {
                apiVersion: 'apps/v1',
                kind: 'Deployment',
                name: 'worker'
            },
            targetCPUUtilizationPercentage: 50,
        }
    }
  );
</code></pre>
<p>but I keep getting the following error</p>
<pre><code>kubernetes:autoscaling/v1:HorizontalPodAutoscaler (tushar-routex-routex-hpa):
    error: configured Kubernetes cluster is unreachable: unable to load Kubernetes client configuration from kubeconfig file: invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable
</code></pre>
<p>Are there any examples on how to set HPA for my pods via pulumi?</p>

Tushar Jagtap
<p>The problem is not related to HPA nor pulumi, its a common problem with kubectl/kubernetes clients, where the client cannot find the kube config file to connect to the K8S API.
Check if you have a config file in the path <code>~/.kube/config</code>, then try to export the path before using <code>pulumi</code></p>
<pre class="lang-bash prettyprint-override"><code>export KUBECONFIG=~/.kube/config
</code></pre>
<p>If you don't have a file, you can check the documentation of your cloud provider to create it.</p>
