You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e8ac826
Browse filesBrowse the repository at this point in the historyBrowse files
CKS: open the cluster public IP on VPC tiers when the VPC has the Firewall service
Since #12706 a VPC offering can provide the Firewall service for public
IPs. The VPC virtual router then drops ingress traffic to a public IP
that has no firewall rule. CKS only created network ACL items, port
forwarding and the API load balancer rule on VPC tiers, so the
management server could not reach the nodes (SSH 2222+, API 6443), the
control node could not reach its own API through the public IP, and
cluster creation failed after the start timeout.
When the VPC virtual router provides the Firewall service of the
cluster's VPC (the check that sets vpc_firewall_enabled on the VR), CKS
now creates the same ingress firewall rules as on isolated networks on
create (including etcd nodes), scale and node add/remove. In a VPC the
firewall rules are created after the load balancing and port forwarding
rules: applying firewall rules on a VPC public IP does not associate the
IP with the VR, and if they come first the IP is never associated.
Firewall rules on VPC public IPs have no network_id, so per-node rules
are looked up by public IP and ports. On delete the rules go with the
release of the cluster public IP.
Isolated networks, VPCs without the Firewall service and the NSX/Netris
paths are unchanged.
Copy file name to clipboardExpand all lines: plugins/integrations/kubernetes-service/src/main/java/com/cloud/kubernetes/cluster/actionworkers/KubernetesClusterActionWorker.java
Copy file name to clipboardExpand all lines: plugins/integrations/kubernetes-service/src/main/java/com/cloud/kubernetes/cluster/actionworkers/KubernetesClusterAddWorker.java
Copy file name to clipboardExpand all lines: plugins/integrations/kubernetes-service/src/main/java/com/cloud/kubernetes/cluster/actionworkers/KubernetesClusterRemoveWorker.java
Copy file name to clipboardExpand all lines: plugins/integrations/kubernetes-service/src/main/java/com/cloud/kubernetes/cluster/actionworkers/KubernetesClusterResourceModifierActionWorker.java
thrownewManagementServerException(String.format("Failed to activate SSH port forwarding rules for the Kubernetes cluster : %s", kubernetesCluster.getName()), e);
834
831
}
832
+
833
+
// The VPC firewall drops traffic to the public IP unless a firewall rule allows it, open the
834
+
// API and SSH ports as for isolated networks. Create them after the load balancing and port
835
+
// forwarding rules: applying firewall rules on a VPC public IP does not associate the IP with
836
+
// the VPC virtual router, the first load balancing or port forwarding rule does.
Copy file name to clipboardExpand all lines: plugins/integrations/kubernetes-service/src/main/java/com/cloud/kubernetes/cluster/actionworkers/KubernetesClusterScaleWorker.java
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -173,6 +173,14 @@ private void scaleKubernetesClusterVpcTierRules(final List<Long> clusterVMIds) t
173
173
if (publicIp == null) {
174
174
thrownewManagementServerException(String.format("No public IP addresses found for VPC tier : %s, Kubernetes cluster : %s", network.getName(), kubernetesCluster.getName()));
thrownewManagementServerException(String.format("Failed to activate SSH port forwarding rules for the Kubernetes cluster : %s", kubernetesCluster.getName()), e);
186
194
}
195
+
if (vpcFirewallEnabled) {
196
+
// After the port forwarding rules, as when the cluster is created
Copy file name to clipboardExpand all lines: plugins/integrations/kubernetes-service/src/main/java/com/cloud/kubernetes/cluster/actionworkers/KubernetesClusterStartWorker.java
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -691,6 +691,14 @@ protected void setupKubernetesEtcdNetworkRules(List<UserVm> etcdVms, Network net
691
691
thrownewManagementServerException(String.format("Failed to provision firewall rules for etcd nodes for the Kubernetes cluster : %s", kubernetesCluster.getName()), e);
thrownewManagementServerException(String.format("Failed to provision firewall rules for etcd nodes for the Kubernetes cluster : %s", kubernetesCluster.getName()), e);
0 commit comments