website/content/zh-cn/docs/reference/kubernetes-api/cluster-resources/cluster-cidr-v1alpha1.md

22 KiB
Raw Blame History

api_metadata content_type description title weight
apiVersion import kind
networking.k8s.io/v1alpha1 k8s.io/api/networking/v1alpha1 ClusterCIDR
api_reference ClusterCIDR 表示启用 MultiCIDRRangeAllocator 时针对每个节点 Pod CIDR 分配进行的单个配置(参阅针对 kube-controller-manager 的配置)。 ClusterCIDR v1alpha1 11

apiVersion: networking.k8s.io/v1alpha1

import "k8s.io/api/networking/v1alpha1"

ClusterCIDR

ClusterCIDR 表示启用 MultiCIDRRangeAllocator 时针对每个节点 Pod CIDR 分配进行的单个配置 (参阅针对 kube-controller-manager 的配置)。 一个集群可能有任意数量的 ClusterCIDR 资源,在为节点分配 CIDR 时将考虑所有这些资源。 当节点选择算符与相关节点匹配并且有空闲 CIDR 可供分配时ClusterCIDR 才能有资格用于给定的节点。 在存在多个匹配的 ClusterCIDR 资源的情况下,分配器将尝试使用内部启发式算法来解决这一问题, 但可以使用节点选择算符与该节点匹配的任何 ClusterCIDR。


ClusterCIDRSpec

