Azure / Azure/k8s-set-context

Question: where is kubectl?

Open
#82 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
103
Forks
43
Avg merge
5d 23m
Merged PRs (30d)
2

Description

### 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](https://github.com/Azure/k8s-set-context/assets/104970181/2924f8cc-f772-4e98-b8cc-72a0823abc48)

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](https://github.com/Azure/k8s-set-context/assets/104970181/adba4cfd-2e14-4872-a28b-3d7dbdff3fc0)

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

- [X] I am using the latest version

### Runner

ubuntu-latest and ubuntu-20.04

### Relevant log output

![image](https://github.com/Azure/k8s-set-context/assets/104970181/2924f8cc-f772-4e98-b8cc-72a0823abc48)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the provided GitHub Actions workflow and compare Azure/k8s-set-context@v1 and @v3 on ubuntu-latest and ubuntu-20.04. Check the workflow logs for kubectl availability and the TLS errors from direct invocation and kubectl version. Done means determining whether the action, runner image, or kubeconfig causes the reported behavior and recording the supported invocation.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, kubernetes, typescript
Domain
ci-cd, cloud, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.