Comments (13)
I have set up a clean environment on Debian, and I had no issues.
gcloud container clusters get-credentials xxx --region xxx --project xxx
Here's my configuration:
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: DATA+OMITTED
server: https://xxxxx
name: gcp
contexts:
- context:
cluster: gcp
user: gcp
name: gcp
current-context: gcp
kind: Config
preferences: {}
users:
- name: gcp
user:
exec:
apiVersion: client.authentication.k8s.io/v1beta1
args: null
command: gke-gcloud-auth-plugin
env: null
installHint: Install gke-gcloud-auth-plugin for use with kubectl by following
https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke
interactiveMode: IfAvailable
provideClusterInfo: true
Here's my version of gcloud:
root@xxxx:~/.kube# gcloud version
Google Cloud SDK 424.0.0
alpha 2023.03.24
beta 2023.03.24
bq 2.0.89
bundled-python3-unix 3.9.16
core 2023.03.24
gcloud-crc32c 1.0.0
gke-gcloud-auth-plugin 0.5.2
gsutil 5.21
I think you need to use gke-gcloud-auth-plugin
as authentication method.
from k8sgpt.
Hello @hapham1701!
Unfortunately, I could not reproduce your issue. Authenticated on a cluster using
gcloud container clusters get-credentials ******** --zone ********** --project ********
and could analyze without problems. Please provide a bit more information on your configuration, e.g., some obfuscated information about your kube context. Thank you!
from k8sgpt.
this is full error:
Error initialising kubernetes client: no Auth Provider found for name "gcp"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x103d0c600]
goroutine 1 [running]:
github.com/k8sgpt-ai/k8sgpt/pkg/analyzer.AnalyzePod({0x104311018, 0x14000134010}, 0x14000257bb8, 0x0, {0x10?, 0x103d31816?}, 0x14000257ba0)
/home/runner/work/k8sgpt/k8sgpt/pkg/analyzer/podAnalyzer.go:17 +0x40
github.com/k8sgpt-ai/k8sgpt/pkg/analyzer.RunAnalysis({0x104311018, 0x14000134010}, 0x33?, 0x103d1d9f0?, {0x1043001a8, 0x1400042cb28}, 0x1040e0020?)
/home/runner/work/k8sgpt/k8sgpt/pkg/analyzer/analyzer.go:18 +0x38
github.com/k8sgpt-ai/k8sgpt/cmd/analyze.glob..func1(0x104ead1a0?, {0x103d1bc51?, 0x0?, 0x0?})
/home/runner/work/k8sgpt/k8sgpt/cmd/analyze/analyze.go:80 +0x30c
github.com/spf13/cobra.(*Command).execute(0x104ead1a0, {0x104ef9f68, 0x0, 0x0})
/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:920 +0x5ac
github.com/spf13/cobra.(*Command).ExecuteC(0x104eacbe0)
/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1044 +0x340
github.com/spf13/cobra.(*Command).Execute(...)
/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:968
github.com/k8sgpt-ai/k8sgpt/cmd.Execute({0x103f40730?, 0x140000021a0?})
/home/runner/work/k8sgpt/k8sgpt/cmd/root.go:36 +0x58
main.main()
/home/runner/work/k8sgpt/k8sgpt/main.go:11 +0x2c
from k8sgpt.
As written before, please add some more information about your configuration.
e.g. kubectl config view (for your current context).
from k8sgpt.
If you could print your ~/.k8sgpt.yaml
( omitting your key for openAI) we could see what's going on.. the auth backend shouldn't be giving that error at all.
from k8sgpt.
result : cat ~/.k8sgpt.yaml
backend_type: openai
kubernetesclient: null
openai_key:xxxxxxxxxx
from k8sgpt.
@hapham1701 Do you have gcloud properly installed/configured on your environment ?
from k8sgpt.
This is information about gcloud and kubectl, which i have already installed on my laptop. Please feel free to ask me if you need any further information:
gcloud version
Google Cloud SDK 423.0.0
alpha 2023.03.17
beta 2023.03.17
bq 2.0.88
config-connector 1.93.0
core 2023.03.17
gsutil 5.21
Updates are available for some Google Cloud CLI components. To install them,
please run:
$ gcloud components update
To take a quick anonymous survey, run:
$ gcloud survey
~ kubectl version
Client Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.0", GoVersion:"go1.17.3", Compiler:"gc", Platform:"darwin/arm64"}
Server Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.9-gke.3200", GoVersion:"go1.18.9b7", Compiler:"gc", Platform:"linux/amd64"}
from k8sgpt.
Hi @thschue This is the result of the command: kubectl config view
- name: xxxxxxx
user:
auth-provider:
config:
access-token: xxxxx
cmd-args: config config-helper --format=json
cmd-path: /opt/homebrew/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/bin/gcloud
expiry: "xxxxxx"
expiry-key: '{.credential.token_expiry}'
token-key: '{.credential.access_token}'
name: gcp
from k8sgpt.
@hapham1701 can you try to run : gcloud components install gke-gcloud-auth-plugin
please ?
from k8sgpt.
Here's my version of gcloud:
~ gcloud version
Google Cloud SDK 423.0.0
alpha 2023.03.17
beta 2023.03.17
bq 2.0.88
config-connector 1.93.0
core 2023.03.17
gke-gcloud-auth-plugin 0.5.2
gsutil 5.21
After install gke-gcloud-auth-plugin, The error still exists.
from k8sgpt.
It worked after I upgraded ver chatgpt to 0.1.6 and ran the command 'gcloud container clusters get-credentials xxx --region xxx --project xxx'. I don't know why I needed to get credentials even though they already existed.
Thank you for your support.
from k8sgpt.
I experienced the same problem, but I can confirm that it is recovered by installing and activating the gke-gcloud-auth-plugin
described in the discussion here. It is important to note that the problem will not be solved without installing, activating and getting credentials for the gke-gcloud-auth-plugin, as I found out when I checked the operation. Therefore, to solve the problem, you need to execute all of the following commands.
% gcloud components install gke-gcloud-auth-plugin
-> gke-gcloud-auth-plugin will be installed
% export USE_GKE_GCLOUD_AUTH_PLUGIN=True
-> gke-gcloud-auth-plugin will be activated
% gcloud container clusters get-credentials xxx --region xxx --project xxx
-> Credentials will be obtained by authentication with gke-gcloud-auth-plugin
% k8sgpt analyse
-> You will be able to see that the problem has been resolved.
A change in the kubectl authentication method causes this problem. You can read the details in the following document.
https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke?hl=en
from k8sgpt.
Related Issues (20)
- Unable to install K8S GPT as a container HOT 1
- [Feature]: Need to cover more error reason messages.
- [Feature]: add cronjob max time flag HOT 1
- [Feature]: Replace rest kubernetes client with controller-runtime clientset for Trivy integration analyzers HOT 2
- [Feature]: Add system role in message HOT 2
- [Question]: Configuring k8sgpt with localAI HOT 3
- [Feature]: add llm request count on prometheus metric HOT 2
- [Bug]: Regex for LogAnalyzer to filter error messages is case-sensitive
- [Feature]: Deep dive alerts HOT 1
- Feature: Add the Vertex Ai Client HOT 1
- [Feature]: add unit tests for pkg/server
- [Bug]: Incorrect error during output selection HOT 1
- [Bug]: --with-doc flag not working HOT 3
- [Feature]: backend support for Hugging Face HOT 1
- [UX]: K8sGPT auth message unclear
- Interactive mode of Analysis command
- Disable cache HOT 1
- Custom analyzers
- Custom prompt prefix for specific problem / analysis. HOT 1
- Feature: CLI backend configuration overhaul HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from k8sgpt.