# k8sGPT with K3s


# Install K8sGPT

k8sGPT GitHub

# Go to Debian base host

1
2
curl -LO https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.3.28/k8sgpt_amd64.deb
sudo dpkg -i k8sgpt_amd64.deb

then enter k8sgpt is ok

1
k8sgpt 

# K3s User should specify kubeconfig

1
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml

# Auth

Login with OpenAI API key

1
2
k8sgpt auth add
# then enter api key

# Analyze

1
k8sgpt analyze --explain [--filter={ResouceType}] [--output=json]

ResourceType Involve

  • Pod
  • Service
  • Deployment

# Reference

  • K8sGPT GitHub
更新於