koslib / helm-eks-action

The simplest Github Action for executing Helm commands on EKS - cluster authentication included
MIT License
59 stars 61 forks source link

Kubernetes cluster unreachable #44

Open jcputter opened 1 year ago

jcputter commented 1 year ago
Error: Kubernetes cluster unreachable: Get "http://localhost:8080/version": dial tcp 127.0.0.1:8080: connect: connection refused

I'm doing the following to pass kubeconfig

      - name: Set Kube Config
        run: |
          aws eks update-kubeconfig --name ${{ env.CLUSTER_NAME }} --region ${{ env.AWS_REGION }}
          echo 'KUBE_CONFIG_DATA<<EOF' >> $GITHUB_ENV
          echo $(cat ~/.kube/config | base64) >> $GITHUB_ENV
          echo $(cat ~/.kube/config)
          echo 'EOF' >> $GITHUB_ENV
echo $(cat ~/.kube/config)

confirms the correct details

     - name: Deploy DB
        uses: koslib/helm-eks-action@v1.25.4
        env:
          KUBE_CONFIG_DATA: ${{ env.KUBE_CONFIG_DATA }}
        with:
          command: "helm upgrade --install db --namespace=${{ needs.build.outputs.branch }} --create-namespace ./dbs/mariadb --set tag=${{ needs.build.outputs.branch }} --wait"
koslib commented 1 year ago

Hello @jcputter, can you post the snippet which shows how this action is used and the env keys/values provided?

jcputter commented 1 year ago

sure, i updated the original post

koslib commented 1 year ago

@jcputter I have almost identical setups and it works for me. Can I propose two ideas to try out?

  1. Stick to the same setup however pin the action's version to v1.25.2
  2. Try out the experimental branch (instead of a version tag) to confirm it's not any dependency version issues

Also can you somehow confirm the correct value ends up in the github env?

smagurauskas commented 1 year ago

Confirming that fixing version to v1.25.2 solves the issue for time being.