OpenShift Container Platform (OCP)
OpenShift Container Platform (OCP) is Red Hat’s distribution of Kubernetes. Alongside the standard Kubernetes objects it adds a build and image-promotion pipeline of its own, which is what the chain below describes. This page covers the source-to-running-pod path; it is not about the open/closed principle, which the handbook also abbreviates OCP in a software design context.
From commit to running pod
Section titled “From commit to running pod”- BuildConfig defines how source becomes an image. It references the Git repository to build from and the ImageStream to push the result to, and it carries triggers — typically a webhook fired by the repository on push, plus image-change and config-change triggers — that decide when a build starts.
- The BuildConfig starts a build pod. That pod checks out the repository and produces an application image.
- The image is pushed to the ImageStream, which now points at the new image. An ImageStream is a named, tagged pointer to images rather than a registry of its own: it decouples “the current build of this application” from any particular image digest.
- The Deployment watches the ImageStream tag. A new image triggers a rolling update. The Deployment also owns the properties the application pods are created with — replica count, resource requests and limits, environment, probes.
- A Service gives the pods one stable cluster-internal address and load-balances across whichever of them are currently ready.
- A Route maps a fully qualified external hostname to a Service, and terminates TLS for it. Routes are OpenShift’s ingress object.
Everyday commands
Section titled “Everyday commands”oc projects # list the projects you can seeoc project [myProject] # switch the current projectoc get all # everything in the current projectoc describe [bc|svc|deploy]/[name] # full detail for one objectTroubleshooting
Section titled “Troubleshooting”oc status # what is broken in this projectoc get events --sort-by=.lastTimestamp # recent cluster events, oldest firstoc logs -f [pod] # follow a pod's logsoc logs -f bc/[name] # follow the current build's logsoc edit [type]/[name] # edit a live objectCreate a route
Section titled “Create a route”The short name for a Service is svc:
oc expose svc/[SERVICE-NAME]oc get route