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

Feature Branch: consul-k8s Envoy Debugging #1271

Merged
merged 175 commits into from
Aug 9, 2022
Merged

Feature Branch: consul-k8s Envoy Debugging #1271

merged 175 commits into from
Aug 9, 2022

Conversation

t-eckert
Copy link
Contributor

@t-eckert t-eckert commented Jun 13, 2022

Changes proposed in this PR

This feature is based on CSL-196 Consul K8s CLI Envoy Troubleshooting (HashiCorp internal).

Multiple branches will be merged into this branch before the feature is complete. As these parts of the overall feature are merged in, they will be checked off below.

  • A PortForward struct which enables the CLI to port forward localhost to Kubernetes Pods.
    • Code to open a port forward connection.
    • Unit tests to cover the behavior of the PortForward struct.
  • A command, consul-k8s proxy list, to list all Pods which are running Envoy proxies managed by Consul.
    • Code to fetch all Pods running Envoy proxies managed by Consul and list them.
    • Unit tests to cover the list behavior.
    • End-to-end unit tests to cover the list behavior.
  • A command, consul-k8s proxy read podname, to print a summary of the Envoy configuration for the sidecar running on the given Kubernetes Pod (podname).
    • Code to fetch and display Envoy configuration for a sidecar in a Kubernetes Pod.
    • Code to filter tables by sections.
    • Unit tests to cover the read behavior.
    • End-to-end unit tests to cover the read behavior.
    • Code to fetch and display Envoy configuration for pods set up with multiport config.
    • Code to filter output by FQDN, port, and address.
  • An acceptance test for using the envoy debugging features.

How I've tested this PR

  • Port forwarding code is covered by unit tests. It is implicitly covered by acceptance tests which exercise the read command as that command uses the port forwarding code.
  • The list command is covered by unit tests and acceptance tests.
  • The read command is covered by unit tests and acceptance tests.

How I expect reviewers to test this PR

  • Running unit tests for the CLI:
    cd cli/ && go test ./...
  • Running acceptance tests for the CLI. These will be run automatically by the CI system.

Installing the CLI from this branch for testing

The version of the CLI on this branch may be installed by cloning the repository and checking out the cli/envoy-debugging branch.

git clone https://github.com/hashicorp/consul-k8s
cd consul-k8s/
git checkout cli/envoy-debugging
cd cli/
go install .
alias consul-k8s=cli

Checklist

  • Tests added
  • CHANGELOG entry added

    HashiCorp engineers only, community PRs should not add a changelog entry.
    Entries should use present tense (e.g. Add support for...)

@t-eckert t-eckert added the area/cli CLI label Jun 13, 2022
@t-eckert t-eckert force-pushed the cli/envoy-debugging branch 2 times, most recently from 9aa2280 to 2851b67 Compare July 22, 2022 17:01
@t-eckert t-eckert force-pushed the cli/envoy-debugging branch 2 times, most recently from fbe5f8f to e248068 Compare August 3, 2022 01:38
@t-eckert t-eckert marked this pull request as ready for review August 9, 2022 14:05
@t-eckert t-eckert requested review from a team, ishustava and thisisnotashwin and removed request for a team August 9, 2022 14:05
Copy link
Contributor

@thisisnotashwin thisisnotashwin left a comment

Choose a reason for hiding this comment

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

Good work!! reminder to squash and merge to PR!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants