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?

More than 1 year has passed since last update.

Kubernetesにおけるリソースの割当

Last updated at Posted at 2022-11-10

Kubernetes(minikube)におけるリソースの設定・確認方法メモ。

Node

minikubeの場合、設定は起動時か、ドライバ側の設定に依存するみたい。
確認は、以下で可能。

kubectl describe node node_name

以下はminikubeのdescribe内容。

Driveで指定しているDocker側の設定が反省されてるみたい。

(抜粋)

Capacity:
  cpu:                12
  ephemeral-storage:  61202244Ki
  hugepages-1Gi:      0
  hugepages-2Mi:      0
  memory:             33867492Ki
  pods:               110
Allocatable:
  cpu:                12
  ephemeral-storage:  61202244Ki
  hugepages-1Gi:      0
  hugepages-2Mi:      0
  memory:             33867492Ki
  pods:               110
  
(抜粋)

Pod

PodについてはYaml等で指定可能。

apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-www
spec:
  replicas: 1
  selector:
    matchLabels:
      app: my-www
  template:
    metadata:
      labels:
        app: my-www
    spec:
      containers:
      - name: my-www
        image: nginx
        ports:
        - containerPort: 80
        resources:
          requests: #最低
            cpu: 250m #クラウドサービスにより表記異なる
            memory: 512Mi
          limits: #上限
            cpu: 1000m
            memory: 1024Mi

確認はdescribeで。

kubectl describe pod pod_name

(抜粋)

    Limits:
      cpu:     1
      memory:  1Gi
    Requests:
      cpu:        250m
      memory:     512Mi
      
(抜粋)

リソース不足時の挙動などが知りたいが、一旦確認方法でした。

参考

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?