Skip to content

Open the Console ​

Open the Console in a browser, and paste the Instance token to start runs and answer Gates.

The Orchestrator serves the Console on port 4000, in the cluster. To reach it from your computer, forward the port with kubectl. In the commands on this page, replace <namespace> with the namespace of your Instance. It is the name in jr2.config.ts. When jr2.config.ts sets no name, it is the name of the Instance folder. No jr2 command opens the Console.

Forward the port ​

sh
kubectl -n <namespace> port-forward svc/jr2-orchestrator 4000:4000
text
Forwarding from 127.0.0.1:4000 -> 4000
Forwarding from [::1]:4000 -> 4000

The command stays in the foreground. Keep it open while you use the Console. Give the other commands in a second terminal. To use a different port on your computer, change the first number, such as 8080:4000. For a cluster that is not the current kubectl context, add --context <context>, with the name of its kubectl context.

Open the page in a browser ​

Open http://localhost:4000 in a browser.

Without the token, the Console shows the runs, and you cannot change them:

  • The Fleet rail on the left lists each Workflow, with the number of its live runs. Click the caret of a Workflow to list its runs.
  • The center shows the Machine of the Workflow that you select. When you select a run, the Console shows the states that the run is in.
  • The Activity tab of the right drawer lists the type of each Emit of the runs of the Workflow, the newest first.

The address shows the Workflow that you select. Open http://localhost:4000/workflows/<workflow> to go to one Workflow directly. Replace <workflow> with its name, such as ping.

Get the Instance token ​

jr2 up makes the Instance token when it first converges the Instance, and keeps it after that. It is in the Kubernetes Secret jr2-instance:

sh
kubectl -n <namespace> get secret jr2-instance -o jsonpath='{.data.JR2_INSTANCE_TOKEN}' | base64 -d

The command prints the token, with no line break after it.

Caution

The Instance token starts runs, answers Gates and cancels runs. Keep it as you keep a password.

Paste the token ​

Paste the token into the box instance token in the nav of the Console. Push Enter. The badge after the box shows … while the Console checks the token, then live. With a live token, the Console shows more:

  • A start button for each Workflow in the Fleet rail. It opens a form for the run input of the Workflow. A Workflow that declares no run input gets a box for JSON.
  • The Attention tab of the right drawer. It shows a card for each open Gate of the selected Workflow, with a form to send each event that the Gate takes. Select all workflows to see the Gates of each Workflow.

The Console keeps the token in the browser tab. A reload keeps it. When you close the tab, the token is gone.

Rules ​

  • A token that the Orchestrator does not accept reads invalid. The Console then shows no start button and no Attention tab.
  • When the Orchestrator refuses the token later, with the status 401, the Console goes back to view only.
  • Only the Instance token unlocks the Console. A Sandbox token reads invalid.
  • The port forward stops when you stop its command, or when the Orchestrator pod restarts. Then run the command again.

The docs of Kit version 0.5.1. Each page is also at its .md URL.