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

Add example and description for the dynatrace command #605

Merged
merged 2 commits into from
Aug 29, 2024

Conversation

feichashao
Copy link
Contributor

As a first-time user of the command osdctl cluster dynatrace, I would like to know the expected behavior of these commands in the help text.

This PR adds examples and long descriptions of the dynatrace commands.

Copy link
Contributor

@mjlshen mjlshen left a comment

Choose a reason for hiding this comment

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

LGTM overall, just a suggestion to use a similar long description/example format as other commands, e.g.

Long: `Resize an OSD/ROSA cluster's infra nodes
This command automates most of the "machinepool dance" to safely resize infra nodes for production classic OSD/ROSA
clusters. This DOES NOT work in non-production due to environmental differences.
Remember to follow the SOP for preparation and follow up steps:
https://github.com/openshift/ops-sop/blob/master/v4/howto/resize-infras-workers.md
`,
Example: `
# Automatically vertically scale infra nodes to the next size
osdctl cluster resize infra --cluster-id ${CLUSTER_ID}
# Resize infra nodes to a specific instance type
osdctl cluster resize infra --cluster-id ${CLUSTER_ID} --instance-type "r5.xlarge"
`,
or
Long: `Verify an AWS OSD/ROSA cluster can reach all required external URLs necessary for full support.
This command is an opinionated wrapper around running https://github.com/openshift/osd-network-verifier for SREs.
Given an OCM cluster name or id, this command will attempt to automatically detect the security group, subnet, and
cluster-wide proxy configuration to run osd-network-verifier's egress verification. The purpose of this check is to
verify whether a ROSA cluster's VPC allows for all required external URLs are reachable. The exact cause can vary and
typically requires a customer to remediate the issue themselves.
The osd-network-verifier launches a probe, an instance in a given subnet, and checks egress to external required URL's. Since October 2022, the probe is an instance without a public IP address. For this reason, the probe's requests will fail for subnets that don't have a NAT gateway. The osdctl network verify-egress command will always fail and give a false negative for public subnets (in non-privatelink clusters), since they have an internet gateway and no NAT gateway.
Docs: https://docs.openshift.com/rosa/rosa_install_access_delete_clusters/rosa_getting_started_iam/rosa-aws-prereqs.html#osd-aws-privatelink-firewall-prerequisites_prerequisites`,
Example: `
# Run against a cluster registered in OCM
osdctl network verify-egress --cluster-id my-rosa-cluster
# Run against a cluster registered in OCM with a cluster-wide-proxy
touch cacert.txt
osdctl network verify-egress --cluster-id my-rosa-cluster --cacert cacert.txt
# Override automatic selection of a subnet or security group id
osdctl network verify-egress --cluster-id my-rosa-cluster --subnet-id subnet-abcd --security-group sg-abcd
# Override automatic selection of the list of endpoints to check
osdctl network verify-egress --cluster-id my-rosa-cluster --platform hostedcluster
# (Not recommended) Run against a specific VPC, without specifying cluster-id
<export environment variables like AWS_ACCESS_KEY_ID or use aws configure>
osdctl network verify-egress --subnet-id subnet-abcdefg123 --security-group sg-abcdefgh123 --region us-east-1`,

@feichashao
Copy link
Contributor Author

@mjlshen Thanks for reviewing!

Made some changes in the new commit, now the output looks like,

$ osdctl cluster dt logs -h       
Fetch logs from Dynatrace and display the logs like oc logs.

  This command also prints the Dynatrace URL and the corresponding DQL in the output.

Usage:
  osdctl cluster dynatrace logs <cluster-id> [flags]

Examples:

  # Get the logs of HCP cluster hcp-cluster-id-123.
  # Specify to get the logs of the pod alertmanager-main-0 in namespace openshift-monitoring
  osdctl cluster dynatrace logs hcp-cluster-id-123 --namespace openshift-monitoring --pod alertmanager-main-0

and

$ osdctl cluster dt gather-logs -h      
Gathers pods logs and evnets of a given HCP from Dynatrace.

  This command fetches the logs from the HCP namespace, the hypershift namespace and cert-manager related namespaces.
  Logs will be dumped to a directory with prefix hcp-must-gather.

Usage:
  osdctl cluster dynatrace gather-logs <cluster-id> [flags]

Aliases:
  gather-logs, gl

Examples:

  # Gather logs for a HCP cluster with cluster id hcp-cluster-id-123
  osdctl cluster dynatrace gather-logs hcp-cluster-id-123


Copy link
Contributor

openshift-ci bot commented Aug 29, 2024

@feichashao: all tests passed!

Full PR test history. Your PR dashboard.

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-sigs/prow repository. I understand the commands that are listed here.

Copy link
Contributor

@mjlshen mjlshen left a comment

Choose a reason for hiding this comment

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

/lgtm

@mjlshen
Copy link
Contributor

mjlshen commented Aug 29, 2024

/label tide/merge-method-squash

@openshift-ci openshift-ci bot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Aug 29, 2024
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 29, 2024
Copy link
Contributor

openshift-ci bot commented Aug 29, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: feichashao, mjlshen

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

The pull request process is described 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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 29, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit f067e16 into openshift:master Aug 29, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants