節錄:Objects In Kubernetes | Kubernetes

前言

可以使用 .yaml 來描述一個 kubernetes 元件

fields

  • apiVersion:元件的版本號,可以從 kubectl api-versions 取得支援的版號1
  • kind:元件是什麼屬性,常見有 PodNodeServiceNamespaceReplicationController
  • metadata
    • name 指定該元件的名稱
    • labels 指定該元件的標籤,用於定位
  • spec:What state you desire for the object, a description of a object

Resource Object Types

CategoryResource Object Type Name
Workload2Pod, HorizontalPodAutoscaler(HPA)
ControllerDeployment, ReplicaSet, ReplicationController, StatefulSet, DaemonSet, Job, CronJob
Service DiscoveryService, Ingress
Authentication & AuthorizationServiceAccount, RBAC(Role, ClusterRole, RoleBinding, ClusterRoleBinding)
StorageVolume, PersistentVolume, PersistentVolumeClaim, StorageClass, Secret, ConfigMap
PolicyNetworkPolicy, SecurityContext, ResourceQuota, LimitRange
ExtensionCustomResourceDefinitions

參考資料

Footnotes

  1. Kubernetes 升級 FAQ. Kubernetes 升級速度滿快的,至少一年會需要更新一次大版,遇到 API… | by smalltown | Starbugs Weekly 星巴哥技術專欄 | Medium

  2. Workload Resources | Kubernetes