Top Related Projects
Deploy a Production Ready Kubernetes Cluster
A few starter examples of ansible playbooks, to show features and how they work together. See http://galaxy.ansible.com for example roles from the Ansible community for deploying many popular applications.
Kubernetes Operations (kOps) - Production Grade k8s Installation, Upgrades and Management
The Kubernetes Package Manager
Complete container management platform
Quick Overview
OpenShift-Ansible is a set of Ansible playbooks and roles for installing, upgrading, and managing OpenShift clusters. It provides a flexible and automated way to deploy and maintain OpenShift environments, supporting various configurations and deployment scenarios.
Pros
- Automated deployment and management of OpenShift clusters
- Highly customizable and configurable to suit different environments
- Supports various deployment scenarios (single-node, multi-node, etc.)
- Integrates well with existing infrastructure and CI/CD pipelines
Cons
- Steep learning curve for users unfamiliar with Ansible or OpenShift
- Complex configuration options can be overwhelming for beginners
- Requires careful planning and understanding of OpenShift architecture
- May require frequent updates to keep up with OpenShift releases
Getting Started
To get started with OpenShift-Ansible, follow these steps:
-
Clone the repository:
git clone https://github.com/openshift/openshift-ansible.git cd openshift-ansible
-
Install Ansible and required dependencies:
pip install ansible openshift
-
Create an inventory file with your cluster configuration:
[OSEv3:children] masters nodes etcd [OSEv3:vars] ansible_ssh_user=root openshift_deployment_type=origin [masters] master.example.com [etcd] master.example.com [nodes] master.example.com openshift_node_group_name='node-config-master' node1.example.com openshift_node_group_name='node-config-compute' node2.example.com openshift_node_group_name='node-config-compute'
-
Run the playbook to deploy OpenShift:
ansible-playbook -i inventory/hosts playbooks/deploy_cluster.yml
Note: This is a simplified example. Actual deployment may require additional configuration and prerequisites depending on your specific environment and requirements.
Competitor Comparisons
Deploy a Production Ready Kubernetes Cluster
Pros of kubespray
- More flexible and customizable for various Kubernetes distributions
- Supports multi-cloud and bare-metal deployments
- Active community development and frequent updates
Cons of kubespray
- Steeper learning curve for beginners
- Less integrated with specific cloud providers compared to OpenShift
- May require more manual configuration for advanced features
Code Comparison
kubespray:
all:
vars:
ansible_user: ubuntu
ansible_become: true
kubespray_version: v2.18.0
kube_version: v1.22.0
cluster_name: mycluster
openshift-ansible:
openshift_deployment_type: origin
openshift_release: "3.11"
openshift_master_default_subdomain: apps.example.com
openshift_master_cluster_hostname: master.example.com
openshift_master_cluster_public_hostname: master.example.com
Key Differences
- kubespray is more focused on vanilla Kubernetes deployments, while openshift-ansible is specifically tailored for OpenShift
- openshift-ansible includes additional components and features specific to the OpenShift ecosystem
- kubespray offers more flexibility in terms of networking and container runtime options
- openshift-ansible provides a more opinionated and integrated solution for enterprise environments
Both projects use Ansible for deployment and configuration management, but their target environments and use cases differ significantly.
A few starter examples of ansible playbooks, to show features and how they work together. See http://galaxy.ansible.com for example roles from the Ansible community for deploying many popular applications.
Pros of ansible-examples
- Broader scope, covering various Ansible use cases and scenarios
- More beginner-friendly with simpler examples and explanations
- Regularly updated with new examples and best practices
Cons of ansible-examples
- Less focused on specific enterprise applications or platforms
- May lack depth for complex, production-ready deployments
- Not tailored for OpenShift-specific configurations and requirements
Code Comparison
ansible-examples:
---
- hosts: webservers
vars:
http_port: 80
max_clients: 200
tasks:
- name: ensure apache is at the latest version
yum: name=httpd state=latest
openshift-ansible:
---
- name: Configure OpenShift
hosts: oo_masters_to_config
roles:
- openshift_facts
- openshift_master
- openshift_node
The ansible-examples repository provides general-purpose Ansible playbooks for various scenarios, while openshift-ansible focuses specifically on OpenShift deployment and configuration. The code snippets demonstrate this difference, with ansible-examples showing a simple web server setup and openshift-ansible displaying OpenShift-specific roles and configurations.
Kubernetes Operations (kOps) - Production Grade k8s Installation, Upgrades and Management
Pros of kops
- Simpler and more lightweight, focusing specifically on Kubernetes cluster deployment
- Supports multiple cloud providers (AWS, GCP, DigitalOcean) out of the box
- Easier to get started with for pure Kubernetes deployments
Cons of kops
- Limited to Kubernetes-only deployments, lacking additional features provided by OpenShift
- Less extensive enterprise support compared to OpenShift's offerings
- May require more manual configuration for advanced scenarios
Code Comparison
kops example:
kops create cluster --zones=us-west-2a --name=mydomain.com
kops update cluster mydomain.com --yes
openshift-ansible example:
- hosts: masters
roles:
- openshift_master
- openshift_node
Key Differences
- openshift-ansible is designed for OpenShift, which includes Kubernetes plus additional features
- kops is more focused on pure Kubernetes deployments
- openshift-ansible uses Ansible playbooks, while kops uses its own CLI and configuration files
- kops has built-in support for multiple cloud providers, while openshift-ansible is more flexible but may require additional configuration
Both tools aim to simplify cluster deployment, but they cater to different use cases and levels of complexity. kops is generally easier for simple Kubernetes deployments, while openshift-ansible offers more features and customization options for enterprise environments.
The Kubernetes Package Manager
Pros of Helm
- Lightweight and easy to use package manager for Kubernetes
- Supports templating and versioning of application deployments
- Large ecosystem of pre-built charts for common applications
Cons of Helm
- Less comprehensive than OpenShift-Ansible for full cluster management
- May require additional tools for complete infrastructure provisioning
- Limited to Kubernetes, while OpenShift-Ansible covers broader OpenShift features
Code Comparison
OpenShift-Ansible (playbook example):
- name: Install OpenShift
hosts: masters
tasks:
- name: Install OpenShift packages
yum:
name: atomic-openshift
state: present
Helm (chart example):
apiVersion: v2
name: my-app
version: 1.0.0
dependencies:
- name: nginx
version: 1.2.3
repository: https://charts.bitnami.com/bitnami
OpenShift-Ansible focuses on full cluster provisioning and management, while Helm specializes in application deployment and package management within Kubernetes environments. OpenShift-Ansible provides more extensive control over the entire OpenShift ecosystem, whereas Helm offers a simpler, more portable solution for deploying applications across different Kubernetes clusters.
Complete container management platform
Pros of Rancher
- Easier to install and manage, with a user-friendly web UI
- Supports multiple Kubernetes distributions and cloud providers
- More lightweight and flexible for smaller deployments
Cons of Rancher
- Less enterprise-focused features compared to OpenShift
- Smaller ecosystem and community support
- May require additional tools for advanced networking and security
Code Comparison
OpenShift-Ansible uses Ansible playbooks for deployment:
- name: Install OpenShift
hosts: all
roles:
- openshift_node
- openshift_control_plane
Rancher uses Docker commands for installation:
docker run -d --restart=unless-stopped \
-p 80:80 -p 443:443 \
--privileged \
rancher/rancher:latest
Summary
OpenShift-Ansible is a more comprehensive, enterprise-grade solution with a steeper learning curve, while Rancher offers a more accessible and flexible approach to Kubernetes management. OpenShift-Ansible excels in large, complex deployments, whereas Rancher is well-suited for smaller to medium-sized environments and those new to container orchestration. The choice between the two depends on specific organizational needs, existing infrastructure, and team expertise.
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
OpenShift Ansible
This repository contains Ansible roles and playbooks for OpenShift clusters.
Previous OpenShift Ansible 3.x releases
For 3.x releases of OpenShift Ansible please reference the release branch for specific versions. The last 3.x release is 3.11 release.
OpenShift 4.x
Installation of OpenShift 4.x uses a command-line installation wizard instead of Ansible playbooks. Learn more about the OpenShift Installer in this overview.
For OpenShift 4.x, this repository only provides playbooks necessary for scaling up or upgrading RHEL hosts in an existing 4.x cluster.
The master branch tracks our current work in development.
Requirements: (localhost)
- Ansible >= 2.9.5
- OpenShift Client (oc)
Quickstart
Install an OpenShift 4.x cluster
Install a cluster using the OpenShift Installer.
Create an Ansible Inventory
Create an inventory file with the appropriate groups and variables defined. An example inventory can be found in inventory/hosts.example.
Required variables include:
openshift_kubeconfig_path
- Path to the kubeconfig for the cluster
Run the RHEL node scaleup playbook
cd openshift-ansible
ansible-playbook -i inventory/hosts playbooks/scaleup.yml
Run the RHEL node upgrade playbook
Custom tasks can be performed during upgrades at different stages of the upgrade. See the hooks documentation for more information.
cd openshift-ansible
ansible-playbook -i inventory/hosts playbooks/upgrade.yml
Further reading
Complete Production Installation Documentation:
- OpenShift Container Platform
- OKD (formerly OpenShift Origin)
Containerized OpenShift Ansible
See README_CONTAINER_IMAGE.md for information on how to package openshift-ansible as a container image.
Contributing
See the contribution guide.
Building openshift-ansible RPMs and container images
See the build instructions.
Top Related Projects
Deploy a Production Ready Kubernetes Cluster
A few starter examples of ansible playbooks, to show features and how they work together. See http://galaxy.ansible.com for example roles from the Ansible community for deploying many popular applications.
Kubernetes Operations (kOps) - Production Grade k8s Installation, Upgrades and Management
The Kubernetes Package Manager
Complete container management platform
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