🚀 DevOps & SRE Certification Program 📅 Starting: 1st of Every Month 🤝 +91 8409492687 🔍 Contact@DevOpsSchool.com

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

Openshift Local: crc command lines guide

Here’s a clean and well-structured table listing all the crc commands along with their descriptions:

CommandDescription
bundleManage CRC bundles (download, add, list bundles for OpenShift)
cleanupUndo system changes made by CRC setup (DNS, networking, etc.)
completionGenerate the autocompletion script for bash, zsh, etc.
configModify CRC configuration options (CPU, memory, etc.)
consoleOpen the OpenShift Web Console in the default browser
deleteDelete the CRC VM and cluster data
helpShow help about any CRC command
ipGet the IP address of the running OpenShift cluster
oc-envAdd the oc (OpenShift CLI) executable to your system PATH
podman-envSet environment variables to use podman with CRC
setupSet up system prerequisites for CRC (run before first use)
startStart the OpenShift cluster
statusDisplay the current status of the OpenShift cluster
stopStop the running cluster instance
versionPrint CRC version, OpenShift version, and bundle information

Here’s a complete breakdown of each crc command, including explanations and multiple practical examples for each. This will help you master the crc CLI when working with your local OpenShift 4.x cluster.


🔧 crc – Overview

CRC (CodeReady Containers) allows you to spin up a local single-node OpenShift 4 cluster ideal for testing and development. You run commands using:

crc <command> [flags]

✅ 1. crc start

Starts the local OpenShift cluster.

🔹Usage:

crc start

🔹Examples:

crc start --memory 12288 --cpus 4

Start the cluster with 12GB RAM and 4 CPUs.

crc start --log-level debug

Start with detailed logs for troubleshooting.


🛑 2. crc stop

Stops the running OpenShift cluster.

🔹Usage:

crc stop

🔹Examples:

crc stop

Gracefully stops the cluster, freeing up system resources.


❌ 3. crc delete

Completely deletes the CRC VM and data (non-reversible).

🔹Usage:

crc delete

🔹Examples:

crc delete --force

Forcefully delete CRC without confirmation prompt.


⚙️ 4. crc setup

Prepares your system for running CRC (sets DNS, network, etc.).

🔹Usage:

crc setup

🔹Examples:

crc setup

Run this once before the first crc start.


📊 5. crc status

Shows the current state of the CRC VM and OpenShift cluster.

🔹Usage:

crc status

🔹Examples:

crc status --log-level debug

View detailed status info for debugging.


🌐 6. crc console

Opens the OpenShift web console in your default browser.

🔹Usage:

crc console

🔹Examples:

crc console --credentials

Displays login credentials along with opening the console.


🔧 7. crc config

View and modify CRC config settings.

🔹Usage:

crc config <subcommand>

🔹Examples:

crc config view

See all current config settings.

crc config set memory 8192
crc config set cpus 4

Set RAM and CPU for the cluster.

crc config unset memory

Remove a previously set value.


🔍 8. crc version

Displays CRC, OpenShift, and bundle versions.

🔹Usage:

crc version

🔹Examples:

crc version

Useful for support or checking compatibility.


🌍 9. crc ip

Gets the IP address of the running cluster.

🔹Usage:

crc ip

🔹Examples:

export CRC_IP=$(crc ip)

Store the IP in a shell variable for use in scripts.


🔄 10. crc oc-env

Outputs environment variables to use oc CLI.

🔹Usage:

crc oc-env

🔹Examples:

eval $(crc oc-env)

Sets up the shell so you can run oc commands directly.


🍻 11. crc podman-env

Sets up environment for podman CLI to work with CRC.

🔹Usage:

crc podman-env

🔹Examples:

eval $(crc podman-env)

Sets environment variables to use podman with the CRC container runtime.


🧹 12. crc cleanup

Reverts changes CRC made to your system (use cautiously).

🔹Usage:

crc cleanup

🔹Examples:

crc cleanup

Removes system DNS, network, and other tweaks made by CRC setup.


📦 13. crc bundle

Manage OpenShift bundles (images and VM base files).

🔹Usage:

crc bundle <subcommand>

🔹Examples:

crc bundle list

List available bundles.

crc bundle add ~/Downloads/crc_libvirt_4.13.9.crcbundle

Add a new bundle manually.


🔁 14. crc completion

Generate shell completion scripts for bash, zsh, etc.

🔹Usage:

crc completion bash

🔹Examples:

crc completion zsh > ~/.crc-completion.sh

Then source the file in your .zshrc.


🆘 15. crc help

Displays help for any command.

🔹Usage:

crc help
crc <command> --help

🔹Examples:

crc help start

Detailed help for the start command.


✅ Flags (Global)

  • --log-level (debug, info, warn, error)
  • --help – Show help for commands

Would you like me to generate a cheat sheet image or step-by-step beginner tutorial for this?

Subscribe
Notify of
guest


0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments

Certification Courses

DevOpsSchool has introduced a series of professional certification courses designed to enhance your skills and expertise in cutting-edge technologies and methodologies. Whether you are aiming to excel in development, security, or operations, these certifications provide a comprehensive learning experience. Explore the following programs:

DevOps Certification, SRE Certification, and DevSecOps Certification by DevOpsSchool

Explore our DevOps Certification, SRE Certification, and DevSecOps Certification programs at DevOpsSchool. Gain the expertise needed to excel in your career with hands-on training and globally recognized certifications.

0
Would love your thoughts, please comment.x
()
x