ClusterCIDRSpec 定义 ClusterCIDR 的预期状态。


  • perNodeHostBits (int32),必需

    perNodeHostBits 定义每个节点要配置的主机位数。 子网掩码决定有多少地址用于网络位和主机位。 例如 IPv4 地址 192.168.0.0/24 将该地址拆分为 24 位用于网络部分和 8 位用于主机部分。 要分配 256 个 IP需将此字段设置为 8针对 IPv4 的掩码为 /24针对 IPv6 的掩码为 /120。 最小值为 416 个 IP。此字段是不可变的。

  • ipv4 (string)

    ipv4 以 CIDR 表示法定义 IPv4 IP 块(例如 “10.0.0.0/8”。 必须至少指定 ipv4 和 ipv6 之一。该字段是不可变的。

  • ipv6 (string)

    ipv6 以 CIDR 表示法定义 IPv6 IP 块(例如 “2001:db8::/64”。 必须至少指定 ipv4 和 ipv6 之一。 该字段是不可变的。

  • nodeSelector (NodeSelector)

    nodeSelector 定义该配置适用于哪些节点。 空白或值为 nil 的 nodeSelector 选择所有节点。该字段是不可变的。

    节点选择算符表示在一组节点上一个或多个标签查询结果的并集; 也就是说,它表示由节点选择算符条件表示的选择算符的逻辑或计算结果。

    • nodeSelector.nodeSelectorTerms ([]NodeSelectorTerm),必需

      必需。节点选择算符条件的列表。这些条件以逻辑与进行计算。

      一个 null 或空的节点选择算符条件不会与任何对象匹配。这些要求会按逻辑与的关系来计算。 TopologySelectorTerm 类别实现了 NodeSelectorTerm 的子集。

      • nodeSelector.nodeSelectorTerms.matchExpressions ([]<a href="{{< ref "../common-definitions/node-selector-requirement#NodeSelectorRequirement" >}}">NodeSelectorRequirement)

        基于节点标签所设置的节点选择算符要求的列表。

      • nodeSelector.nodeSelectorTerms.matchFields ([]<a href="{{< ref "../common-definitions/node-selector-requirement#NodeSelectorRequirement" >}}">NodeSelectorRequirement)

        基于节点字段所设置的节点选择算符要求的列表。

ClusterCIDRList

ClusterCIDRList 包含 ClusterCIDR 的列表。


  • items ([]<a href="{{< ref "../cluster-resources/cluster-cidr-v1alpha1#ClusterCIDR" >}}">ClusterCIDR),必需

    items 是 ClusterCIDRs 的列表。

操作


get 读取指定的 ClusterCIDR

HTTP 请求

GET /apis/networking.k8s.io/v1alpha1/clustercidrs/{name}

参数

  • name (路径参数)string必需

    ClusterCIDR 的名称

  • pretty (查询参数)string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

响应

200 (<a href="{{< ref "../cluster-resources/cluster-cidr-v1alpha1#ClusterCIDR" >}}">ClusterCIDR): OK

401: Unauthorized

list 列出或监视 ClusterCIDR 类别的对象

HTTP 请求

GET /apis/networking.k8s.io/v1alpha1/clustercidrs

参数

  • allowWatchBookmarks (查询参数)boolean

    <a href="{{< ref "../common-parameters/common-parameters#allowWatchBookmarks" >}}">allowWatchBookmarks

  • continue (查询参数)string

    <a href="{{< ref "../common-parameters/common-parameters#continue" >}}">continue

  • fieldSelector (查询参数)string

    <a href="{{< ref "../common-parameters/common-parameters#fieldSelector" >}}">fieldSelector

  • labelSelector (查询参数)string

    <a href="{{< ref "../common-parameters/common-parameters#labelSelector" >}}">labelSelector

  • limit (查询参数)integer

    <a href="{{< ref "../common-parameters/common-parameters#limit" >}}">limit

  • pretty (查询参数)string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

  • resourceVersion (查询参数)string

    <a href="{{< ref "../common-parameters/common-parameters#resourceVersion" >}}">resourceVersion

  • resourceVersionMatch (查询参数)string

    <a href="{{< ref "../common-parameters/common-parameters#resourceVersionMatch" >}}">resourceVersionMatch

  • sendInitialEvents (查询参数)boolean

    <a href="{{< ref "../common-parameters/common-parameters#sendInitialEvents" >}}">sendInitialEvents

  • timeoutSeconds (查询参数)integer

    <a href="{{< ref "../common-parameters/common-parameters#timeoutSeconds" >}}">timeoutSeconds

  • watch (查询参数)boolean

    <a href="{{< ref "../common-parameters/common-parameters#watch" >}}">watch

响应

200 (<a href="{{< ref "../cluster-resources/cluster-cidr-v1alpha1#ClusterCIDRList" >}}">ClusterCIDRList): OK

401: Unauthorized

create 创建 ClusterCIDR

HTTP 请求

POST /apis/networking.k8s.io/v1alpha1/clustercidrs

参数

  • body: <a href="{{< ref "../cluster-resources/cluster-cidr-v1alpha1#ClusterCIDR" >}}">ClusterCIDR必需

  • dryRun (查询参数)string

    <a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun

  • fieldManager (查询参数)string

    <a href="{{< ref "../common-parameters/common-parameters#fieldManager" >}}">fieldManager

  • fieldValidation (查询参数)string

    <a href="{{< ref "../common-parameters/common-parameters#fieldValidation" >}}">fieldValidation

  • pretty (查询参数)string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

响应

200 (<a href="{{< ref "../cluster-resources/cluster-cidr-v1alpha1#ClusterCIDR" >}}">ClusterCIDR): OK

201 (<a href="{{< ref "../cluster-resources/cluster-cidr-v1alpha1#ClusterCIDR" >}}">ClusterCIDR): Created

202 (<a href="{{< ref "../cluster-resources/cluster-cidr-v1alpha1#ClusterCIDR" >}}">ClusterCIDR): Accepted

401: Unauthorized

update 替换指定的 ClusterCIDR

HTTP 请求

PUT /apis/networking.k8s.io/v1alpha1/clustercidrs/{name}

参数

  • name (路径参数)string必需

    ClusterCIDR 的名称

  • body: <a href="{{< ref "../cluster-resources/cluster-cidr-v1alpha1#ClusterCIDR" >}}">ClusterCIDR必需

  • dryRun (查询参数)string

    <a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun

  • fieldManager (查询参数)string

    <a href="{{< ref "../common-parameters/common-parameters#fieldManager" >}}">fieldManager

  • fieldValidation (查询参数)string

    <a href="{{< ref "../common-parameters/common-parameters#fieldValidation" >}}">fieldValidation

  • pretty (查询参数)string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

响应

200 (<a href="{{< ref "../cluster-resources/cluster-cidr-v1alpha1#ClusterCIDR" >}}">ClusterCIDR): OK

201 (<a href="{{< ref "../cluster-resources/cluster-cidr-v1alpha1#ClusterCIDR" >}}">ClusterCIDR): Created

401: Unauthorized

patch 部分更新指定的 ClusterCIDR

HTTP 请求

PATCH /apis/networking.k8s.io/v1alpha1/clustercidrs/{name}

参数

  • name (路径参数)string必需

    ClusterCIDR 的名称

  • body: <a href="{{< ref "../common-definitions/patch#Patch" >}}">Patch必需

  • dryRun (查询参数)string

    <a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun

  • fieldManager (查询参数)string

    <a href="{{< ref "../common-parameters/common-parameters#fieldManager" >}}">fieldManager

  • fieldValidation (查询参数)string

    <a href="{{< ref "../common-parameters/common-parameters#fieldValidation" >}}">fieldValidation

  • force (查询参数)boolean

    <a href="{{< ref "../common-parameters/common-parameters#force" >}}">force

  • pretty (查询参数)string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

响应

200 (<a href="{{< ref "../cluster-resources/cluster-cidr-v1alpha1#ClusterCIDR" >}}">ClusterCIDR): OK

201 (<a href="{{< ref "../cluster-resources/cluster-cidr-v1alpha1#ClusterCIDR" >}}">ClusterCIDR): Created

401: Unauthorized

delete 删除 ClusterCIDR

HTTP 请求

DELETE /apis/networking.k8s.io/v1alpha1/clustercidrs/{name}

参数

  • name (路径参数)string必需

    ClusterCIDR 的名称

  • body: <a href="{{< ref "../common-definitions/delete-options#DeleteOptions" >}}">DeleteOptions

  • dryRun (查询参数)string

    <a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun

  • gracePeriodSeconds (查询参数)integer

    <a href="{{< ref "../common-parameters/common-parameters#gracePeriodSeconds" >}}">gracePeriodSeconds

  • pretty (查询参数)string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

  • propagationPolicy (查询参数)string

    <a href="{{< ref "../common-parameters/common-parameters#propagationPolicy" >}}">propagationPolicy

响应

200 (<a href="{{< ref "../common-definitions/status#Status" >}}">Status): OK

202 (<a href="{{< ref "../common-definitions/status#Status" >}}">Status): Accepted

401: Unauthorized

deletecollection 删除 ClusterCIDR 的集合

HTTP 请求

DELETE /apis/networking.k8s.io/v1alpha1/clustercidrs

参数

  • body: <a href="{{< ref "../common-definitions/delete-options#DeleteOptions" >}}">DeleteOptions

  • continue (查询参数)string

    <a href="{{< ref "../common-parameters/common-parameters#continue" >}}">continue

  • dryRun (查询参数)string

    <a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun

  • fieldSelector (查询参数)string

    <a href="{{< ref "../common-parameters/common-parameters#fieldSelector" >}}">fieldSelector

  • gracePeriodSeconds (查询参数)integer

    <a href="{{< ref "../common-parameters/common-parameters#gracePeriodSeconds" >}}">gracePeriodSeconds

  • labelSelector (查询参数)string

    <a href="{{< ref "../common-parameters/common-parameters#labelSelector" >}}">labelSelector

  • limit (查询参数)integer

    <a href="{{< ref "../common-parameters/common-parameters#limit" >}}">limit

  • pretty (查询参数)string

    <a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty

  • propagationPolicy (查询参数)string

    <a href="{{< ref "../common-parameters/common-parameters#propagationPolicy" >}}">propagationPolicy

  • resourceVersion (查询参数)string

    <a href="{{< ref "../common-parameters/common-parameters#resourceVersion" >}}">resourceVersion

  • resourceVersionMatch (查询参数)string

    <a href="{{< ref "../common-parameters/common-parameters#resourceVersionMatch" >}}">resourceVersionMatch

  • sendInitialEvents (查询参数)boolean

    <a href="{{< ref "../common-parameters/common-parameters#sendInitialEvents" >}}">sendInitialEvents

  • timeoutSeconds (查询参数)integer

    <a href="{{< ref "../common-parameters/common-parameters#timeoutSeconds" >}}">timeoutSeconds

响应

200 (<a href="{{< ref "../common-definitions/status#Status" >}}">Status): OK

401: Unauthorized