Ingress
apiVersion: networking.k8s.io/v1
import "k8s.io/api/networking/v1"
Ingress
Ingress 是一組規則,允許入站連線到達由後端定義的端點。Ingress 可以配置為給服務提供外部可訪問的 URL、負載均衡流量、終止 SSL、提供基於名稱的虛擬主機等。
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata (ObjectMeta)
標準物件的元資料。更多資訊:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
spec (IngressSpec)
spec 是 Ingress 的期望狀態。更多資訊:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
status (IngressStatus)
status 是 Ingress 的當前狀態。更多資訊:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
IngressSpec
IngressSpec 描述了使用者希望存在的 Ingress。
defaultBackend (IngressBackend)
defaultBackend 是應處理不匹配任何規則的請求的後端。如果未指定 Rules,則必須指定 DefaultBackend。如果未設定 DefaultBackend,則對不匹配任何規則的請求的處理將由 Ingress 控制器負責。
ingressClassName (string)
ingressClassName 是 IngressClass 叢集資源的名稱。Ingress 控制器實現使用此欄位來了解它們是否應該服務此 Ingress 資源,透過傳遞性連線(控制器 -> IngressClass -> Ingress 資源)。儘管
kubernetes.io/ingress.class
註解(簡單的常量名稱)從未正式定義,但它得到了 Ingress 控制器的廣泛支援,用於在 Ingress 控制器和 Ingress 資源之間建立直接繫結。新建立的 Ingress 資源應優先使用此欄位。然而,即使該註解已被正式棄用,為了向後相容起見,Ingress 控制器仍應遵守該註解(如果存在)。rules ([]IngressRule)
原子性:在合併期間將被替換
rules 是用於配置 Ingress 的主機規則列表。如果未指定,或沒有規則匹配,所有流量都將傳送到預設後端。
IngressRule 表示將指定主機下的路徑對映到相關後端服務的規則。入站請求首先根據主機匹配進行評估,然後路由到與匹配的 IngressRuleValue 關聯的後端。
rules.host (string)
host 是網路主機的完全限定域名,如 RFC 3986 所定義。請注意以下與 RFC 3986 中 URI 的 "host" 部分的偏差:1. 不允許 IP 地址。目前 IngressRuleValue 只能應用於父 Ingress 的 Spec 中的 IP。2.
:
分隔符不被尊重,因為不允許埠。目前 Ingress 的埠對於 http 是隱式的 :80,對於 https 是 :443。這些在未來都可能改變。入站請求在 IngressRuleValue 之前與主機進行匹配。如果主機未指定,Ingress 將根據指定的 IngressRuleValue 路由所有流量。host 可以是“精確匹配”(precise),即不帶網路主機終止點的域名(例如,“foo.bar.com”),也可以是“萬用字元”(wildcard),即前面帶有單個萬用字元標籤的域名(例如,“*.foo.com”)。萬用字元字元 '*' 必須單獨出現在第一個 DNS 標籤中,並且只能匹配單個標籤。您不能單獨使用萬用字元標籤(例如,Host == "*")。請求將根據以下方式與 Host 欄位進行匹配:1. 如果 host 是精確匹配,當 http 主機頭與 Host 相同時,請求將匹配此規則。2. 如果 host 是萬用字元,當 http 主機頭等於萬用字元規則的字尾(刪除第一個標籤)時,請求將匹配此規則。
rules.http (HTTPIngressRuleValue)
HTTPIngressRuleValue 是指向後端的 http 選擇器列表。在示例中:http://
/ ? -> backend 其中 url 的部分對應於 RFC 3986,此資源將用於匹配最後一個 '/' 之後和第一個 '?' 或 '#' 之前的所有內容。 rules.http.paths ([]HTTPIngressPath), required
原子性:在合併期間將被替換
paths 是將請求對映到後端的路徑集合。
HTTPIngressPath 將一個路徑與一個後端相關聯。匹配路徑的入站 URL 將被轉發到後端。
rules.http.paths.backend (IngressBackend), required
backend 定義了流量將轉發到的服務端點。
rules.http.paths.pathType (string), required
pathType 確定路徑匹配的解釋。PathType 可以是以下值之一:* Exact:精確匹配 URL 路徑。* Prefix:基於以 '/' 分隔的 URL 路徑字首進行匹配。匹配是逐個路徑元素進行的。路徑元素是指透過 '/' 分隔符分割的路徑中的標籤列表。請求與路徑 p 匹配,如果 p 的每個元素都是請求路徑的 p 的元素級字首。請注意,如果路徑的最後一個元素是請求路徑最後一個元素的子串,則不匹配(例如,/foo/bar 匹配 /foo/bar/baz,但不匹配 /foo/barbaz)。
- ImplementationSpecific:路徑匹配的解釋取決於 IngressClass。實現可以將此視為獨立的 PathType,或將其與 Prefix 或 Exact 路徑型別相同處理。實現必須支援所有路徑型別。
rules.http.paths.path (string)
path 將與入站請求的路徑進行匹配。當前它可能包含 RFC 3986 中 URL 的常規“path”部分不允許的字元。路徑必須以 '/' 開頭,並且在使用 PathType 值為 "Exact" 或 "Prefix" 時必須存在。
tls ([]IngressTLS)
原子性:在合併期間將被替換
tls 表示 TLS 配置。目前 Ingress 只支援一個 TLS 埠,即 443。如果此列表的多個成員指定了不同的主機,它們將根據 SNI TLS 擴充套件指定的伺服器名稱在同一埠上進行多路複用,前提是滿足此 Ingress 的 Ingress 控制器支援 SNI。
IngressTLS 描述了與 ingress 相關的傳輸層安全性。
tls.hosts ([]string)
原子性:在合併期間將被替換
hosts 是 TLS 證書中包含的主機列表。此列表中的值必須與 tlsSecret 中使用的名稱/名稱匹配。如果未指定,則預設為實現此 Ingress 的負載均衡器控制器使用的萬用字元主機設定。
tls.secretName (string)
secretName 是用於在埠 443 上終止 TLS 流量的 Secret 的名稱。欄位是可選的,以允許僅基於 SNI 主機名進行 TLS 路由。如果監聽器中的 SNI 主機與 IngressRule 使用的 "Host" 頭欄位衝突,則 SNI 主機用於終止,而 "Host" 頭的值用於路由。
IngressBackend
IngressBackend 描述了給定服務和埠的所有端點。
resource (TypedLocalObjectReference)
resource 是 Ingress 物件名稱空間中另一個 Kubernetes 資源的 ObjectRef。如果指定了 resource,則不能同時指定 service.Name 和 service.Port。這是與 "Service" 互斥的設定。
service (IngressServiceBackend)
service 引用一個服務作為後端。這是與 "Resource" 互斥的設定。
IngressServiceBackend 引用一個 Kubernetes Service 作為 Backend。
service.name (string), required
name 是引用的服務。服務必須存在於與 Ingress 物件相同的名稱空間中。
service.port (ServiceBackendPort)
referenced service 的 port。IngressServiceBackend 需要一個埠名稱或埠號。
service.port.name (string)
name 是 Service 上埠的名稱。這是與 "Number" 互斥的設定。
service.port.number (int32)
number 是 Service 上的數值埠號(例如,80)。這是與 "Name" 互斥的設定。
IngressStatus
IngressStatus 描述了 Ingress 的當前狀態。
loadBalancer (IngressLoadBalancerStatus)
loadBalancer 包含負載均衡器的當前狀態。
IngressLoadBalancerStatus 表示負載均衡器的狀態。
loadBalancer.ingress ([]IngressLoadBalancerIngress)
原子性:在合併期間將被替換
ingress 是一個列表,包含負載均衡器的入口點。
IngressLoadBalancerIngress 表示負載均衡器入口點的狀態。
loadBalancer.ingress.hostname (string)
hostname 是為基於 DNS 的負載均衡器入口點設定的。
loadBalancer.ingress.ip (string)
ip 是為基於 IP 的負載均衡器入口點設定的。
loadBalancer.ingress.ports ([]IngressPortStatus)
原子性:在合併期間將被替換
ports 提供有關此 LoadBalancer 公開的埠的資訊。
loadBalancer.ingress.ports.port (int32), required
port 是入口埠的埠號。
loadBalancer.ingress.ports.protocol (string), required
protocol 是入口埠的協議。支援的值為:"TCP", "UDP", "SCTP"
loadBalancer.ingress.ports.error (string)
error 用於記錄服務埠的問題。錯誤的格式應符合以下規則:- 內建錯誤值應在此檔案中指定,並使用 CamelCase 名稱。
- 特定於雲提供商的錯誤值必須具有符合 foo.example.com/CamelCase 格式的名稱。
IngressList
IngressList 是 Ingress 的集合。
items ([]Ingress), required
items 是 Ingress 列表。
apiVersion (string)
APIVersion 定義了此物件表示形式的版本化模式。伺服器應將已識別的模式轉換為最新的內部值,並可能拒絕未識別的值。更多資訊:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
kind (string)
Kind 是一個字串值,表示此物件所代表的 REST 資源。伺服器可以從客戶端提交請求的端點推斷出此值。無法更新。採用 CamelCase。更多資訊:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
metadata (ListMeta)
標準物件的元資料。更多資訊:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
操作
get
讀取指定的 Ingress
HTTP 請求
GET /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}
引數
響應
200 (Ingress): OK
401: 未授權
get
讀取指定 Ingress 的狀態
HTTP 請求
GET /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status
引數
響應
200 (Ingress): OK
401: 未授權
list
列出或監視 Ingress 型別的物件
HTTP 請求
GET /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses
引數
namespace (在路徑中): string,必填
allowWatchBookmarks (在查詢中): boolean
continue (在查詢中): string
fieldSelector (在查詢中): string
labelSelector (在查詢中): string
limit (在查詢中): integer
pretty (在查詢中): string
resourceVersion (在查詢中): string
resourceVersionMatch (在查詢中): string
sendInitialEvents (在查詢中): boolean
timeoutSeconds (在查詢中): integer
watch (在查詢中): boolean
響應
200 (IngressList): OK
401: 未授權
list
列出或監視 Ingress 型別的物件
HTTP 請求
GET /apis/networking.k8s.io/v1/ingresses
引數
allowWatchBookmarks (在查詢中): boolean
continue (在查詢中): string
fieldSelector (在查詢中): string
labelSelector (在查詢中): string
limit (在查詢中): integer
pretty (在查詢中): string
resourceVersion (在查詢中): string
resourceVersionMatch (在查詢中): string
sendInitialEvents (在查詢中): boolean
timeoutSeconds (在查詢中): integer
watch (在查詢中): boolean
響應
200 (IngressList): OK
401: 未授權
create
建立一個 Ingress
HTTP 請求
POST /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses
引數
namespace (在路徑中): string,必填
body: Ingress, required
dryRun (在查詢中): string
fieldManager (在查詢中): string
fieldValidation (在查詢中): string
pretty (在查詢中): string
響應
200 (Ingress): OK
201 (Ingress): Created
202 (Ingress): Accepted
401: 未授權
update
替換指定的 Ingress
HTTP 請求
PUT /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}
引數
name (在路徑中): string,必填
Ingress 的名稱
namespace (在路徑中): string,必填
body: Ingress, required
dryRun (在查詢中): string
fieldManager (在查詢中): string
fieldValidation (在查詢中): string
pretty (在查詢中): string
響應
200 (Ingress): OK
201 (Ingress): Created
401: 未授權
update
替換指定 Ingress 的狀態
HTTP 請求
PUT /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status
引數
name (在路徑中): string,必填
Ingress 的名稱
namespace (在路徑中): string,必填
body: Ingress, required
dryRun (在查詢中): string
fieldManager (在查詢中): string
fieldValidation (在查詢中): string
pretty (在查詢中): string
響應
200 (Ingress): OK
201 (Ingress): Created
401: 未授權
patch
部分更新指定的 Ingress
HTTP 請求
PATCH /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}
引數
name (在路徑中): string,必填
Ingress 的名稱
namespace (在路徑中): string,必填
body: Patch,必需
dryRun (在查詢中): string
fieldManager (在查詢中): string
fieldValidation (在查詢中): string
force (在查詢中): boolean
pretty (在查詢中): string
響應
200 (Ingress): OK
201 (Ingress): Created
401: 未授權
patch
部分更新指定 Ingress 的狀態
HTTP 請求
PATCH /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status
引數
name (在路徑中): string,必填
Ingress 的名稱
namespace (在路徑中): string,必填
body: Patch,必需
dryRun (在查詢中): string
fieldManager (在查詢中): string
fieldValidation (在查詢中): string
force (在查詢中): boolean
pretty (在查詢中): string
響應
200 (Ingress): OK
201 (Ingress): Created
401: 未授權
delete
刪除一個 Ingress
HTTP 請求
DELETE /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}
引數
name (在路徑中): string,必填
Ingress 的名稱
namespace (在路徑中): string,必填
body: DeleteOptions
dryRun (在查詢中): string
gracePeriodSeconds (在查詢中): integer
ignoreStoreReadErrorWithClusterBreakingPotential (在查詢中): boolean
pretty (在查詢中): string
propagationPolicy (在查詢中): string
響應
200 (Status): OK
202 (Status): 已接受
401: 未授權
deletecollection
刪除 Ingress 集合
HTTP 請求
DELETE /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses
引數
namespace (在路徑中): string,必填
body: DeleteOptions
continue (在查詢中): string
dryRun (在查詢中): string
fieldSelector (在查詢中): string
gracePeriodSeconds (在查詢中): integer
ignoreStoreReadErrorWithClusterBreakingPotential (在查詢中): boolean
labelSelector (在查詢中): string
limit (在查詢中): integer
pretty (在查詢中): string
propagationPolicy (在查詢中): string
resourceVersion (在查詢中): string
resourceVersionMatch (在查詢中): string
sendInitialEvents (在查詢中): boolean
timeoutSeconds (在查詢中): integer
響應
200 (Status): OK
401: 未授權
本頁面是自動生成的。
如果你打算報告此頁面存在的問題,請在問題描述中提及此頁面是自動生成的。修復可能需要在 Kubernetes 專案的其他地方進行。