1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Kubectl AIの使い方

Posted at

kubectl-ai というYAMLファイルを自動でAIが書いてくれるプラグインをご存じでしょうか?
今回は、kubectl-ai の使い方と感触を書きます。

使い方

Step1 インストールします

kubectl krew index add kubectl-ai https://github.com/sozercan/kubectl-ai
kubectl krew install kubectl-ai/kubectl-ai  

Step2 APIキーを設定します

[System.Environment]::SetEnvironmentVariable("OPENAI_API_KEY", "your-api-key-here",[System.EnvironmentVariableTarget]::User)

Step3 OpenAIのモデルを設定します

[System.Environment]::SetEnvironmentVariable("OPENAI_DEPLOYMENT_NAME", "gpt-4", [System.EnvironmentVariableTarget]::User)

Step4 試しに使ってみます(画像のようにAIが書いてくれるはず)

kubectl kubectl-ai "create an nginx deployment with 3 replicas" --raw

image.png

感触

・小規模なら、問題なく出力できた
・実行速度も十分早いため、負担に感じない
・GPTのモデルによってはうまく通信されない恐れがある

まとめ

・めちゃくちゃ便利なので僕は普段使いします
・是非一度利用してみてください

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?