Skip to content

Feature/filter alicloud resources by tags#9

Merged
openshift-merge-robot merged 6 commits intoopenshift:mainfrom
menglingwei:feature/filter-alicloud-resources-by-tags
Nov 10, 2021
Merged

Feature/filter alicloud resources by tags#9
openshift-merge-robot merged 6 commits intoopenshift:mainfrom
menglingwei:feature/filter-alicloud-resources-by-tags

Conversation

@menglingwei
Copy link
Contributor

filter alibabacloud resources (eg. SecurityGroupIDs ,VSwitchID) by tags

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 1, 2021

Hi @menglingwei. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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.

@openshift-ci openshift-ci bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Nov 1, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 1, 2021

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

Details 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

@openshift-ci openshift-ci bot requested review from JoelSpeed and elmiko November 1, 2021 06:08
if machineProviderConfig.VpcID != "" {
request.VpcId = machineProviderConfig.VpcID
}
if machineProviderConfig.ResourceGroupID != "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

When ResourceGroupID is specified I am unable to query for the correct security group. I would remove resource group id.

aliyun ecs DescribeSecurityGroups --RegionId us-east-1 \
 --Tag.0.Key owned --Tag.0.Value "kubernetes.io/cluster/test-2mbh7" \
 --Tag.1.Key Name --Tag.1.Value "test-2mbh7-sg-worker" \
 --Tag.2.Key OCP --Tag.2.Value "ISV Integration"
{
	"PageNumber": 1,
	"PageSize": 10,
	"RegionId": "us-east-1",
	"RequestId": "BCD4DF49-FEED-57F6-A3AE-D670FB876026",
	"SecurityGroups": {
		"SecurityGroup": [
			{

				"CreationTime": "2021-11-01T17:11:52Z",
				"Description": "Created By OpenShift Installer",
				"ResourceGroupId": "",
				"SecurityGroupId": "sg-0xi9838n99r7i86s6rri",
				"SecurityGroupName": "test-2mbh7-sg-worker",
				"SecurityGroupType": "normal",
				"ServiceManaged": false,
				"Tags": {
					"Tag": [
						{
							"TagKey": "kubernetes.io/cluster/test-2mbh7",
							"TagValue": "owned"
						},
						{
							"TagKey": "Name",
							"TagValue": "test-2mbh7-sg-worker"
						},
						{
							"TagKey": "OCP",
							"TagValue": "ISV Integration"
						}
					]
				},
				"VpcId": "vpc-0xiosfgntngzl5ali1wj5"
...

Notice the resourceGroupID is not set.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think if you don't assign an instance(ig. ECS Instance Or SecurityGroup ,etc) to a resource group. You don't need to set the resourceGroupID. If you set the resourceGroupID. The API simply returns the resources under a given resource group.

Copy link

Choose a reason for hiding this comment

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

@kwoodson I think I can explain the problem, it should be that the resource_group is not specified here
resource_group_id parameter, I have fixed it and submitted it in #5348

Copy link
Contributor

Choose a reason for hiding this comment

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

for idx, tag := range tags {

@kwoodson
Copy link
Contributor

kwoodson commented Nov 2, 2021

@menglingwei I have left some feedback. We would like meet and chat about the cluster-api-provider-alibaba and the future plans of the provider types as well as these changes. Please sync up with Brian.

Thanks!

@kwoodson
Copy link
Contributor

kwoodson commented Nov 2, 2021

@menglingwei Also running into issues when accepting nodes into the cluster. We have an machine-approver that runs which accepts the node's certificate signing request. This is failing due to providerID being in a different format in two different locations. We will need to solve this as well so that nodes will be auto-accepted into the cluster.

cc @JoelSpeed @elmiko

@menglingwei
Copy link
Contributor Author

@kwoodson In Machine-API, we set the ProviderID follow the format "alibabacloud:///RegionID/ZoneID/InstanceID". Do we need to keep the same ProviderID with CCM?

@kwoodson
Copy link
Contributor

kwoodson commented Nov 3, 2021

@menglingwei I think we should match what is in the CCM. The code in the cluster-api-provider-alibaba that you referenced is here:

providerID := fmt.Sprintf("alibabacloud:///%s/%s/%s", instance.RegionId, instance.ZoneId, instance.InstanceId)
// If resourceGroupId is not empty, set to providerId
if instance.ResourceGroupId != "" {
providerID = fmt.Sprintf("alibabacloud:///%s/%s/%s/%s", instance.ResourceGroupId, instance.RegionId, instance.ZoneId, instance.InstanceId)
}

The CCM expects the code to be in this format <region>.<instanceid>. Here is the code in the CCM that parses the providerID https://github.com/openshift/cloud-provider-alibaba-cloud/blob/master/cloud-controller-manager/instances.go#L84.

I think we should match the CCM's expectation with <region>.<instanceid>.

@menglingwei WDYT?

@menglingwei
Copy link
Contributor Author

@menglingwei I think we should match what is in the CCM. The code in the cluster-api-provider-alibaba that you referenced is here:

providerID := fmt.Sprintf("alibabacloud:///%s/%s/%s", instance.RegionId, instance.ZoneId, instance.InstanceId)
// If resourceGroupId is not empty, set to providerId
if instance.ResourceGroupId != "" {
providerID = fmt.Sprintf("alibabacloud:///%s/%s/%s/%s", instance.ResourceGroupId, instance.RegionId, instance.ZoneId, instance.InstanceId)
}

The CCM expects the code to be in this format <region>.<instanceid>. Here is the code in the CCM that parses the providerID https://github.com/openshift/cloud-provider-alibaba-cloud/blob/master/cloud-controller-manager/instances.go#L84.

I think we should match the CCM's expectation with <region>.<instanceid>.

@menglingwei WDYT?

It's ok.I'll do it.

@kwoodson kwoodson removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Nov 3, 2021
@kwoodson
Copy link
Contributor

kwoodson commented Nov 3, 2021

/ok-to-test

@openshift-ci openshift-ci bot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Nov 3, 2021
@openshift-merge-robot openshift-merge-robot merged commit 6d4c532 into openshift:main Nov 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Indicates a non-member PR verified by an org member that is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments