no-jira: Allow CAPG to create firewall Rules#10318
no-jira: Allow CAPG to create firewall Rules#10318barbacbd wants to merge 4 commits intoopenshift:mainfrom
Conversation
|
/cc @patrickdillon |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
| if installConfig.Config.Publish == types.InternalPublishingStrategy { | ||
| healthCheckSrcRanges = append(healthCheckSrcRanges, []string{"209.85.152.0/22", "209.85.204.0/22"}...) | ||
| } |
There was a problem hiding this comment.
if installConfig.Config.Publish == types.InternalPublishingStrategy {
healthCheckSrcRanges = append(healthCheckSrcRanges,
[]string{"209.85.152.0/22", "209.85.204.0/22"}...)
}I think the condition should be installConfig.Config.Publish == types.ExternalPublishingStrategy since these 209.x.x.x/22 subnets are applicable to public clusters, right?
There was a problem hiding this comment.
nit: Can we use installConfig.Config.PublicAPI()?
There was a problem hiding this comment.
This is a case of don't fix what isn't broken. These were taken directly from the infrastructure creation.
There was a problem hiding this comment.
Sorry, but this part said health check IPs "209.85.152.0/22", "209.85.204.0/22" are for public install, right?
installer/pkg/infrastructure/gcp/clusterapi/firewallrules.go
Lines 249 to 253 in b0514c8
pkg/asset/manifests/gcp/cluster.go
Outdated
| Firewall: capg.FirewallSpec{ | ||
| DefaultRulesManagement: firewallRulesManagementPolicy, | ||
| FirewallSpec: capg.FirewallSpec{ | ||
| DefaultRulesManagement: capg.RulesManagementManaged, |
There was a problem hiding this comment.
We still need to consider user-provider options for rule management mode, right?
firewallRulesManagementPolicy := capg.RulesManagementManaged
if installConfig.Config.GCP.FirewallRulesManagement == gcp.UnmanagedFirewallRules {
firewallRulesManagementPolicy = capg.RulesManagementUnmanaged
}There was a problem hiding this comment.
Yes, this was just a proof on concept. It was more to assist getting the firewall rules merged in CAPG.
pkg/asset/manifests/gcp/cluster.go
Outdated
| firewallRules := createBootstrapFirewallRuleForCAPG(installConfig, clusterID) | ||
| firewallRules = append(firewallRules, createFirewallRulesForCAPG(installConfig, clusterID)...) |
There was a problem hiding this comment.
When the user defines platform.gcp.networkProjectID, we should use that project to create the firewall rules, right?
With the latest change, I don't see it being checked anyway... Maybe CAPG handles it?
There was a problem hiding this comment.
CAPG should handle this now. We attach the firewall rules spec to a network spec.
75c3fb8 to
ac0a050
Compare
…the changes to allow users to specify the firewall rules to be created by CAPG.
…o the top level vendor in the installer.
Migrated the creation of firewall rules to CAPG. These rules are now formed in the manifest and passed to CAPG for creation. pkg/infrastructure/gcp/clusterapi: Remove the creation of firewall rules.
ac0a050 to
8942e19
Compare
|
@barbacbd: This pull request explicitly references no jira issue. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/hold |
|
@barbacbd: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
| firewallRules = append(firewallRules, createBootstrapFirewallRuleForCAPG(installConfig, clusterID)...) | ||
| firewallRules = append(firewallRules, createFirewallRulesForCAPG(installConfig, clusterID)...) |
There was a problem hiding this comment.
Since CAPG manages the firewall rules now, I wonder how we should handle bootstrap firewall rule destroy...? Currently, we have below code in DestroyBootstrap phase.
installer/pkg/infrastructure/gcp/clusterapi/clusterapi.go
Lines 294 to 296 in b0514c8
My question is: will there a "fight" between the installer and CAPG? The installer deletes the firewall rule, but CAPG tries to re-create it as the rule is still defined in spec? If so, we should follow AWS here to edit the firewall rule spec and wait till its gone right?
*** Includes unmerged CAPG commits:
kubernetes-sigs/cluster-api-provider-gcp#1538
** Code Changes: