-
Notifications
You must be signed in to change notification settings - Fork 11
Alibaba providerfix #11
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
Alibaba providerfix #11
Conversation
|
@menglingwei I based these commits on top of your work. Please review and feel free to comment. https://github.com/openshift/cluster-api-provider-alibaba/pull/9/files#r740749797 @menglingwei @bd233 @dongchen126 Is it possible to set the private zone to auto synchronize the DNS names during the provisioner? @elmiko @JoelSpeed Is it possible to get the CSR process to work without the DNS synchronization? I do not see a method of turning this on during the terraform provisioning. We'll see what Alibaba provides. |
|
@kwoodson The last time you tested querying a list of security groups,you said that if you set resourceGroupID, you cannot return the result,but if you removed resourceGroupID, the result is correct. So i have a question about your securityGroups. Whether your security group does not have a resourceGroup? Here are our api documentions. CreateResourceGroup : https://www.alibabacloud.com/help/doc-detail/158865.htm?spm=a2c63.p38356.879954.3.7c2e4b3ehm0arG#doc-api-ResourceManager-CreateResourceGroup CreateSecurityGroup: https://www.alibabacloud.com/help/doc-detail/25553.htm |
DNS is a requirement for machines within OCP. We need to have this turned on. If this isn't supported by terraform, perhaps we need to extend the terraform to allow it to be turned on? DNS is a part of the security process that we use for the CSRs and is also used for Kube API to Kubelet communication, so it must be present for a working OCP cluster. |
55eac5e to
f495159
Compare
f495159 to
91d4951
Compare
I have asked Alibaba to look into the DNS requirement. On a side note, @elmiko and I were able to get this working without using the automatic DNS synchronization. We were able to plumb this provider today by removing an unexpected tag from the Nodes: Machines: I am going to remove the draft status. One note: |
| if machineProviderConfig.SecurityGroupID != "" { | ||
| securityGroupIDs = append(securityGroupIDs, machineProviderConfig.SecurityGroupID) | ||
| } else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is weird, I would expect the following in yaml to suffice, having a separate field for a dedicated SG seems counterintuative, also, it may be surprising to a user that using this field breaks using the list field
securityGroups:
- id: blah
| if machineProviderConfig.VSwitchID != "" { | ||
| vSwitchID = machineProviderConfig.VSwitchID | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above, would expect a single way to specify this
| }) | ||
| klog.Errorf("error describing instances: %v", err) | ||
| return "", fmt.Errorf("error describing instances: %v", err) | ||
| if machineProviderConfig.VSwitch != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we should clean this up a bit and unindent by reversing some of the logic, and maybe move some into a separate smaller function, eg.
if machineProviderConfig.VSwitch == nil {
return "", errors.New("no vswitch configuration provided")
}
if machineProviderConfig.VSwitch.ID != "" {
return machineProviderConfig.VSwitch.ID, nil
}
if machineProviderConfig.VSwitch.Tags != nil {
vSwitchID, err := getVSwitchIDFromTags(machine, machineProviderConfig.VSwitch.Tags, client)
if err != nil {
return "", fmt.Errorf("could not get vSwitchID from tags: %v", err)
}
return vSwitchID, nil
}
return "", errors.New("no vSwitch found from configuration")
Could also apply the same sort of clean ups to the security group configuration checks
| // SecurityGroups is an array of references to security groups which to assign the instance. The valid values of N vary based on the | ||
| // maximum number of security groups to which an instance can belong. For more information, see the "Security group limits" section in Limits. | ||
| // https://www.alibabacloud.com/help/doc-detail/101348.htm?spm=a2c63.p38356.879954.48.78f0199aX3dfIE | ||
| SecurityGroups []ResourceTagReference `json:"securityGroups,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should remove SecurityGroupID so there's only one way to configuration security groups
| //VSwitch is a reference to the vswitch to use for this instance | ||
| //This parameter is required when you create an instance of the VPC type. | ||
| //You can call the DescribeVSwitches operation to query the created vSwitches. | ||
| VSwitch *ResourceTagReference `json:"vSwitch,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should remove VSwitchID so there's only one way to configuration the vSwitch
| ID string `json:"id,omitempty"` | ||
|
|
||
| // Tags is a set of tags used to identify a resource | ||
| Tags []Tag `json:"tags,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does alibaba have a way they call this when finding instances by tags? Do they use a --tags or maybe --filter as AWS does? Just want to make sure we name this in a way that it's going to be obvious to users
| alibabacloudproviderv1 "github.com/AliyunContainerService/cluster-api-provider-alibabacloud/pkg/apis/alibabacloudprovider/v1beta1" | ||
| alibabacloudClient "github.com/AliyunContainerService/cluster-api-provider-alibabacloud/pkg/client" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these be from the openshift fork now?
| alibabacloudproviderv1 "github.com/AliyunContainerService/cluster-api-provider-alibabacloud/pkg/apis/alibabacloudprovider/v1beta1" | ||
| alibabacloudClient "github.com/AliyunContainerService/cluster-api-provider-alibabacloud/pkg/client" | ||
| "github.com/aliyun/alibaba-cloud-sdk-go/services/ecs" | ||
| machinev1 "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use openshift/api/machine/v1beta1 instead
|
@JoelSpeed I have opened PR #12 to address your concerns. I believe that this PR is ready to merge based upon our earlier discussion. WDYT? |
elmiko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm adding both approval labels to this PR, we have agreed that @JoelSpeed 's comments will be addressed on #12, and i have talked with @kwoodson. getting this merged will unblock the installer work we are doing as well as the debugging of this controller.
/approve
/lgtm
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: elmiko, kwoodson The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
The work included in this pull request is the following:
machine.GetName()machine.GetName()machine.Getname()to the list of network addressesThis is required in order for the CSR process to match the subject name to the machine name.
This also aligns us setting the Alibaba Private Zone DNS synchronization so that hostnames resolve and align with the CSR.
cc @menglingwei