Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: where is kubectl? #82

Open
1 task done
sgdc-raymondong opened this issue Jan 4, 2024 · 1 comment
Open
1 task done

Question: where is kubectl? #82

sgdc-raymondong opened this issue Jan 4, 2024 · 1 comment
Labels
bug Something is not working

Comments

@sgdc-raymondong
Copy link

What happened?

Hi there, sorry for my newbie question.
The k8s-set-context also installs kubectl as per the documentation.
I was using kubectl inside a workflow like the yml snippet below.
It was working fine as of May 2023 if I remember correctly.
Today when I ran the workflow, the kubectl is no longer inside "/usr/local/bin/" (I ls'ed "/usr/local/bin/" and it's not there).
May I know where it could be located now? (ubuntu-latest in May2023 could be Ubuntu 20.04. Now it's Ubuntu 22.04)

name: Test CI
on:
  push:
    branches: [ test ]
    paths:
    - '.github/workflows/test.yml'
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: setting the azure kubernetes context
        uses: Azure/k8s-set-context@v1
        with:
          kubeconfig: ${{ secrets.KUBE_CONFIG }}
      - name: Check pods
        run: /usr/local/bin/kubectl get pods -o wide --namespace ab71f066-5279-46bc-8cb8-d15f3cca9a67

The error for the above workflow is as follows:
image

I am not sure why I had to use the kubectl inside "/usr/local/bin/" instead of calling kubectl directly.
If I call kubectl directly today, I am getting some TLS errors.
Does this mean kubectl is actually there, and maybe some certificate field inside {{secrets.KUBE_CONFIG}} just needs to be updated?
(Sorry i don't have access to the Secrets Page in our Github repo)
image

Other things I tried (no success):
• use "ubuntu-20.04" in the "runs-on" field
• use Azure/k8s-set-context@v3
• calling "kubectl version" also leads to TLS errors

Version

  • I am using the latest version

Runner

ubuntu-latest and ubuntu-20.04

Relevant log output

image

@sgdc-raymondong sgdc-raymondong added the bug Something is not working label Jan 4, 2024
@davidgamero
Copy link
Collaborator

If I call kubectl directly today, I am getting some TLS errors.

this looks more like an issue with your auth/kubeconfig, but it could potentially be related to the default version of kubectl being bumped in those runner images?

you could try running which kubectl to find out where the kubectl binary you are using is located

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working
Projects
None yet
Development

No branches or pull requests

2 participants