Top Related Projects
Production-Grade Container Scheduling and Management
Complete container management platform
The Moby Project - a collaborative project for the container ecosystem to assemble container-based systems
The Kubernetes Package Manager
Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a source-available tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.
Backup and migrate Kubernetes applications and their persistent volumes
Quick Overview
OpenShift Origin is the open-source upstream project for Red Hat OpenShift, a container application platform that brings Docker and Kubernetes to the enterprise. It provides a complete platform for application development, deployment, and management, with a focus on DevOps and cloud-native applications.
Pros
- Comprehensive container orchestration platform built on Kubernetes
- Robust security features, including built-in authentication and authorization
- Integrated CI/CD pipelines and developer tools
- Supports multiple cloud providers and on-premises deployments
Cons
- Steeper learning curve compared to vanilla Kubernetes
- Resource-intensive, requiring significant hardware resources
- Some features may be limited in the open-source version compared to the enterprise offering
- Documentation can be fragmented or outdated at times
Getting Started
To get started with OpenShift Origin (now called OKD), follow these steps:
-
Install the
oc
command-line tool:wget https://github.com/openshift/okd/releases/download/4.10.0-0.okd-2022-03-07-131213/openshift-client-linux-4.10.0-0.okd-2022-03-07-131213.tar.gz tar -xvf openshift-client-linux-4.10.0-0.okd-2022-03-07-131213.tar.gz sudo mv oc /usr/local/bin/
-
Start a local cluster:
oc cluster up
-
Log in to the cluster:
oc login -u system:admin
-
Create a new project:
oc new-project myproject
-
Deploy a sample application:
oc new-app https://github.com/sclorg/cakephp-ex
For more detailed instructions and advanced configurations, refer to the official OpenShift documentation.
Competitor Comparisons
Production-Grade Container Scheduling and Management
Pros of Kubernetes
- More flexible and customizable for diverse infrastructure needs
- Larger community and ecosystem of tools/extensions
- Faster release cycle for new features and updates
Cons of Kubernetes
- Steeper learning curve and more complex setup
- Requires more manual configuration and management
- Less integrated security features out-of-the-box
Code Comparison
Kubernetes deployment example:
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.14.2
ports:
- containerPort: 80
OpenShift deployment example:
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
name: nginx-deployment
spec:
replicas: 3
selector:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.14.2
ports:
- containerPort: 80
The main difference is in the apiVersion
and kind
fields, reflecting OpenShift's additional abstraction layer and integrated features.
Complete container management platform
Pros of Rancher
- Easier to install and set up, with a more user-friendly interface
- Supports multiple Kubernetes distributions and cloud providers
- Lightweight and consumes fewer resources
Cons of Rancher
- Less extensive enterprise features and support options
- Smaller ecosystem and community compared to OpenShift
- Limited built-in CI/CD capabilities
Code Comparison
OpenShift Origin:
apiVersion: v1
kind: DeploymentConfig
metadata:
name: example
spec:
replicas: 3
template:
spec:
containers:
- name: example
image: example:latest
Rancher:
apiVersion: apps/v1
kind: Deployment
metadata:
name: example
spec:
replicas: 3
template:
spec:
containers:
- name: example
image: example:latest
The main difference in the code examples is that OpenShift uses a DeploymentConfig
resource, which is specific to OpenShift, while Rancher uses the standard Kubernetes Deployment
resource. This highlights OpenShift's more opinionated approach with custom resources, whereas Rancher tends to stick closer to vanilla Kubernetes.
Both platforms offer robust container orchestration capabilities, but they cater to different user needs. OpenShift provides a more comprehensive enterprise solution with additional features and stricter defaults, while Rancher offers flexibility and ease of use across various Kubernetes distributions.
The Moby Project - a collaborative project for the container ecosystem to assemble container-based systems
Pros of Moby
- More lightweight and flexible containerization platform
- Larger community and ecosystem of tools and plugins
- Easier to set up and use for simple container deployments
Cons of Moby
- Less comprehensive enterprise features out-of-the-box
- Requires additional tools for orchestration and management at scale
- Less integrated security features compared to OpenShift
Code Comparison
Moby (Docker) Dockerfile example:
FROM ubuntu:20.04
RUN apt-get update && apt-get install -y nginx
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
OpenShift BuildConfig example:
apiVersion: build.openshift.io/v1
kind: BuildConfig
metadata:
name: sample-build
spec:
source:
git:
uri: https://github.com/sclorg/nginx-ex.git
strategy:
type: Source
sourceStrategy:
from:
kind: ImageStreamTag
name: nginx:1.14
output:
to:
kind: ImageStreamTag
name: sample-app:latest
The Moby example shows a simple Dockerfile for creating a container image, while the OpenShift example demonstrates a more complex build configuration using OpenShift-specific resources.
The Kubernetes Package Manager
Pros of Helm
- Lightweight and focused solely on package management for Kubernetes
- Easier to learn and use for developers new to container orchestration
- More flexible and can be used with various Kubernetes distributions
Cons of Helm
- Less comprehensive than OpenShift, lacking built-in CI/CD and developer tools
- Requires more manual configuration for advanced deployment scenarios
- Limited native security features compared to OpenShift's integrated approach
Code Comparison
Helm chart example:
apiVersion: v2
name: my-app
description: A Helm chart for Kubernetes
version: 0.1.0
appVersion: 1.16.0
OpenShift template example:
apiVersion: template.openshift.io/v1
kind: Template
metadata:
name: my-app-template
objects:
- apiVersion: apps/v1
kind: Deployment
metadata:
name: ${APP_NAME}
The Helm chart focuses on defining the application structure, while the OpenShift template provides a more comprehensive approach, including parameters and objects for deployment within the OpenShift ecosystem.
Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a source-available tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.
Pros of Terraform
- More flexible and cloud-agnostic, supporting multiple providers
- Simpler learning curve and easier to get started with
- Declarative syntax allows for easier infrastructure versioning
Cons of Terraform
- Less comprehensive platform management compared to OpenShift
- Lacks built-in application deployment and scaling features
- May require additional tools for complete infrastructure management
Code Comparison
Terraform:
resource "aws_instance" "example" {
ami = "ami-0c55b159cbfafe1f0"
instance_type = "t2.micro"
}
OpenShift:
apiVersion: apps/v1
kind: Deployment
metadata:
name: example-deployment
spec:
replicas: 3
selector:
matchLabels:
app: example
template:
metadata:
labels:
app: example
spec:
containers:
- name: example
image: example:latest
The Terraform code defines an AWS EC2 instance, while the OpenShift code defines a Kubernetes deployment. Terraform focuses on infrastructure provisioning, whereas OpenShift provides a more comprehensive platform for application deployment and management.
Backup and migrate Kubernetes applications and their persistent volumes
Pros of Velero
- Lightweight and focused solely on backup and disaster recovery
- Cloud-native and Kubernetes-native, supporting multiple cloud providers
- Easy to set up and use, with a simple CLI interface
Cons of Velero
- Limited in scope compared to Origin's full PaaS capabilities
- Lacks built-in application deployment and management features
- May require additional tools for comprehensive cluster management
Code Comparison
Velero (Go):
func (c *backupController) processBackup(key string) error {
namespace, name, err := cache.SplitMetaNamespaceKey(key)
if err != nil {
return errors.Wrap(err, "error splitting key")
}
log := c.logger.WithField("key", key)
Origin (Go):
func (c *DeploymentConfigController) Handle(key string) error {
namespace, name, err := cache.SplitMetaNamespaceKey(key)
if err != nil {
return err
}
deploymentConfig, err := c.dcLister.DeploymentConfigs(namespace).Get(name)
Both repositories use Go and follow similar patterns for handling Kubernetes resources, but Origin's codebase is more extensive due to its broader feature set.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Origin Kubernetes
This repo was previously the core Kubernetes tracking repo for
OKD, and where OpenShift's
hyperkube
and openshift-test
binaries were maintained. As of July
2020, the purpose and maintenance strategy of the repo varies by
branch.
Maintenance of master
and release-x.x
branches for 4.6 and above
These branches no longer include the code required to produce
hyperkube
binaries, and are limited to maintaining the openshift-tests
binary. Responsibility for maintaining hyperkube has transitioned to
the openshift/kubernetes
repo.
Backports and carries against upstream should be proposed to
openshift/kubernetes
. If changes merged to openshift/kubernetes
need to land in origin
, it will be necessary to follow up with a PR
to origin
that bumps the vendoring.
Branch names are correlated across the 2 repositories such that
changes merged to a given branch in openshift/kubernetes
should be
vendored into the same branch in origin
(e.g. master
in
openshift/kubernetes
is vendored into master
in origin
).
NOTE: Vendoring of the master
and release-x.x
branches of
openshift/kubernetes
into the equivalent branches in origin
is
intended to be temporary. At some point in the near future, origin
will switch to vendoring origin-specific branches (e.g
origin-4.6-kubernetes-1.19.2
) to minimize the scope of backports and
carries that need to be considered in the context of
openshift/kubernetes
rebases.
Test annotation rules
Test annotation rules are used to label e2e tests so that they can be filtered or skipped. For example, rules can be defined that match kube e2e tests that are known to be incompatible with openshift and label those tests to be skipped.
Maintenance of test annotation rules is split between the
openshift/kubernetes
and origin
repos to ensure that PRs proposed
to openshift/kubernetes
can be validated against the set of kube e2e
tests known to be compatible with openshift.
Test annotation rules for kubernetes e2e tests are maintained in:
https://github.com/openshift/kubernetes/blob/master/openshift-hack/e2e/annotate/rules.go
Test annotation rules for openshift e2e tests are maintained in:
https://github.com/openshift/origin/blob/master/test/extended/util/annotate/rules.go
Origin vendors the kube rules and applies both the kube and openshift
rules to the set of tests included in the openshift-tests
binary.
In order to update test annotation rules for kube e2e tests, it will be necessary to:
- Update
rules.go
inopenshift/kubernetes
- Bump the version of
openshift/kubernetes
vendored in origin
Vendoring from openshift/kubernetes
These origin branches vendor k8s.io/kubernetes
and some of its
staging repos (e.g. k8s.io/api
) from our
openshift/kubernetes fork.
Upstream staging repos are used where possible, but some tests depends
on functionality that is only present in the fork.
When a change has merged to an openshift/kubernetes
branch that
needs to be vendored into the same branch in origin
, the
hack/update-kube-vendor.sh
helper script simplifies updating the go
module configuration for all dependencies sourced from
openshift/kubernetes
for that branch. The script requires either the
name of a branch or a SHA from openshift/kubernetes
:
$ hack/update-kube-vendor.sh <openshift/kubernetes branch name or SHA>
The script also supports performing a fake bump to validate an as-yet
unmerged change to openshift/kubernetes
. This can be accomplished by
supplying the name of a fork repo as the second argument to the
script:
$ hack/update-kube-vendor.sh <branch name or SHA> github.com/myname/kubernetes
Once the script has executed, the vendoring changes will need to be committed and proposed to the repo.
Working around '410 Gone' error
If the script returns '410 Gone' as per the error that follows, it may be that the golang checksum server does not yet know about the target SHA.
go: k8s.io/kubernetes@v1.21.1 (replaced by github.com/openshift/kubernetes@v1.21.2-0.20210603185452-2dfc46b23003): verifying go.mod: g
ithub.com/openshift/kubernetes@v1.21.2-0.20210603185452-2dfc46b23003/go.mod: reading https://sum.golang.org/lookup/github.com/openshif
t/kubernetes@v1.21.2-0.20210603185452-2dfc46b23003: 410 Gone
server response: not found:
The workaround is to set GOSUMDB=off
to disable the checksum
database for the vendoring update:
$ GOSUMDB=off hack/update-kube-vendor.sh <branch name or SHA>
Maintenance of release-4.5, release-4.4 and release-4.3
Releases prior to 4.6 continue to maintain hyperkube in the origin
repo in the release-4.x
branches. Persistent carries and backports
for those branches should continue to be submitted directly to
origin. openshift/kubernetes
is not involved except for rebases.
End-to-End (e2e) and Extended Tests
End to end tests (e2e) should verify a long set of flows in the product as a user would see them. Two e2e tests should not overlap more than 10% of function and are not intended to test error conditions in detail. The project examples should be driven by e2e tests. e2e tests can also test external components working together.
All e2e tests are compiled into the openshift-tests
binary.
To build the test binary, run make
.
To run a specific test, or an entire suite of tests, read test/extended/README for more information.
Updating external examples
hack/update-external-example.sh
will pull down example files from external
repositories and deposit them under the examples
directory.
Run this script if you need to refresh an example file, or add a new one. See
the script and examples/quickstarts/README.md
for more details.
Top Related Projects
Production-Grade Container Scheduling and Management
Complete container management platform
The Moby Project - a collaborative project for the container ecosystem to assemble container-based systems
The Kubernetes Package Manager
Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a source-available tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.
Backup and migrate Kubernetes applications and their persistent volumes
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot