WorkloadEntry
- 為什麼需要WorkloadEntry CR?
- ·自v1.6開始,Istio在其流量管理功能組中引入了WorkloadEntry這一新的資源類型
- WorkloadEntry CR用于抽象非Kubernetes托管的工作負載,例如虛拟機(VM)執行個體和裸伺服器等,進而将虛拟機加入到網格中
- 于是,這些VM或裸伺服器,亦可作為與Kubernetes叢集上的Pod等同的工作負載,并具備流量管理、安全管理、可視化等能力
- ServiceEntry對象可根據指定的标簽器篩選VM,進而讓ServiceEntry專注于服務定義,而由WorkloadEntry負責定義各端點
- 是以:WorkloadEntry CR的引入,大大簡化了将VM加入Istio網格的複雜度
- Istio在其v1.8版本中對VM的支援有了進一步的增強
- VM自動注冊:使用WorkloadGroup CR,将VM執行個體自動注冊為Istio上的WorkloadEntry
- 智能DNS代理:使用Sidecar DNS Proxy,緩存網格中的endpoint,以及由ServiceEntry建立的endpoint
- 虛拟機通路網格内的服務無需再配置/etc/hosts
- 是以:WorkloadGroup和WorkloadEntry能夠友善使用者将虛拟機上的服務注冊到網格内
WorkloadEntry CR 資源規範

~# kubectl explain workloadgroup
KIND: WorkloadGroup
VERSION: networking.istio.io/v1beta1
DESCRIPTION:
<empty>
FIELDS:
apiVersion <string>
APIVersion defines the versioned schema of this representation of an
object. Servers should convert recognized schemas to the latest internal
value, and may reject unrecognized values. More info:
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
kind <string>
Kind is a string value representing the REST resource this object
represents. Servers may infer this from the endpoint the client submits
requests to. Cannot be updated. In CamelCase. More info:
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
metadata <Object>
Standard object's metadata. More info:
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
spec <Object>
status <>
~# kubectl explain workloadentry
KIND: WorkloadEntry
VERSION: networking.istio.io/v1beta1
DESCRIPTION:
<empty>
FIELDS:
apiVersion <string>
APIVersion defines the versioned schema of this representation of an
object. Servers should convert recognized schemas to the latest internal
value, and may reject unrecognized values. More info:
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
kind <string>
Kind is a string value representing the REST resource this object
represents. Servers may infer this from the endpoint the client submits
requests to. Cannot be updated. In CamelCase. More info:
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
metadata <Object>
Standard object's metadata. More info:
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
spec <Object>
Configuration affecting VMs onboarded into the mesh. See more details at:
https://istio.io/docs/reference/config/networking/workload-entry.html
status <>
參考文檔
workload-entry:https://istio.io/latest/docs/reference/config/networking/workload-entry/