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

fix(docs): update getting started instructions #2681

Merged

Conversation

scottslowe
Copy link
Contributor

@scottslowe scottslowe commented Jul 16, 2024

Thanks for contributing! Please ensure your pull request adheres to the following guidelines:

  • All commits contain a well written commit message and are signed-off (see Submitting a pull request).
  • All code is covered by unit and/or end-to-end tests where feasible.
  • All generated files are updated if needed (see Making changes).
  • Provide a title or release-note blurb suitable for the release notes (see guidelines).
  • Update documentation and write an upgrade note if needed (see guidelines).
  • Are you a user of Tetragon? Please add yourself to the Users doc in the Cilium repository.

Update Kubernetes install instructions to call out single node cluster assumption.

Update execution monitoring instructions to provide commands for using multi-node clusters.

Fixes #2680

Update Kubernetes install instructions to call out single node cluster
Assumption.

Update execution monitoring instructions to provide commands for
Using multi-node clusters.

Fixes cilium#2680

Signed-off-by: Scott Lowe <scott.lowe@isovalent.com>
@scottslowe scottslowe requested review from mtardy and a team as code owners July 16, 2024 20:18
Copy link

netlify bot commented Jul 16, 2024

Deploy Preview for tetragon ready!

Name Link
🔨 Latest commit bc4204e
🔍 Latest deploy log https://app.netlify.com/sites/tetragon/deploys/669a867db9b3560007c114de
😎 Deploy Preview https://deploy-preview-2681--tetragon.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mtardy mtardy added area/documentation Improvements or additions to documentation release-note/docs This PR updates the documentation. labels Jul 17, 2024
Copy link
Member

@mtardy mtardy left a comment

Choose a reason for hiding this comment

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

Hey, thanks for opening that PR.

However, having those two different paths might overcomplicate the getting-started. I feel like we could use this command:

POD=$(kubectl get pod -l 'app.kubernetes.io/name=tetragon' -o name -n kube-system --field-selector spec.nodeName=$(kubectl get pod xwing -o=jsonpath='{.spec.nodeName}')); kubectl exec -ti -n kube-system $POD -c tetragon -- tetra getevents -o compact --pods xwing

To replace the existing:

kubectl exec -ti -n kube-system ds/tetragon -c tetragon -- tetra getevents -o compact --pods xwing

I haven't found a way to make it simpler, the better option would have been to create the xwing pod directly on the first node of the daemonset so that ds/tetragon directly selects the appropriate node but this is impossible if we continue to use the .yaml file of cilium. We could just deploy the xwing using kubectl run but the final getting started guide uses the deathstar thingie. So maybe it's simpler to just use a more complicated command to run on the appropriate tetragon node.

The other solution would have been to use the aggregated logs:

kubectl logs -l app.kubernetes.io/name=tetragon -c export-stdout -f -n kube-system | kubectl exec -i -n kube-system ds/tetragon -c tetragon -- tetra getevents -o compact --pods xwing

But this contains historic data which can be confusing for the user I guess!

So I would suggest to replace all the command with the one retrieving the correct tetragon POD. You can find all those references using:

$ grep -nr "kubectl exec -ti -n kube-system ds/tetragon -c tetragon -- tetra getevents -o compact --pods xwing" docs
docs/content/en/docs/getting-started/execution.md:21:kubectl exec -ti -n kube-system ds/tetragon -c tetragon -- tetra getevents -o compact --pods xwing
docs/content/en/docs/getting-started/enforcement.md:70:kubectl exec -ti -n kube-system ds/tetragon -c tetragon -- tetra getevents -o compact --pods xwing
docs/content/en/docs/getting-started/enforcement.md:134:kubectl exec -ti -n kube-system ds/tetragon -c tetragon -- tetra getevents -o compact --pods xwing
docs/content/en/docs/getting-started/network.md:46: kubectl exec -ti -n kube-system ds/tetragon -c tetragon -- tetra getevents -o compact --pods xwing --processes curl
docs/content/en/docs/getting-started/file-events.md:43:kubectl exec -ti -n kube-system ds/tetragon -c tetragon -- tetra getevents -o compact --pods xwing

@scottslowe
Copy link
Contributor Author

@mtardy I'm not sure that one long command is any better for users than taking a bit of space to explain what needs to be done and why. IMHO, it's clearer to explain what needs to be done, provide commands for each step, and then (at/near the end) provide a single command that encapsulates everything. I'll also point out that users with single node clusters can follow the multi-node instructions without any errors (they're just taking additional steps that aren't necessary at this moment).

