0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

kubernetes入門 - Part2 - kubectl関連のyamlについて調べる

Posted at

yamlひな形を作成

kubectl create --dry-run -o yamlで作成できる

kubectl create deployment myapp --image=nginx --dry-run=client -o yaml > deployment.yaml

マニフェスト

順番が逆かもしれないが、kubernetesで記載しているyamlはマニュフェストと呼ばれる。yamlで記述することで、リソース定義をツリー構造で定義する。

マニフェストでの必須項目

リソースの設定項目 意味
apiVersion kubernetesのAPIのバージョンを指定する apps/v1など。kubectl explain deploymentでで対象リソースの詳細と apiVersion が確認できます。
kind 使用するコンテナや実行するプログラムを定義する ConfigMap、Pod、Service、Deploymentなど
metadata 必須項目であり、オブジェクトを一意に特定するための情報を指定する。name、UID、namespaceなどの一意の名前を必ず指定する
spec 作成するオブジェクトの概要
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?