Deployment
Production best practices for shipping workloads to Kubernetes and OpenShift. Detect the platform, apply the Kubernetes baseline, and add the OpenShift specifics when they apply.
Step 1: Detect the platform
- OpenShift when the
ocCLI is in use, or manifests useRoute,DeploymentConfig,BuildConfig,ImageStream, orSecurityContextConstraints, or the project targets an OpenShift cluster. - Kubernetes otherwise:
kubectl, plainDeployment,Service,Ingress, a Helm chart, or akustomization.yaml.
Step 2: Apply the guidance
- Always read
references/kubernetes.md. It is the baseline for both platforms. - On OpenShift, also read
references/openshift.mdfor the deltas: Routes, security context constraints, DeploymentConfig, builds, and theocworkflow.
Non-negotiables
- Set memory requests and limits, and CPU requests, on every container.
- Every workload has readiness and liveness probes that check internal state only.
- Harden the security context: run as non-root, drop all capabilities, and use a read-only root filesystem where possible.
- Never deploy
:latest. Pin a version tag or a digest. - Secrets never live in ConfigMaps. RBAC grants least privilege, never
*.