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

improve doc #64

Closed
wants to merge 2 commits into from
Closed

improve doc #64

wants to merge 2 commits into from

Conversation

dashanji
Copy link
Member

@dashanji dashanji commented Nov 2, 2021

The PR is to improve the document to avoid repeated pitfalls. When using the infra e2e to test skywalking-swck, I encountered some problems and solved them.

Problem 1
image
When the controller's pod is ready, the controller's webhook may not be ready.
Solution
Use the command sleep 30s to wait for the webhook establishing.

Problem 2
image
If the interval is small, we may get the error.
Solution
Add a larger interval such as 30.

@wu-sheng wu-sheng added this to the 1.1.0 milestone Nov 2, 2021
@wu-sheng wu-sheng added the bug Something isn't working label Nov 2, 2021
@@ -53,6 +53,8 @@ The `KinD` environment follow these steps:
1. Wait until all steps are finished and all services are ready with the timeout(second).
1. Expose all resource ports for host access.

Notice, when you create resources such as webhooks, they need time to set up. If you get some error, you can try `sleep` to wait for the resources established.
Copy link
Member

Choose a reason for hiding this comment

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

Is there any command kubectl that can wait for webhook ready?

Copy link
Member Author

Choose a reason for hiding this comment

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

I haven't found it yet.

@@ -150,6 +152,12 @@ trigger:

The Trigger executed successfully at least once, after success, the next stage could be continued. Otherwise, there is an error and exit.

If you get the following error message when using the trigger, You should check whether the port is useful. A possible reason may be that the exporting service needs time to set up, so you can add a larger interval to avoid the error.
Copy link
Member

Choose a reason for hiding this comment

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

Did you use the wait setting to wait for the resource ready?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, the resouce is ready before port-forward, I can use curl to get data.

Choose a reason for hiding this comment

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

Does the e2e framework support NodePort or LoadBalancer? They are the more canonical ways to expose services than port-forward.

Choose a reason for hiding this comment

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

@kezhenxu94 How does the swctl connect to UI in current e2e cases?

Copy link
Member

Choose a reason for hiding this comment

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

We have settings to expose the ports in cluster

expose-ports: # Expose resource for host access
- namespace: # The resource namespace
resource: # The resource name, such as `pod/foo` or `service/foo`
port: # Want to expose port from resource

And you can reference via ${<resourceType>_<resourceName>_host}:${<resourceType>_<resourceName>_<port>}, such as ${service_skywalking_ui_host}:${service_skywalking_ui_80}

See example https://github.com/apache/skywalking/blob/7aa0ba70483b621d40452b0b2f53423f59f039e5/test/e2e-v2/cases/istio/als/e2e.yaml#L26-L29

Choose a reason for hiding this comment

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

Thanks @zhenxu

And FWIK, the item is not special to the e2e framework. The user should ensure a service accessible before accessing it. It's common sense more than a FAQ which the e2e user should care about.

@wu-sheng
Copy link
Member

wu-sheng commented Nov 2, 2021

These added words seem like a FAQ. How about adding a FAQ section rather than this kind of notice or if? If there is no kubectl or wait policy for this kind of case.

If there are other ways, all these should be considered as a FAQ.

@dashanji
Copy link
Member Author

dashanji commented Nov 2, 2021

These added words seem like a FAQ. How about adding a FAQ section rather than this kind of notice or if? If there is no kubectl or wait policy for this kind of case.

If there are other ways, all these should be considered as a FAQ.

Ok, I will add them to the FAQ section.

hanahmily
hanahmily previously approved these changes Nov 3, 2021
Copy link

@hanahmily hanahmily left a comment

Choose a reason for hiding this comment

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

The health checker was introduced by kubernetes-sigs/controller-runtime#1588 which is not part of swck's dependencies though.

@dashanji Once swck upgrades to the latest controller-runtime, we could check the webhook server's health endpoint to ensure it. I hope it will happen in the next release.

@wu-sheng
Copy link
Member

wu-sheng commented Nov 3, 2021

The health checker was introduced by kubernetes-sigs/controller-runtime#1588 which is not part of swck's dependencies though.

If this exists, then FAQ should not be added. Instead, this is a potential feature for SWCK.
Please confirm.

@hanahmily
Copy link

The health checker was introduced by kubernetes-sigs/controller-runtime#1588 which is not part of swck's dependencies though.

If this exists, then FAQ should not be added. Instead, this is a potential feature for SWCK. Please confirm.

Yep, to ensure webhook server before applying CRs is the e2e framework users' job. In another word, it's the behavior of kubernetes. If the e2e framework declared it's built on it, the user should accept this result. Based on that, this tip should be submitted to the kubernetes communication, not here 😄 .

@dashanji
Copy link
Member Author

dashanji commented Nov 3, 2021

Yes,the two problems are to avoid users stepping on the same pit, how about adding them to the discussion's Q&A?

@dashanji dashanji changed the title improve doc fix bug Nov 6, 2021
@wu-sheng
Copy link
Member

wu-sheng commented Nov 6, 2021

Please be clear what bug it is, and how do you fix.

@dashanji
Copy link
Member Author

dashanji commented Nov 6, 2021

When I use swctl --display yaml --base-url=http://${service_default_oap_host}:${service_default_oap_12800}/graphql endpoint list --keyword=hello --service-name Your_ApplicationName, get the follonging info.

- id: WW91cl9BcHBsaWNhdGlvbk5hbWU=.1_e0dFVH0vaGVsbG8=
  name: '{GET}/hello'

Then the error occurred like follows.
ERROR failed to unmarshal index: 0, yaml: line 2: did not find expected key

This bug is the yaml cannot recognize { and }. If we need to include { and }, the key or value needs to be included between '. I fix it in the last commit and delete the faq.

@wu-sheng
Copy link
Member

wu-sheng commented Nov 6, 2021

Could you submit a new pull request? Which make sure the commit logs and PR content are clear.

As a new bug fix should be added in the 1.1.0 in https://github.com/apache/skywalking-infra-e2e/blob/main/CHANGES.md

@dashanji
Copy link
Member Author

dashanji commented Nov 6, 2021

Could you submit a new pull request? Which make sure the commit logs and PR content are clear.

As a new bug fix should be added in the 1.1.0 in https://github.com/apache/skywalking-infra-e2e/blob/main/CHANGES.md

OK.

@dashanji dashanji changed the title fix bug improve doc Nov 6, 2021
@wu-sheng wu-sheng closed this Nov 6, 2021
@dashanji dashanji deleted the improve-doc branch November 6, 2021 12:59
@dashanji
Copy link
Member Author

dashanji commented Nov 6, 2021

Please be clear what bug it is, and how do you fix.

Sorry, this is not a bug, I forgot to add ' in the expected yaml when it contains {}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants