Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure RG/Vnet RG Security Group different behaviour Frontend & Backend #13068

Open
4ch3los opened this issue Feb 9, 2024 · 1 comment
Open
Assignees
Labels
customer-request kind/bug Categorizes issue or PR as related to a bug. sig/cluster-management Denotes a PR or issue as being assigned to SIG Cluster Management.
Milestone

Comments

@4ch3los
Copy link

4ch3los commented Feb 9, 2024

What happened?

When trying to create a cluster in azure, you have the option to provide a general resource group and a VNet resource group. This seems to be implemented totally fine, except for the security group.
The ui fetches the already available security groups (and everything else) from the vnet rg and provides them as option in the dropdown. (https://github.com/kubermatic/dashboard/blob/main/modules/web/src/app/wizard/step/provider-settings/provider/extended/azure/component.ts#L352 & https://github.com/kubermatic/dashboard/blob/main/modules/web/src/app/wizard/step/provider-settings/provider/extended/azure/component.ts#L257)

The Backend Reconciler however, tries to fetch the provided security group or would create a new one in the general resource group.
https://github.com/kubermatic/kubermatic/blob/main/pkg/provider/cloud/azure/security_group.go#L44

The issue generally affects usecases where network infrastructure is already present and the resource names provided during the cluster creation.
But it is still possible to create a cluster by entering the nsg name manually.

Expected behavior

Fetch the nsgs as option in the ui, which will also be useable in Backend.
This could either be the nsgs from the general resource group(no backwards compatibility issues),
the nsgs from the vnet rg(would be breaking for existing setups)
or an option to use both setup for best compatibility, with the general rg as default.

How to reproduce the issue?

Try to create a azure cluster with 2 resource groups(one for networking & one for compute)

  • nsg in networking rg -> cluster reconcile will fail, but dropdown in ui will contain nsg
  • nsg in compute rg -> cluster will build successfully, ui does not provide nsg via dropdown

How is your environment configured?

  • KKP version: 2.24.2
  • Shared or separate master/seed clusters?: separate clusters

What cloud provider are you running on?

Azure

What operating system are you running in your user cluster?

flatcar

Additional information

After separating the nsg and the snet to two different resource groups, we had the realization that this setup makes configuring the permissions for the app registration way easier. So definitely not just more complexity, but also some benefits.

I would be happy to open a pr with a fix, but i need a decision about the desired behaviour.

@4ch3los 4ch3los added the kind/bug Categorizes issue or PR as related to a bug. label Feb 9, 2024
@embik embik added sig/cluster-management Denotes a PR or issue as being assigned to SIG Cluster Management. customer-request labels Mar 11, 2024
@xrstf
Copy link
Contributor

xrstf commented Jun 9, 2024

From reading the code, it seems not just security groups, but also subnets and route tables are created in the "normal" Resource Group instead of the VNetResourceGroup. Is that also a mistake? I'm no Azure expert..

The validation logic in the provider makes me at least believe the VNet RG should be used: https://github.com/kubermatic/kubermatic/blob/main/pkg/provider/cloud/azure/provider.go#L379-L382 -- but the routeTable still uses the "normal" RG. By mistake? Or is the dashboard wrong?

@xrstf xrstf added this to the KKP 2.26 milestone Jun 9, 2024
@xrstf xrstf self-assigned this Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-request kind/bug Categorizes issue or PR as related to a bug. sig/cluster-management Denotes a PR or issue as being assigned to SIG Cluster Management.
Projects
None yet
Development

No branches or pull requests

3 participants