To reduce any potential confusion, what do you think about restructuring the tabs to show:

  • Kubernetes (single node)
  • Kubernetes (multi-node)
  • Docker

And then providing instructions in each section? It adds some complexity to the docs themselves, but provides clear distinction/separation for users on what set of instructions to follow.

@scottslowe
Copy link
Contributor Author

scottslowe commented Jul 17, 2024

@mtardy I'd also suggest that we focus on fixing only the "Execution Monitoring" section in this PR. Once we are happy with how it looks and works, then I can file an additional PR to model the same changes in the other sections. I think this would make reviews easier (smaller change sets to review).

@mtardy
Copy link
Member

mtardy commented Jul 17, 2024

@mtardy I'm not sure that one long command is any better for users than taking a bit of space to explain what needs to be done and why. IMHO, it's clearer to explain what needs to be done, provide commands for each step, and then (at/near the end) provide a single command that encapsulates everything. I'll also point out that users with single node clusters can follow the multi-node instructions without any errors (they're just taking additional steps that aren't necessary at this moment).

To reduce any potential confusion, what do you think about restructuring the tabs to show:

  • Kubernetes (single node)
  • Kubernetes (multi-node)
  • Docker

And then providing instructions in each section? It adds some complexity to the docs themselves, but provides clear distinction/separation for users on what set of instructions to follow.

yeah that's a good idea as well. I just want to avoid the proposed changes that are confusing because we end up with 4 commands and a lot of text instead of one command.

On that:

IMHO, it's clearer to explain what needs to be done, provide commands for each step, and then (at/near the end) provide a single command that encapsulates everything.

I think I don't agree, for a "getting started" quick guide, it might be more valuable to show results as fast as possible and then explain. I would say for a more in-depth part of the doc yes but maybe not here.

I'd also suggest that we focus on fixing only the "Execution Monitoring" section in this PR. Once we are happy with how it looks and works, then I can file an additional PR to model the same changes in the other sections. I think this would make reviews easier (smaller change sets to review).

It's up to you, I don't mind. I find it okay to review any case.

Update Docker installation instructions to deploy demo app.
Add Docker Compose file to deploy demo app on Docker.
Update execution events with better Docker instructions.
Fix a few typos.
Change headings to sentence case per style guidelines.

Signed-off-by: Scott Lowe <scott.lowe@isovalent.com>
@scottslowe scottslowe requested a review from mtardy July 18, 2024 21:09
Consolidate commands for multi-node Kubernetes clusters

Signed-off-by: Scott Lowe <scott.lowe@isovalent.com>
@scottslowe scottslowe requested a review from mtardy July 19, 2024 15:34
Copy link
Member

@mtardy mtardy left a comment

Choose a reason for hiding this comment

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

For the record, I'm not a fan of a long command that doesn't explain what it's doing.

I'd rather get these changes into the docs than get hung up on a minor difference of opinion, so I've added the two commands as suggested above in commit bc4204e.

I agree this is debatable!

I'd even merge the Kubernetes single node and Kubernetes multiple node to simplify further but this is way better than previously thanks! :)

@michi-covalent michi-covalent merged commit 5ee4a48 into cilium:main Jul 22, 2024
44 of 45 checks passed
@mtardy
Copy link
Member

mtardy commented Jul 22, 2024

I forgot to ask for squashing the commits oups

@@ -23,15 +23,39 @@ The easiest way to start experimenting with Tetragon is to run it via Docker
using the released container images.

```shell
docker run --name tetragon-container --rm --pull always \
docker run -d --name tetragon --rm --pull always \
Copy link
Member

Choose a reason for hiding this comment

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

btw why did we change that? I think running interactively was fine to get the logs and everything.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This made things a bit more similar between Docker and Kubernetes.

running. It might take a short amount of time for the container images to
download.

```shell
Copy link
Member

Choose a reason for hiding this comment

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

forgot to add to remove shell

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So you want no language designator here, just the backticks?

Copy link
Member

Choose a reason for hiding this comment

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

yes, it's a nit again, but it makes the input look different than the output, this is subtle but this is the convention we have in the doc:
image

@scottslowe scottslowe deleted the pr/scottslowe/tetra-get-started-fix branch July 22, 2024 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/documentation Improvements or additions to documentation release-note/docs This PR updates the documentation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docs: getting started guide assumes a single node cluster
3 participants