Skip to content

Commit

Permalink
Just don't set the cluster CIDR on kube proxy right now
Browse files Browse the repository at this point in the history
  • Loading branch information
Ole Markus With committed Aug 6, 2021
1 parent 1e59840 commit a85095c
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions pkg/model/components/kubeproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,20 @@ func (b *KubeProxyOptionsBuilder) BuildOptions(o interface{}) error {
// * dns is set up by dns-controller
// * dns-controller talks to the API using the kube-proxy configured kubernetes service

if config.ClusterCIDR == "" {
// If we're using the AmazonVPC networking, we should omit the ClusterCIDR
// because pod IPs are real, routable IPs in the VPC, and they are not in a specific
// CIDR range that allows us to distinguish them from other IPs. Omitting the ClusterCIDR
// causes kube-proxy never to SNAT when proxying clusterIPs, which is the behavior
// we want for pods.
// If we're not using the AmazonVPC networking, and the KubeControllerMananger has
// a ClusterCIDR, use that because most networking plug ins draw pod IPs from this range.
if clusterSpec.Networking.AmazonVPC == nil && clusterSpec.KubeControllerManager != nil {
config.ClusterCIDR = clusterSpec.KubeControllerManager.ClusterCIDR
/*
if config.ClusterCIDR == "" {
// If we're using the AmazonVPC networking, we should omit the ClusterCIDR
// because pod IPs are real, routable IPs in the VPC, and they are not in a specific
// CIDR range that allows us to distinguish them from other IPs. Omitting the ClusterCIDR
// causes kube-proxy never to SNAT when proxying clusterIPs, which is the behavior
// we want for pods.
// If we're not using the AmazonVPC networking, and the KubeControllerMananger has
// a ClusterCIDR, use that because most networking plug ins draw pod IPs from this range.
if clusterSpec.Networking.AmazonVPC == nil && clusterSpec.KubeControllerManager != nil {
config.ClusterCIDR = clusterSpec.KubeControllerManager.ClusterCIDR
}
}
}
*/

// Set the kube-proxy hostname-override (actually the NodeName), to avoid #2915 et al
cloudProvider := kops.CloudProviderID(clusterSpec.CloudProvider)
Expand Down

0 comments on commit a85095c

Please sign in to comment.