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

[WIP]✨ integrate AzureMachine with AzureManagedControlPlane #822

Closed
wants to merge 2 commits into from

Conversation

alexeldeib
Copy link
Contributor

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:
This joins nodes successfully, but they show up as masters (i guess because of admin config? or maybe something aks side?) and Azure CNI doesn't work yet.

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests

Release note:

AzureMachines are now compatible with AzureManagedControlPlanes. This allows users to join self-managed nodes to AKS.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jul 23, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign timothysc
You can assign the PR to them by writing /assign @timothysc in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the area/provider/azure Issues or PRs related to azure provider label Jul 23, 2020
@k8s-ci-robot k8s-ci-robot added sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jul 23, 2020
@alexeldeib
Copy link
Contributor Author

@devigned this is wildly unprepared for merge but PTAL as a use case while you consider #809

@alexeldeib
Copy link
Contributor Author

I think if I drop the privilege on the kubeconfig I supply, that will drop the role for node join. So I probably just need an authenticated, non-admin kubeconfig. I can create this ahead of time in the AzureManagedControlPlaneReconciler w a remote client.


// AzureManagedControlPlane only works with AzureManagedCluster
var isManaged bool
clusterDescriberRef := cluster.Spec.InfrastructureRef
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feeling the downside of making AzureManagedCluster a no-op right about now...(we could just use infra ref otherwise)

@alexeldeib alexeldeib force-pushed the ace/subnet branch 3 times, most recently from ba65adf to 24a4fdd Compare July 23, 2020 07:56
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 23, 2020
@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Jul 23, 2020

@alexeldeib: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-cluster-api-provider-azure-apidiff 2a8323b link /test pull-cluster-api-provider-azure-apidiff
pull-cluster-api-provider-azure-verify 2a8323b link /test pull-cluster-api-provider-azure-verify
pull-cluster-api-provider-azure-test 2a8323b link /test pull-cluster-api-provider-azure-test

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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 kubernetes/test-infra repository. I understand the commands that are listed here.

// ClusterDescriber is an interface which can get common Azure Cluster information
// ClusterDescriber describe a Kubernetes resource with full
// serializability, object meta and type meta, plus can describe enough
// data to build an Azure cluster
type ClusterDescriber interface {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CecileRobertMichon any feelings about this? how do you see scope evolving long term for a use case like this?

}

// GetAzureDNSZoneForEnvironment returnes the DNSZone to be used with the
// cloud environment, the default is the public cloud
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need this function even as-is, the logic here is equivalent

@@ -99,6 +106,109 @@ type AzureManagedControlPlaneList struct {
Items []AzureManagedControlPlane `json:"items"`
}

func (c *AzureManagedControlPlane) ManagedResourceGroup() string {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CRD types now implement clusterDescriber directly, rather than scope

@@ -126,6 +126,12 @@ func (s *Service) Reconcile(ctx context.Context, spec interface{}) error {
HardwareProfile: &compute.HardwareProfile{
VMSize: compute.VirtualMachineSizeTypes(vmSpec.Size),
},
DiagnosticsProfile: &compute.DiagnosticsProfile{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are all great changes but it's too much for one PR, can you please split 1) vm diagnostics 2) NetworkDescriber/ClusterDescriber changes 3) AzureManagedControlPlane etc. in multiple PRs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, i'm mostly trying to see if I can get it working first // share some of the changes to patterns that have been helpful trying to make this work for different scenarios. I definitely won't try to merge this as one PR, and I found a few small bits here and there to merge as one-off fixes besides the main functional stuff.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also vm diagnostics is hardcoded, that was me debugging. once I figure out which order to tackle all these properly I can assign the relevant issues.


// NetworkDescriber describes the vnet and subnet configuration for a cluster
// abstracted because it is implemented by managed and unmanaged cluster.
type NetworkDescriber interface {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have the same thing on my local branch :)

@alexeldeib
Copy link
Contributor Author

/close

@k8s-ci-robot
Copy link
Contributor

@alexeldeib: Closed this PR.

In response to this:

/close

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 kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/provider/azure Issues or PRs related to azure provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants