LoginSignup
0
0

More than 1 year has passed since last update.

Kubernetes まとめ

Posted at
 $ kubectl get node :readyなnodeが表示される
 $ kubectl apply -f pod.yaml  :podのデプロイ
 $ kubectl get pod  :podの確認
 $ kubectl exec -it nginx-pod -- bash  :コンテナにアタッチする

コンテナリソース 例

code:pod.yaml
  apiVersion: v1
  kind: Pod
  metadata:
  	name: nginx-pod
  spec:
  	containers:
    - name: nginx
  		image: nginx:1.20
      resources:
  			requests:
  				cpu: 1000m
  				memory: 256Mi
  			limits:
  				cpu: 1000m
  				memory: 256
  $ kubectl delete -f pod-with-securitycontext.yaml   :podの削除
  $ kubectl get [リソース種別] ([名前]) … 指定したリソースの情報を取得する (名前が指定された場合は該当するものを取得する)
  $ kubectl describe [リソース種別] ([名前]) … 指定したリソースの情報を詳細取得する (名前が指定された場合は該当するものを取得する)
  $ kubectl apply -f [ファイル名] … ファイル名で示されるファイルで定義されたリソースを適用する
  $ kubectl logs [Pod名] … 指定した Pod において出力されたログを取得する
  $ kubectl exec -it [Pod名] -- [コマンド] … 指定した Pod において指定したコマンドを実行する
  $ kubectl get pod -A  :クラスタ内のすべてのPodの取得
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