<p>skaffold version
v1.35.1</p>
<p>Using <a href="https://kind.sigs.k8s.io/docs/user/local-registry/" rel="nofollow noreferrer">local registry:2</a> in KinD cluster.</p>
<p><code>kubectl config current-context</code> &gt; kind-kind. And kubectl config view, shows the right url for <code>kind-kind</code> to the server: 127.0.0.1:57836</p>
<h3>Expected behavior</h3>
<p>In Goland: Cloud Code: Kubernetes - a running example</p>
<p>skaffold.yaml</p>
<pre><code># To learn more about the skaffold.yaml schema visit
# https://skaffold.dev/docs/references/yaml/
apiVersion: skaffold/v2beta19
kind: Config
build:
  artifacts:
  - context: .
    image: go-hello-world
deploy:
  kubectl:
    manifests:
    - kubernetes-manifests/**
</code></pre>
<h3>Actual behavior</h3>
<p>Error:</p>
<pre><code>unable to connect to Kubernetes: the server has asked for the client to provide credentials
</code></pre>
<p>Note in the following, that it actually runs - but only very short time. See: <code>Step 8/14</code> in the following</p>
<p>skaffold dev --default-repo localhost:5000</p>
<pre><code>Listing files to watch...
 - go-hello-world
Generating tags...
 - go-hello-world -&gt; 127.0.0.1:5000/go-hello-world:6b3fc6f-dirty
Checking cache...
 - go-hello-world: Not found. Building
Starting build...
Found [kind-kind] context, using local docker daemon.
Building [go-hello-world]...
Sending build context to Docker daemon  932.9kB
Step 1/14 : FROM golang:1.16 as build
 ---&gt; 5b838b7289de
Step 2/14 : WORKDIR /hello-world
 ---&gt; Using cache
 ---&gt; a8c93bc46b78
Step 3/14 : COPY go.mod go.sum ./
 ---&gt; Using cache
 ---&gt; cba8d38c5d62
Step 4/14 : RUN go mod download
 ---&gt; Using cache
 ---&gt; bfb3c3842a45
Step 5/14 : COPY . ./
 ---&gt; f7f0547858d2
Step 6/14 : ARG SKAFFOLD_GO_GCFLAGS
 ---&gt; Running in 8df9562291c8
 ---&gt; 20aec50f0a84
Step 7/14 : RUN echo &quot;Go gcflags: ${SKAFFOLD_GO_GCFLAGS}&quot;
 ---&gt; Running in f35f8060867a
Go gcflags: 
 ---&gt; cc2532367c46
Step 8/14 : RUN go build -gcflags=&quot;${SKAFFOLD_GO_GCFLAGS}&quot; -mod=readonly -v -o /app
 ---&gt; Running in 03fe6cd6a195
hello-world
 ---&gt; d8873c3d1844
Step 9/14 : FROM gcr.io/distroless/base
 ---&gt; 64bbfbb81976
Step 10/14 : ENV GOTRACEBACK=single
 ---&gt; Using cache
 ---&gt; e7db9a53c2fe
Step 11/14 : WORKDIR /hello-world
 ---&gt; Using cache
 ---&gt; cba82d8b0927
Step 12/14 : COPY --from=build /app .
 ---&gt; Using cache
 ---&gt; fdd46a287814
Step 13/14 : COPY template ./template
 ---&gt; Using cache
 ---&gt; 01f1804abfcc
Step 14/14 : ENTRYPOINT [&quot;./app&quot;]
 ---&gt; Using cache
 ---&gt; c57d404bd28f
Successfully built c57d404bd28f
Successfully tagged 127.0.0.1:5000/go-hello-world:6b3fc6f-dirty
Tags used in deployment:
 - go-hello-world -&gt; 127.0.0.1:5000/go-hello-world:c57d404bd28fbee71266d45debb822dd57215b585c2e16f5b1b21b5632ee0904
Starting deploy...
Cleaning up...
unable to connect to Kubernetes: the server has asked for the client to provide credentials
</code></pre>

Chris G.
<p>Running skaffold with the <code>--kubeconfig &lt;path to kubeconfig file&gt;</code> should to the trick.</p>
