Node
apiVersion: v1
import "k8s.io/api/core/v1"
Node
節點是 Kubernetes 中的工作節點。每個節點在快取(即 etcd 中)都會有一個獨特的識別碼。
apiVersion: v1
kind: Node
metadata (ObjectMeta)
標準物件的中繼資料。更多資訊: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
spec (NodeSpec)
Spec 定義節點的行為。https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
status (NodeStatus)
節點最近觀察到的狀態。由系統填入。唯讀。更多資訊: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
NodeSpec
NodeSpec 描述建立節點時使用的屬性。
configSource (NodeConfigSource)
已棄用:先前用於指定節點組態的來源,適用於 DynamicKubeletConfig 功能。此功能已移除。
NodeConfigSource 指定節點組態的來源。必須只有一個子欄位(排除中繼資料)為非空值。此 API 自 1.22 版起已棄用
configSource.configMap (ConfigMapNodeConfigSource)
ConfigMap 是對節點 ConfigMap 的參考
ConfigMapNodeConfigSource 包含參考 ConfigMap 作為節點組態來源的資訊。此 API 自 1.22 版起已棄用: https://git.k8s.io/enhancements/keps/sig-node/281-dynamic-kubelet-configuration
configSource.configMap.kubeletConfigKey (string), 必要
KubeletConfigKey 宣告參考的 ConfigMap 的哪個鍵對應到 KubeletConfiguration 結構。在所有情況下,此欄位都是必要的。
configSource.configMap.name (string), 必要
Name 是參考的 ConfigMap 的 metadata.name。在所有情況下,此欄位都是必要的。
configSource.configMap.namespace (string), 必要
命名空間是參照 ConfigMap 的 metadata.namespace。在所有情況下,此欄位為必填。
configSource.configMap.resourceVersion (字串)
ResourceVersion 是參照 ConfigMap 的 metadata.ResourceVersion。Node.Spec 禁止使用此欄位,Node.Status 則為必填。
configSource.configMap.uid (字串)
UID 是參照 ConfigMap 的 metadata.UID。Node.Spec 禁止使用此欄位,Node.Status 則為必填。
externalID (字串)
已棄用。並非所有 kubelet 都會設定此欄位。請在 1.13 版之後移除此欄位。請參閱:https://issues.k8s.io/61966
podCIDR (字串)
PodCIDR 代表指派給節點的 pod IP 範圍。
podCIDRs ([]字串)
設定:合併期間將保留唯一值
podCIDRs 代表指派給節點的 IP 範圍,供該節點上的 Pod 使用。如果指定此欄位,則第 0 個項目必須與 podCIDR 欄位相符。針對 IPv4 和 IPv6,每個最多可包含 1 個值。
providerID (字串)
雲端供應商指派的節點 ID,格式為:<ProviderName>://<ProviderSpecificNodeID>
taints ([]Taint)
原子性:將在合併期間被取代
如果指定,則為節點的污點。
unschedulable (布林值)
Unschedulable 控制新 pod 的節點可調度性。預設情況下,節點是可調度的。更多資訊:https://kubernetes.dev.org.tw/docs/concepts/nodes/node/#manual-node-administration
NodeStatus
NodeStatus 是關於節點目前狀態的資訊。
addresses ([]NodeAddress)
修補策略:依鍵
type
合併Map:依鍵類型合併期間將保留唯一值
可連線到節點的位址清單。如果可用,則從雲端供應商查詢。更多資訊:https://kubernetes.dev.org.tw/docs/concepts/nodes/node/#addresses 注意:此欄位宣告為可合併,但合併鍵不夠唯一,這可能會在合併時導致資料損毀。呼叫者應改為使用完整取代修補。請參閱 https://pr.k8s.io/79391 以取得範例。消費者應假設位址可能會在 Node 的生命週期中變更。但是,在某些例外情況下,這可能無法實現,例如 Pod 在其自身狀態中繼承 Node 位址,或 downward API (status.hostIP) 的消費者。
addresses.address (字串),必填
節點位址。
addresses.type (字串),必填
節點位址類型,Hostname、ExternalIP 或 InternalIP 其中之一。
allocatable (map[字串]Quantity)
Allocatable 代表節點上可用於調度的資源。預設為 Capacity。
capacity (map[字串]Quantity)
Capacity 代表節點的總資源。更多資訊:https://kubernetes.dev.org.tw/docs/reference/node/node-status/#capacity
conditions ([]NodeCondition)
修補策略:依鍵
type
合併Map:依鍵類型合併期間將保留唯一值
Conditions 是目前觀察到的節點狀況陣列。更多資訊:https://kubernetes.dev.org.tw/docs/concepts/nodes/node/#condition
conditions.status (字串),必填
狀況的狀態,True、False、Unknown 其中之一。
conditions.type (字串),必填
節點狀況類型。
conditions.lastHeartbeatTime (Time)
上次取得給定狀況更新的時間。
Time 是 time.Time 的包裝器,支援正確地封送處理為 YAML 和 JSON。為 time 套件提供的許多 factory 方法提供包裝器。
conditions.lastTransitionTime (Time)
狀況上次從一種狀態轉換到另一種狀態的時間。
Time 是 time.Time 的包裝器,支援正確地封送處理為 YAML 和 JSON。為 time 套件提供的許多 factory 方法提供包裝器。
conditions.message (字串)
人類可讀取的訊息,指示上次轉換的詳細資訊。
conditions.reason (字串)
狀況上次轉換的(簡短)原因。
config (NodeConfigStatus)
透過動態 Kubelet 設定功能指派給節點的設定狀態。
NodeConfigStatus 描述 Node.Spec.ConfigSource 指派的設定狀態。
config.active (NodeConfigSource)
Active 報告節點正在主動使用的已檢查點設定。Active 將代表 Assigned 設定的目前版本,或目前 LastKnownGood 設定,具體取決於嘗試使用 Assigned 設定是否導致錯誤。
NodeConfigSource 指定節點組態的來源。必須只有一個子欄位(排除中繼資料)為非空值。此 API 自 1.22 版起已棄用
config.active.configMap (ConfigMapNodeConfigSource)
ConfigMap 是對節點 ConfigMap 的參考
ConfigMapNodeConfigSource 包含參考 ConfigMap 作為節點組態來源的資訊。此 API 自 1.22 版起已棄用: https://git.k8s.io/enhancements/keps/sig-node/281-dynamic-kubelet-configuration
config.active.configMap.kubeletConfigKey (字串),必填
KubeletConfigKey 宣告參考的 ConfigMap 的哪個鍵對應到 KubeletConfiguration 結構。在所有情況下,此欄位都是必要的。
config.active.configMap.name (字串),必填
Name 是參考的 ConfigMap 的 metadata.name。在所有情況下,此欄位都是必要的。
config.active.configMap.namespace (字串),必填
命名空間是參照 ConfigMap 的 metadata.namespace。在所有情況下,此欄位為必填。
config.active.configMap.resourceVersion (字串)
ResourceVersion 是參照 ConfigMap 的 metadata.ResourceVersion。Node.Spec 禁止使用此欄位,Node.Status 則為必填。
config.active.configMap.uid (字串)
UID 是參照 ConfigMap 的 metadata.UID。Node.Spec 禁止使用此欄位,Node.Status 則為必填。
config.assigned (NodeConfigSource)
Assigned 報告節點將嘗試使用的已檢查點設定。當 Node.Spec.ConfigSource 更新時,節點會將相關的設定酬載檢查點到本機磁碟,以及指示預期設定的記錄。節點參考此記錄來選擇其設定檢查點,並在 Assigned 中報告此記錄。Assigned 僅在記錄已檢查點到磁碟後才在狀態中更新。當 Kubelet 重新啟動時,它會嘗試透過載入和驗證 Assigned 所識別的已檢查點酬載,使 Assigned 設定成為 Active 設定。
NodeConfigSource 指定節點組態的來源。必須只有一個子欄位(排除中繼資料)為非空值。此 API 自 1.22 版起已棄用
config.assigned.configMap (ConfigMapNodeConfigSource)
ConfigMap 是對節點 ConfigMap 的參考
ConfigMapNodeConfigSource 包含參考 ConfigMap 作為節點組態來源的資訊。此 API 自 1.22 版起已棄用: https://git.k8s.io/enhancements/keps/sig-node/281-dynamic-kubelet-configuration
config.assigned.configMap.kubeletConfigKey (字串),必填
KubeletConfigKey 宣告參考的 ConfigMap 的哪個鍵對應到 KubeletConfiguration 結構。在所有情況下,此欄位都是必要的。
config.assigned.configMap.name (字串),必填
Name 是參考的 ConfigMap 的 metadata.name。在所有情況下,此欄位都是必要的。
config.assigned.configMap.namespace (字串),必填
命名空間是參照 ConfigMap 的 metadata.namespace。在所有情況下,此欄位為必填。
config.assigned.configMap.resourceVersion (字串)
ResourceVersion 是參照 ConfigMap 的 metadata.ResourceVersion。Node.Spec 禁止使用此欄位,Node.Status 則為必填。
config.assigned.configMap.uid (字串)
UID 是參照 ConfigMap 的 metadata.UID。Node.Spec 禁止使用此欄位,Node.Status 則為必填。
config.error (字串)
Error 描述將 Spec.ConfigSource 與 Active 設定協調的任何問題。例如,嘗試將 Spec.ConfigSource 檢查點到本機 Assigned 記錄、嘗試將與 Spec.ConfigSource 相關聯的酬載檢查點、嘗試載入或驗證 Assigned 設定等,都可能發生錯誤。同步設定時,可能會在不同時間點發生錯誤。較早的錯誤(例如下載或檢查點錯誤)不會導致回滾到 LastKnownGood,並且可能會在 Kubelet 重試後解決。較晚的錯誤(例如載入或驗證已檢查點設定)將導致回滾到 LastKnownGood。在後一種情況下,通常可以透過修正 Spec.ConfigSource 中指派的設定來解決錯誤。您可以透過在 Kubelet 日誌中搜尋錯誤訊息來找到用於偵錯的其他資訊。Error 是錯誤狀態的人類可讀取描述;機器可以檢查 Error 是否為空,但不應依賴跨 Kubelet 版本的 Error 文字穩定性。
config.lastKnownGood (NodeConfigSource)
LastKnownGood 報告當節點遇到嘗試使用 Assigned 設定時發生錯誤時,將回退到的已檢查點設定。當節點判斷 Assigned 設定穩定且正確時,Assigned 設定會變成 LastKnownGood 設定。目前,這實作為 10 分鐘的浸泡期,從更新 Assigned 設定的本機記錄時開始。如果 Assigned 設定在此期間結束時處於 Active 狀態,則它會變成 LastKnownGood。請注意,如果 Spec.ConfigSource 重設為 nil(使用本機預設值),則 LastKnownGood 也會立即重設為 nil,因為本機預設設定始終被視為良好。您不應對節點判斷設定穩定性和正確性的方法做出假設,因為這可能會在未來變更或變成可設定的。
NodeConfigSource 指定節點組態的來源。必須只有一個子欄位(排除中繼資料)為非空值。此 API 自 1.22 版起已棄用
config.lastKnownGood.configMap (ConfigMapNodeConfigSource)
ConfigMap 是對節點 ConfigMap 的參考
ConfigMapNodeConfigSource 包含參考 ConfigMap 作為節點組態來源的資訊。此 API 自 1.22 版起已棄用: https://git.k8s.io/enhancements/keps/sig-node/281-dynamic-kubelet-configuration
config.lastKnownGood.configMap.kubeletConfigKey (字串),必填
KubeletConfigKey 宣告參考的 ConfigMap 的哪個鍵對應到 KubeletConfiguration 結構。在所有情況下,此欄位都是必要的。
config.lastKnownGood.configMap.name (字串),必填
Name 是參考的 ConfigMap 的 metadata.name。在所有情況下,此欄位都是必要的。
config.lastKnownGood.configMap.namespace (字串),必填
命名空間是參照 ConfigMap 的 metadata.namespace。在所有情況下,此欄位為必填。
config.lastKnownGood.configMap.resourceVersion (字串)
ResourceVersion 是參照 ConfigMap 的 metadata.ResourceVersion。Node.Spec 禁止使用此欄位,Node.Status 則為必填。
config.lastKnownGood.configMap.uid (字串)
UID 是參照 ConfigMap 的 metadata.UID。Node.Spec 禁止使用此欄位,Node.Status 則為必填。
daemonEndpoints (NodeDaemonEndpoints)
在節點上執行的守護程式端點。
features (NodeFeatures)
Features 描述 CRI 實作所實作的功能集。
NodeFeatures 描述 CRI 實作所實作的功能集。NodeFeatures 中包含的功能應僅取決於 cri 實作,而與執行階段處理常式無關。
features.supplementalGroupsPolicy (布林值)
如果執行階段支援 SupplementalGroupsPolicy 和 ContainerUser,則 SupplementalGroupsPolicy 設定為 true。
images ([]ContainerImage)
原子性:將在合併期間被取代
此節點上的容器映像清單
images.names ([]字串)
原子性:將在合併期間被取代
此映像的已知名稱。例如 ["kubernetes.example/hyperkube:v1.0.7", "cloud-vendor.registry.example/cloud-vendor/hyperkube:v1.0.7"]
images.sizeBytes (int64)
映像的大小,以位元組為單位。
nodeInfo (NodeSystemInfo)
用於唯一識別節點的 ID/UUID 集。更多資訊:https://kubernetes.dev.org.tw/docs/concepts/nodes/node/#info
NodeSystemInfo 是用於唯一識別節點的 ID/UUID 集。
nodeInfo.architecture (字串),必填
節點報告的架構
nodeInfo.bootID (字串),必填
節點報告的開機 ID。
nodeInfo.containerRuntimeVersion (字串),必填
節點透過執行階段遠端 API 報告的 ContainerRuntime 版本(例如 containerd://1.4.2)。
nodeInfo.kernelVersion (字串),必填
節點從 'uname -r' 報告的核心版本(例如 3.16.0-0.bpo.4-amd64)。
nodeInfo.kubeProxyVersion (字串),必填
已棄用:節點報告的 KubeProxy 版本。
nodeInfo.kubeletVersion (字串),必填
節點報告的 Kubelet 版本。
nodeInfo.machineID (字串),必填
節點報告的 MachineID。為了在叢集中唯一識別機器,此欄位是首選。從 man(5) machine-id 了解更多資訊:http://man7.org/linux/man-pages/man5/machine-id.5.html
nodeInfo.operatingSystem (字串),必填
節點報告的作業系統
nodeInfo.osImage (字串),必填
節點從 /etc/os-release 報告的 OS 映像(例如 Debian GNU/Linux 7 (wheezy))。
nodeInfo.systemUUID (字串),必填
節點報告的 SystemUUID。為了唯一識別機器,MachineID 是首選。此欄位特定於 Red Hat 主機 https://access.redhat.com/documentation/en-us/red_hat_subscription_management/1/html/rhsm/uuid
phase (字串)
NodePhase 是最近觀察到的節點生命週期階段。更多資訊:https://kubernetes.dev.org.tw/docs/concepts/nodes/node/#phase 此欄位永遠不會被填入,現在已棄用。
runtimeHandlers ([]NodeRuntimeHandler)
原子性:將在合併期間被取代
可用的執行階段處理常式。
NodeRuntimeHandler 是一組執行階段處理常式資訊。
runtimeHandlers.features (NodeRuntimeHandlerFeatures)
支援的功能。
NodeRuntimeHandlerFeatures 是一組執行階段處理常式實作的功能。
runtimeHandlers.features.recursiveReadOnlyMounts (布林值)
如果執行階段處理常式支援 RecursiveReadOnlyMounts,則 RecursiveReadOnlyMounts 設定為 true。
runtimeHandlers.features.userNamespaces (布林值)
如果執行階段處理常式支援 UserNamespaces(包括用於磁碟區),則 UserNamespaces 設定為 true。
runtimeHandlers.name (字串)
執行階段處理常式名稱。預設執行階段處理常式為空。
volumesAttached ([]AttachedVolume)
原子性:將在合併期間被取代
已連接到節點的磁碟區清單。
volumesAttached.devicePath (字串),必填
DevicePath 代表磁碟區應可用的裝置路徑
volumesAttached.name (字串),必填
已連接磁碟區的名稱
volumesInUse ([]字串)
原子性:將在合併期間被取代
節點正在使用(已掛載)的可連接磁碟區清單。
NodeList
NodeList 是已向 master 註冊的所有節點的完整清單。
apiVersion: v1
kind: NodeList
metadata (ListMeta)
標準清單 metadata。更多資訊:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
items ([]Node),必填
節點清單
Operations
get
讀取指定的節點
HTTP Request
GET /api/v1/nodes/{name}
Parameters
name (in path): 字串,必填
節點名稱
pretty (in query): 字串
Response
200 (Node):OK
401: Unauthorized
get
讀取指定節點的狀態
HTTP Request
GET /api/v1/nodes/{name}/status
Parameters
name (in path): 字串,必填
節點名稱
pretty (in query): 字串
Response
200 (Node):OK
401: Unauthorized
list
列出或監看種類為 Node 的物件
HTTP Request
GET /api/v1/nodes
Parameters
allowWatchBookmarks (in query): 布林值
continue (in query): 字串
fieldSelector (in query): 字串
labelSelector (in query): 字串
limit (in query): 整數
pretty (in query): 字串
resourceVersion (in query): 字串
resourceVersionMatch (in query): 字串
sendInitialEvents (in query): 布林值
timeoutSeconds (in query): 整數
watch (in query): 布林值
Response
200 (NodeList): 成功 (OK)
401: Unauthorized
create
建立 Node
HTTP Request
POST /api/v1/nodes
Parameters
body: Node, 必填
dryRun (查詢參數): 字串
fieldManager (查詢參數): 字串
fieldValidation (查詢參數): 字串
pretty (in query): 字串
Response
200 (Node):OK
201 (Node): 已建立 (Created)
202 (Node): 已接受 (Accepted)
401: Unauthorized
update
取代指定的 Node
HTTP Request
PUT /api/v1/nodes/{name}
Parameters
name (in path): 字串,必填
節點名稱
body: Node, 必填
dryRun (查詢參數): 字串
fieldManager (查詢參數): 字串
fieldValidation (查詢參數): 字串
pretty (in query): 字串
Response
200 (Node):OK
201 (Node): 已建立 (Created)
401: Unauthorized
update
取代指定 Node 的狀態
HTTP Request
PUT /api/v1/nodes/{name}/status
Parameters
name (in path): 字串,必填
節點名稱
body: Node, 必填
dryRun (查詢參數): 字串
fieldManager (查詢參數): 字串
fieldValidation (查詢參數): 字串
pretty (in query): 字串
Response
200 (Node):OK
201 (Node): 已建立 (Created)
401: Unauthorized
patch
部分更新指定的 Node
HTTP Request
PATCH /api/v1/nodes/{name}
Parameters
name (in path): 字串,必填
節點名稱
body: Patch, 必填
dryRun (查詢參數): 字串
fieldManager (查詢參數): 字串
fieldValidation (查詢參數): 字串
force (查詢參數): 布林值
pretty (in query): 字串
Response
200 (Node):OK
201 (Node): 已建立 (Created)
401: Unauthorized
patch
部分更新指定 Node 的狀態
HTTP Request
PATCH /api/v1/nodes/{name}/status
Parameters
name (in path): 字串,必填
節點名稱
body: Patch, 必填
dryRun (查詢參數): 字串
fieldManager (查詢參數): 字串
fieldValidation (查詢參數): 字串
force (查詢參數): 布林值
pretty (in query): 字串
Response
200 (Node):OK
201 (Node): 已建立 (Created)
401: Unauthorized
delete
刪除 Node
HTTP Request
DELETE /api/v1/nodes/{name}
Parameters
name (in path): 字串,必填
節點名稱
body: DeleteOptions
dryRun (查詢參數): 字串
gracePeriodSeconds (查詢參數): 整數
pretty (in query): 字串
propagationPolicy (查詢參數): 字串
Response
200 (Status): 成功 (OK)
202 (Status): 已接受 (Accepted)
401: Unauthorized
deletecollection
刪除 Node 集合
HTTP Request
DELETE /api/v1/nodes
Parameters
body: DeleteOptions
continue (in query): 字串
dryRun (查詢參數): 字串
fieldSelector (in query): 字串
gracePeriodSeconds (查詢參數): 整數
labelSelector (in query): 字串
limit (in query): 整數
pretty (in query): 字串
propagationPolicy (查詢參數): 字串
resourceVersion (in query): 字串
resourceVersionMatch (in query): 字串
sendInitialEvents (in query): 布林值
timeoutSeconds (in query): 整數
Response
200 (Status): 成功 (OK)
401: Unauthorized
此頁面為自動產生。
如果您計劃回報此頁面的問題,請在您的問題描述中提及此頁面為自動產生。此修復可能需要在 Kubernetes 專案的其他地方進行。