1
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 の基本概念

Posted at

Kubernetes にはいろいろなオブジェクトがありますが、まずは「超重要コア概念」だけを押さえましょう。

1.Pod(最小の実行単位)

  • Kubernetesでアプリを動かす最小単位がPod
  • 一つ以上のコンテナをまとめたもの(普通は1つだけ)
  • 例:APIサーバー、DBなど
  • 壊れたら消える、勝手に再起動しないという特徴がある

2.Deployment(Podを管理するコントローラー)

Deploymentの役割

  • Podの数を維持する(100つにしておくなど🤣)
  • Podが死んだら自動で再生成する
  • ローリングアップデートで安全に更新

DeploymentがないPodの問題:

  • クラッシュしたら終わり
  • アップデートが手動で面倒
  • スケールできない

3.Service(ネットワークアクセスの提供)

PodはIPが変わるので、そのままでは通信できません

Serviceの役割

  • 変わらないIP(仮想IP)を提供
  • クラスタ内のロードバランサーの役割
  • DeploymentのPodに流してくれる
    ### 種類:
  • ClusterIP(内部用。基本)
  • NodePort(外部アクセス可能)
  • LoadBalancer(クラウド用)

4.ConfigMap/Secret

アプリ設定をK8sで管理するための仕組み

ConfigMap

  • プレーンな設定値(DBのURL、環境設定など)

Secret

  • パスワード、APIキーなどの機密情報(BASE64で保持)

5.Ingress(HTTPルーティング)

Serviceの上にいて「/apiはこのサービスへ」「/webはこのサービスへ」とルールを作る仕組み


※実際に手を動かして学習の記事は次の記事に書きます。

1
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
1
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?