Getting started with CLI
In addition to the user interface (UI), you can also use the command line interface (CLI) to access and configure Konflux to meet your specific needs.
To access Konflux with the CLI, you must configure oc
commands. Follow the instructions in Getting started with the OpenShift CLI.
To log in to Konflux by using the CLI, complete the following steps:
-
Navigate to the OpenShift Developer Sandbox.
-
Select the checkbox next to I agree to the Terms and Conditions.
-
Select Get started with OpenShift Developer Sandbox.
-
In the webpage banner, select Proxy login command.
-
Click the copy icon to copy the command and your unique token.
-
Open your terminal and paste the command that you copied in the previous step. This command runs
oc login --token=[your token] [appstudio api url]
.
To verify that oc login
worked correctly, complete the following steps:
-
Run
cd ~/.kube
. -
Run
ls
and verify that there is a file namedconfig
.
Switching workspaces
To use the CLI tool with a workspace other than your default personal workspace, append /workspaces/<workspace-name>
to the AppStudio API url used in your oc login
command in step 6.
oc commands for Konflux
The following list contains common oc
commands and examples of their outputs, where relevant:
oc get components
Example output:
NAME AGE STATUS REASON TYPE
devfile-sample-java-springboot-basic-mhqg 50s True OK GitOpsResourcesGenerated
oc get routes
Example output:
NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD
my-app myapp-my-namespace.yourserver / single-container-app-7g2w 8080 edge/Redirect None
oc get pipelinerun
Example output:
NAME SUCCEEDED REASON STARTTIME COMPLETIONTIME
devfile-sample-java-springboot-basic-mhqg-mnwx6 True Completed 9m30s 6m46s
oc get taskrun
Example output:
NAME SUCCEEDED REASON STARTTIME COMPLETIONTIME
devfile-sample-java-springboot-basic-mhqg-mnwx6-build-container True Succeeded 11m 9m45s
devfile-sample-java-springboot-basic-mhqg-mnwx6-init True Succeeded 12m 12m
devfile-sample-java-springboot-basic-mhqg-mnwx6-show-summary True Succeeded 9m42s 9m34s
devfile-sample78ef7b0924ed3b025289a33d98b0e1f4-clone-repository True Succeeded 12m 11m`
oc get gitopsdeployment
Example output:
NAME SYNC STATUS HEALTH STATUS
my-app-development-binding-g7m54-my-app-development-devfile-sample-java-springboot-basic-mhqg Synced Healthy
oc get deployment
Example output:
NAME SYNC STATUS HEALTH STATUS
my-app-development-binding-g7m54-my-app-development-devfile-sample-java-springboot-basic-mhqg Synced Healthy
oc get service [name]
Example output:
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
devfile-sample-java-springboot-basic-mhqg ClusterIP 172.30.23.168 <none> 8081/TCP 10d
oc get pods
Example output:
NAME READY STATUS RESTARTS AGE
devfile-sample-java-springb8214c8b0443987b4d7705b3830fa823e-pod 0/6 Completed 0 13m
devfile-sample-java-springbf2e030e1f22f1d5a7be9e9c899eaaf25-pod 0/1 Completed 0 11m
devfile-sample-java-springboot-basic-mhqg-798c5845bd-sxfxt 1/1 Running 0 5m19s
devfile-sample-java-springboot-basic-mhqg-mnwx6-init-pod 0/1 Completed 0 13m
devfile-sample78ef7b0924ed3611ba7cdef4a1f702c76765753714be6-pod 0/1 Completed 0 13m
oc get pods -l '!tekton.dev/memberof'
Example output:
NAME READY STATUS RESTARTS AGE
devfile-sample-java-springb8214c8b0443987b4d7705b3830fa823e-pod 0/6 Completed 0 13m
devfile-sample-java-springbf2e030e1f22f1d5a7be9e9c899eaaf25-pod 0/1 Completed 0 11m
devfile-sample-java-springboot-basic-mhqg-798c5845bd-sxfxt 1/1 Running 0 5m4s
devfile-sample-java-springboot-basic-mhqg-mnwx6-init-pod 0/1 Completed 0 13m
devfile-sample78ef7b0924ed3611ba7cdef4a1f702c76765753714be6-pod 0/1 Completed 0 13m