1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【kubernetes】Secretリソースを削除するには

Posted at

#概要

  • Kubenetesのリファレンスを読んだが、作成コマンドの記載は見つかったが、削除方法が明記されていなったのでここに記載しました。
  • 個人的備忘メモのレベルで恐縮です。

#Secretリソースの作成/削除

作成

作成方法の詳細はリファレンスのこちらをご参照ください。

--from-literal オプションで作成する場合は以下の形となります。(公式サイトの記載を引用)

kubectl create secret generic dev-db-secret --from-literal=username=devuser --from-literal=password='S!B\*d$zDsb='

作成しなおそうと同じコマンドを実行すると以下の様にエラーが発生し、実行できません。

Error from server (AlreadyExists): secrets "dev-db-secret" already exists

削除する場合は、以下の様に行います。

削除

kubectl delete secret mongo-secret
  • delete Secret名 とするだけです。
  • 何気にリファレンスから探し出せなかったので、ちょっとはまりました。
1
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?