openshift

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

OpenShift

OpenShift

Red Hat OpenShift is an enterprise-ready Kubernetes container platform with full-stack automated operations. In 2025, OpenShift Virtualization (running VMs side-by-side with containers) is a key feature.
Red Hat OpenShift 是一款具备全栈自动化运维能力的企业级 Kubernetes 容器平台。2025年,OpenShift Virtualization(将虚拟机与容器并行运行)是一项关键功能。

When to Use

适用场景

  • Hybrid Cloud: Consistent experience across On-Prem and Cloud.
  • Enterprise Requirements: Built-in strict security (SCC), registry, monitoring, and CI/CD.
  • VM Migration: Lift-and-shift VMs into K8s using OpenShift Virtualization (KubeVirt).
  • 混合云:在本地数据中心与云环境中提供一致的使用体验。
  • 企业级需求:内置严格的安全机制(SCC)、镜像仓库、监控以及CI/CD能力。
  • 虚拟机迁移:借助OpenShift Virtualization(KubeVirt)将虚拟机直接迁移至K8s环境。

Quick Start (OC CLI)

快速开始(OC CLI)

bash
undefined
bash
undefined

Login

Login

oc login -u developer -p developer https://api.crc.testing:6443
oc login -u developer -p developer https://api.crc.testing:6443

Create Project (Namespace)

Create Project (Namespace)

oc new-project my-app
oc new-project my-app

Deploy from Source (Source-to-Image)

Deploy from Source (Source-to-Image)

undefined
undefined

Core Concepts

核心概念

Source-to-Image (S2I)

Source-to-Image (S2I)

Build container images directly from source code without writing a Dockerfile. OpenShift detects the language (Node/Java/Python) and builds it.
无需编写Dockerfile,直接从源代码构建容器镜像。OpenShift会自动检测编程语言(Node/Java/Python等)并完成构建。

Routes

Routes

OpenShift's native ingress controller. Used long before K8s Ingress/Gateway API.
OpenShift原生的Ingress控制器,在K8s Ingress/Gateway API出现之前就已被广泛使用。

Operators

Operators

First-class citizens. Everything in OpenShift is managed by an Operator.
一等公民角色,OpenShift中的所有组件均由Operator进行管理。

Best Practices (2025)

2025年最佳实践

Do:
  • Use OpenShift GitOps: ArgoCD is fully integrated.
  • Use
    oc
    : It is a superset of
    kubectl
    . You rarely need
    kubectl
    on OpenShift.
  • Leverage Virtualization: Run legacy Windows/Linux VMs as Pods to decommission old VMWare clusters.
Don't:
  • Don't run as root: OpenShift forbids this by default. Don't disable SCCs (Security Context Constraints) just to make a bad image work. Fix the image.
推荐做法
  • 使用OpenShift GitOps:ArgoCD已完全集成其中。
  • 使用
    oc
    命令
    :它是
    kubectl
    的超集,在OpenShift环境中几乎不需要使用
    kubectl
  • 利用虚拟化功能:将遗留的Windows/Linux虚拟机以Pod形式运行,从而淘汰旧的VMWare集群。
不推荐做法
  • 不要以root身份运行:OpenShift默认禁止此操作。不要为了让有问题的镜像正常运行而禁用SCC(安全上下文约束),应修复镜像本身。

References

参考资料