Red Hat OpenShift Local is the quickest way to get started building OpenShift clusters. It is designed to run on a local computer to simplify setup and testing, and to emulate the cloud development environment locally with all of the tools needed to develop container-based applications.
Prerequisites:
Steps:
- Use
Kubernetes - Local Configuration
devcontainer profile to automatically copy localhost~/.kube/config
to the devcontainer - Create
.devcontainer/compose.yaml
# .devcontainer/compose.yaml
---
services:
devcontainer:
image: mcr.microsoft.com/devcontainers/base:bullseye
volumes:
- ../..:/workspaces:cached
command: sleep infinity
extra_hosts:
- "api.crc.testing:host-gateway" # forwards api.crc.testing to docker host gateway
- Update
.devcontainer/devcontainer.json
// .devcontainer/devcontainer.json
{
// Comment `image` field
// "image": "mcr.microsoft.com/devcontainers/base:bullseye",
// Add `dockerComposeFile`, `service`, `workspaceFolder` fields
"dockerComposeFile": "compose.yaml",
"service": "devcontainer",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}"
}