🐳

openshift

1 notes  •  Containers & Orchestration

Minishift: Local OpenShift Development Environment

Minishift runs a single-node OpenShift cluster inside a VM for local development and testing.

Prerequisites

  • Minishift installed (GitHub releases)
  • A supported hypervisor: VirtualBox, HyperKit (macOS), Hyper-V (Windows), KVM (Linux)

Start Minishift

minishift start
minishift start --vm-driver virtualbox --cpus 2 --memory 4096

Login to OpenShift

# Set oc in PATH
eval $(minishift oc-env)

# Login as admin
oc login -u admin -p admin

# Login as developer
oc login -u developer -p developer

Common oc Commands

# List projects (namespaces)
oc get projects

# Create a new project
oc new-project myproject

# Deploy an application
oc new-app nginx --name=myapp

# List pods
oc get pods

# Get logs
oc logs <pod-name>

# Expose a service (create a route)
oc expose svc/myapp

Stop and Delete Minishift

# Stop
minishift stop

# Delete cluster and clear cache
minishift delete --clear-cache

Access the OpenShift Console

minishift console
minishift console --url