kubernetes-sigs/cluster-api

Add strict validation for CIDR ranges in the Cluster webhook

开放

#7,538 创建于 2022年11月14日

 (11 条评论) (0 个反应) (1 位负责人)Go (1,532 个派生)auto 404
area/apihelp wantedkind/api-changekind/featurepriority/backlogtriage/accepted

仓库指标

星标
 (4,267 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

Add a check in the Cluster webhook to ensure each CIDR block only contains valid CIDR blocks with the following rules:

  1. No more than two CIDR blocks are specified under Pods or Services
  2. If two are specified the blocks need to be from different IP families i.e. one IPv4 and one IPv6
  3. The IPFamily for pods and services must be compatible
  4. The CIDR ranges are valid CIDR ranges

This change ensures Clusters can not be created or updated with invalid CIDR blocks. This is the value that the Kubernetes control plane components take - e.g. the kube-apiserver flag --service-cluster-ip-range is documented:

A CIDR notation IP range from which to assign service cluster IPs. This must not overlap with any IP ranges assigned to nodes or pods. Max of two dual-stack CIDRs is allowed.

Related to: https://github.com/kubernetes-sigs/cluster-api/pull/7420

/kind feature /area api /kind api-change

贡献者指南