Skip to content

Comments

NO-JIRA: hack: steps to run router locally#712

Open
jcmoraisjr wants to merge 1 commit intoopenshift:masterfrom
jcmoraisjr:hack-local-debug
Open

NO-JIRA: hack: steps to run router locally#712
jcmoraisjr wants to merge 1 commit intoopenshift:masterfrom
jcmoraisjr:hack-local-debug

Conversation

@jcmoraisjr
Copy link
Member

Adding some doc on how to run OpenShift router locally, which improves the "code + run + test + debug" experience.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jan 15, 2026
@openshift-ci-robot
Copy link
Contributor

@jcmoraisjr: This pull request explicitly references no jira issue.

Details

In response to this:

Adding some doc on how to run OpenShift router locally, which improves the "code + run + test + debug" experience.

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested review from Miciah and gcs278 January 15, 2026 18:46
@Thealisyed
Copy link

/assign

cp images/router/haproxy/conf/* "${haproxydir}/conf/"
}

router_run() {

Choose a reason for hiding this comment

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

It would be nice to have a check to make sure that the KUBECONFIG is set properly before running?

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 see, I'm not sure, I though about this and ended up choosing the simplicity, since router itself will check this for us - although its message isn't that clear:

make local-run 
hack/local-router.sh run
/var/lib/haproxy prepared
github.com/openshift/router/pkg/router/template
github.com/openshift/router/pkg/router/metrics
github.com/openshift/router/pkg/cmd/infra/router
I0210 11:56:03.528934  399293 template.go:561] "msg"="starting router" "logger"="router" "version"="majorFromGit: \nminorFromGit: \ncommitFromGit: \nversionFromGit: unknown\ngitTreeState: \nbuildDate: \n"
error: Unable to configure Kubernetes client: invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable
exit status 1
make: *** [Makefile:46: local-run] Error 1

What do you think from the user's perspective? I'm fine for both, either checking or letting router check for me.

Choose a reason for hiding this comment

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

Ah okay then if router checks then fine

sudo chown "${USER}:${USER}" "$haproxydir"
fi
rm -rf "${haproxydir}/{conf,run}"
mkdir "${haproxydir}/{conf,run}"

Choose a reason for hiding this comment

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

IIUC the brace expansion won't work inside the double quotes right?

Copy link
Member Author

Choose a reason for hiding this comment

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

It will, all var expansions work under double quotes, they are considered literal under single quote instead. Quoting is important in order to protect against white spaces in the path.

Otoh there are some shells that don't support this sort of expansion, ash from Alpine is an example if I'm not mistaken. Since the script uses shebang, it enforces bash despite of the shell the user is using.

Adding some doc on how to run OpenShift router locally, which improves
the "code + run + test + debug" experience.
@jcmoraisjr
Copy link
Member Author

/retest

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 11, 2026

@jcmoraisjr: all tests passed!

Full PR test history. Your PR dashboard.

Details

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.

@Thealisyed
Copy link

Thanks @jcmoraisjr
/lgtm
/approve

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 18, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 18, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Thealisyed

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

The pull request process is described here

Details 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 Feb 18, 2026
@@ -1 +1,2 @@
/.vscode

Choose a reason for hiding this comment

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

Hmm was going to say if we should follow how CDO does it's gitignore but seems excessive for this repo

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 see. Wondering if there is a pattern that repos are invited to follow, otherwise we can evolve it whenever we see it being demanded.

Copy link

@Thealisyed Thealisyed Feb 18, 2026

Choose a reason for hiding this comment

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

Seems they used this # Created by https://www.gitignore.io/api/go,vim,emacs,visualstudiocode. Interestingly enough the bulk of the gitignore was committed as part of the inital commit and hasn't been touched since (8 years) xD
So seems to be a basic template used (maybe a follow up PR for this repo?)

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. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants