Deploy using the CLI
Deploy OpenShift Dev Spaces from the command line using the dsc management tool so that you have full control over configuration options and can automate the installation.
Before you begin
- You have an OpenShift Container Platform 4.22 or later cluster.
- You have an active
ocsession with administrative permissions to the OpenShift cluster. See Getting started with the OpenShift CLI. - You have the
dscmanagement tool installed. See Set up the dsc command-line tool.
Procedure
Results
- Verify the OpenShift Dev Spaces instance status:
$ dsc server:status - Navigate to the OpenShift Dev Spaces cluster instance:
$ dsc dashboard:open
On ARM64 (AArch64) OpenShift clusters, you must override the gateway sidecar images after installing the Red Hat OpenShift Dev Spaces Operator, because the default images are not available for ARM64.
To patch the Red Hat OpenShift Dev Spaces Operator subscription, run the following commands:
SUBSCRIPTION=$(oc get subscription -A \
-o jsonpath='{.items[?(@.spec.name=="devspaces")]}')
SUBSCRIPTION_NAME=$(echo "$SUBSCRIPTION" | jq -r '.metadata.name')
SUBSCRIPTION_NAMESPACE=$(echo "$SUBSCRIPTION" | jq -r '.metadata.namespace')
oc patch subscription "$SUBSCRIPTION_NAME" \
-n "$SUBSCRIPTION_NAMESPACE" \
--type=merge \
-p '{
"spec": {
"config": {
"env": [
{
"name": "RELATED_IMAGE_gateway_authentication_sidecar",
"value": "quay.io/openshift/origin-oauth-proxy:4.9"
},
{
"name": "RELATED_IMAGE_gateway_authorization_sidecar",
"value": "quay.io/openshift/origin-kube-rbac-proxy:4.9"
}
]
}
}
}'
- If
dsc server:deployfails with a permission error, verify that yourocsession has the required cluster permissions. See Permissions required for CLI installation. - If
dsc server:deployreports that the namespace already exists, remove the previous OpenShift Dev Spaces instance first. See Remove OpenShift Dev Spaces from your cluster.