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

HARMONY-1942: Add optional use of krelay for port forwarding #682

Merged
merged 3 commits into from
Jan 21, 2025

Conversation

indiejames
Copy link
Contributor

@indiejames indiejames commented Jan 17, 2025

Jira Issue ID

HARMONY-1942

Description

This PR adds support for using krelay to handle port-forwarding. The primary advantage to krelay is that port forwarding will survive pod restarts. Using krelay is optional (controlled by the USE_KRELAY env var), and defaults to not using it.

Local Test Steps

  1. kill your locally running harmony
./bin/stop-harmony-and-services`
  1. Check out this branch
  2. Enable krelay
export USE_KRELAY=true
  1. Run Harmony in a Box (Harmony in k8s)
  2. Verify that Harmony runs correctly (workflow-ui, etc.)
  3. Use kubectl or k9s to kill off the harmony pod
  4. Wait for the harmony pod to retart
  5. Verify harmony is still accessible (workflow-ui, etc.)

PR Acceptance Checklist

  • Acceptance criteria met
  • Tests added/updated (if needed) and passing
  • Documentation updated (if needed)
  • Harmony in a Box tested? (if changes made to microservices)

bin/port-forward Outdated
if [ "$USE_KRELAY" == "true" ]; then
echo "Using krelay to set up port forwarding for $service_name"
nohup kubectl relay "service/${service_name}" "${args[@]}" -n harmony > "logs/port-forward-${service_name}.log" 2>&1 &
# krelay does not have a good way to indicate that it is ready, so we have to restort to this for right now
Copy link
Contributor

Choose a reason for hiding this comment

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

resort typo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Member

@ygliuvt ygliuvt left a comment

Choose a reason for hiding this comment

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

Tested locally successfully.

@indiejames indiejames merged commit 10f4ad1 into main Jan 21, 2025
5 checks passed
@indiejames indiejames deleted the harmony-1942 branch January 21, 2025 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants