k8s in action summary ~3

第10章
要点:

  • Give replicated pods individual storage
  • Provide a stable identity to a pod
  • Create a StatefulSet and a corresponding headless governing Service
  • Scale and update a StatefulSet
Discover other members of the StatefulSet through DNS
  • Connect to other members through their host names
  • Forcibly delete stateful pods

···

  • 何谓有状态?就是说具有 stable identity,比如name,ip,storage。
  • dns srv 记录,类似负载均,只不过是 service -> map pod with ip

第十四章:
Qos class:

  • besteffort
  • burstable
  • guaranteed

Qos class 是 Quality of Service (QoS) classes 的简写,是当no CPU time at all and will be the first ones killed when memory needs to be freed for other pods. 时的依据处理方式。

resource requests limit and qos classes

which pods get killed first


第十八章

主要是介绍了 helm 的使用方法。helm 类似于 yum、apt,只不过是作为构建在 k8s 之上的包管理工具。

  • 期间了解 helm 遇到个小问题:

    helm install happy-panda stable/mariadb
    helm uninstall stable/mariadb
    helm install happy-panda stable/mariadb 会失败,原因是 uninstall stable/mariadb 并不会删除相关的 pvc。