<p>I have problem with setting bitbucket pipeline for export to Kubernetes. I succesfully run kubernetes onprem, public by publicIP. I have created deployment, services and ingress. Everything working nicely, this is my last stop ... :( </p>

<p>My pipeline:</p>

<pre><code>#enabling docker
options:
  docker: true    
pipelines:
      branches:
        develop:
        - step:
            name: Build app for Develop purposes
            image: node:12.13.0
            caches:
              - node
            script:
              - pwd
              - ls -al
              - npm install  
              # Run our Tests
              # - npm test
              # Package App for Production
              - npm run build:dev
            artifacts:
              - build/**
        - step:
           name: Build Docker Image
           script:
            - export IMAGE_NAME=rurrobotics/ilog-develop:$BITBUCKET_COMMIT
            - docker build -t $IMAGE_NAME .
              # authenticate with the Docker Hub registry
            - docker login --username $DOCKER_HUB_USERNAME --password $DOCKER_HUB_PASSWORD
              # push the new Docker image to the Docker registry
            - docker push $IMAGE_NAME
        - step:
           name: Deploy to Kubernetes
           image: atlassian/pipelines-kubectl
           deployment: test
           script: 
            - export IMAGE_NAME=rurrobotics/ilog-develop:$BITBUCKET_COMMIT
            - echo $KUBE_TOKEN | base64 -d &gt; ./kube_token
            - echo $KUBE_CA | base64 -d &gt; ./kube_ca
            - kubectl config set-cluster kubernetes --server="https://my-public-IP:6443" --certificate-authority="$(pwd)/kube_ca"
            - kubectl config set-credentials bitbucket --token="$(cat ./kube_token)"
            - kubectl config set-context development --cluster=kubernetes --user=bitbucket
            - kubectl config use-context development
            - kubectl --namespace=dev set image deployment/ilog-app ilog-app=$IMAGE_NAME
</code></pre>

<p>Everything works fine until bitbucket says: </p>

<pre><code>+ kubectl config set-cluster kubernetes --server="https://my-public-ip" --certificate-authority="$(pwd)/kube_ca"
error loading config file " LS0tLS1CRUdJTiBDR...bz0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=     server: file name too long
error loading config file " LS0tLS1CRUdJTiBDR... VEUtLS0tLQo=     client-key-data: file name too long
error loading config file " LS0tLS1Ck1N0RuT.....VktLS0tLQo=: file name too long
</code></pre>

<p>I tried multiple tutorials, nothing helps me. </p>

user3646072
<p>I had the exact same issue, and spent waay to long troubleshooting. So for anybody coming here later:</p>

<p>For me the problem was a repository value I added in the pipeline settings earlier called $KUBECONFIG.</p>

<p>After I deleted this value everything worked as it should.</p>
