前言
可以使用 .yaml 來描述一個 kubernetes 元件
fields
apiVersion:元件的版本號,可以從kubectl api-versions取得支援的版號1。kind:元件是什麼屬性,常見有Pod、Node、Service、Namespace、ReplicationController。metadataname指定該元件的名稱labels指定該元件的標籤,用於定位
spec:What state you desire for the object, a description of a object
Resource Object Types
| Category | Resource Object Type Name |
|---|---|
| Workload2 | Pod, HorizontalPodAutoscaler(HPA) |
| Controller | Deployment, ReplicaSet, ReplicationController, StatefulSet, DaemonSet, Job, CronJob |
| Service Discovery | Service, Ingress |
| Authentication & Authorization | ServiceAccount, RBAC(Role, ClusterRole, RoleBinding, ClusterRoleBinding) |
| Storage | Volume, PersistentVolume, PersistentVolumeClaim, StorageClass, Secret, ConfigMap |
| Policy | NetworkPolicy, SecurityContext, ResourceQuota, LimitRange |
| Extension | CustomResourceDefinitions |