`oc` is the local command-line client for connecting to an OpenShift cluster and managing its resources. Install its executable before working with OpenShift Sandbox or OpenShift Local. In Sandbox, download the binary from the web console and place it on an executable path. section 11.3.4 section 11.6.1
A practical deployment workflow is:
- Copy the cluster-specific `oc login` command from your OpenShift profile and run it locally. Sandbox provides a token and server address for the command. section 11.6.1
- Apply a generated OpenShift manifest with `oc apply -f inventory-service/target/kubernetes/openshift.yml`, or apply an infrastructure manifest to create multiple services in one step. section 11.3.4 section 11.6.2
- Check `oc get pods` for workload status and `oc get routes` for public addresses. Use `oc whoami --show-console` to find the web console. section 11.3.4
- Remove resources defined in a manifest with `oc delete -f <manifest>`. Prefer this to `oc delete all --all` when the manifest includes ConfigMaps: the latter does not remove them. section 11.6.2
$ oc login --token=TOKEN --server=SERVER Logged into "SERVER" as "<username>" using the token provided.
The login command connects the local client to the Sandbox cluster using the token and server address supplied by the console. section 11.6.1
Deploying the car rental infrastructure
Run `oc apply -f car-rental/car-rental-dependent-services.yml` to create the dependent services, then inspect the running containers in the OpenShift console. To remove the resources defined there, run `oc delete -f car-rental/car-rental-dependent-services.yml`. When configuring application-to-application URLs, use OpenShift Service names rather than `localhost`; use `oc get routes` to find a public route needed by browser-facing authentication. section 11.6.2 section 11.6.3
