Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 117 additions & 0 deletions content/calculator/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
---
title: "OpenShift Network Calculator"
description: "Calculate network sizing for your OpenShift cluster"

date: '2025-12-05T0:00:00.0000'
tags: ["OSD", "Google", "ROSA", "ARO"]
authors:
- Paul Czarkowski
---

## Overview

The OpenShift Network Calculator helps you determine the network requirements for your OpenShift cluster, specifically designed for clusters using the **OVN-Kubernetes** Container Network Interface (CNI). This tool calculates the number of pods, services, and nodes your network configuration can support, and identifies potential network conflicts with OVN-Kubernetes reserved networks.

Proper network planning is critical when deploying OpenShift clusters, as incorrect CIDR ranges can lead to IP address exhaustion, network conflicts, or connectivity issues. This calculator is particularly useful when planning deployments for:

- **ROSA** (Red Hat OpenShift Service on AWS)
- **ARO** (Azure Red Hat OpenShift)
- **OSD** (OpenShift Dedicated)
- **Self-managed OpenShift** clusters

## Understanding Network Parameters

Before using the calculator, it's important to understand what each network parameter means:

### Host Prefix

The **Host Prefix** (also called the subnet prefix length) determines how many IP addresses are allocated to each individual node in your cluster. This value splits the Cluster Network (Pod CIDR) into subnets, with each node receiving its own subnet.

- **Default value**: `23` (provides 512 IP addresses per node)
- **Range**: 1-32
- **Common values**:
- `/23` = 512 IPs per node (suitable for most workloads)
- `/22` = 1,024 IPs per node (for high pod density)
- `/24` = 256 IPs per node (for smaller clusters)

### Cluster Network (Pod CIDR)

The **Cluster Network** (also called Pod CIDR) is the IP address range from which pod IP addresses are allocated. This is the primary network used by your workloads.

- **ROSA default**: `10.128.0.0/14`
- **ARO default**: `10.128.0.0/14`
- This network is used exclusively for intra-cluster pod communication

### Service Network (Service CIDR)

The **Service Network** is the IP address range used by Kubernetes Services. Each Service gets a virtual IP from this range.

- **ROSA default**: `172.30.0.0/16`
- **ARO default**: `172.30.0.0/16`
- This provides 65,536 service IP addresses

### Machine Network (Machine CIDR)

The **Machine Network** is the IP address range used by the underlying infrastructure (nodes, load balancers, etc.). This typically corresponds to your VPC or virtual network CIDR.

- **ROSA default**: `10.0.0.0/16`
- **ARO default**: Varies (typically `10.0.0.0/16` or similar)
- This should match or be a subset of your cloud provider's VPC CIDR

## OVN-Kubernetes Reserved Networks

OVN-Kubernetes uses two reserved network ranges that **must not overlap** with your cluster, service, or machine networks:

- **Join Switch**: `100.64.0.0/16`
- **Transit Switch**: `100.88.0.0/16`

The calculator automatically checks for conflicts with these reserved ranges and will alert you if any overlap is detected.

## Using the Calculator

1. **Enter your network parameters** - The calculator is pre-populated with ROSA default values, but you can modify them to match your specific requirements.

2. **Click Calculate** - The calculator will:
- Validate your input values
- Calculate the number of pods, services, and nodes supported
- Determine pods per node (accounting for OVN-Kubernetes reserved IPs)
- Check for network conflicts

3. **Review the results** - Pay special attention to:
- **Network Conflict**: Should be "No" - if it shows "Yes", you need to adjust your CIDR ranges
- **Nodes (Want)**: The number of nodes your configuration can support
- **Nodes (Have)**: The number of nodes available in your machine network
- **Pods per Node**: The actual usable pods per node (after OVN reservations)

## Important Considerations

### Network Overlap

- **Pod and Service CIDRs** can overlap between clusters if they're isolated, but should never conflict with other non-OpenShift resources on your network
- **Machine CIDR** should be unique across all environments and follow your organization's IPAM scheme
- The Machine CIDR must not overlap with OVN reserved networks (`100.64.0.0/16` and `100.88.0.0/16`)

### Pod Density

OVN-Kubernetes reserves 3 IP addresses per node for internal networking. The calculator accounts for this when calculating pods per node.

### Multi-AZ Deployments

For highly available clusters spanning multiple availability zones, ensure your Machine CIDR is large enough to accommodate nodes across all zones. Each availability zone requires its own subnet within your VPC.

### Scaling Considerations

When planning your network:
- Consider future growth - choose CIDR ranges that allow for cluster expansion
- Account for autoscaling - ensure you have enough IP space for maximum node count
- Plan for multiple clusters - if deploying multiple clusters, ensure their networks don't overlap

## Calculator

{{< network-calculator >}}

## Additional Resources

- [ROSA Network CIDR Documentation]({{< relref "/rosa/ip-addressing-and-subnets" >}})
- [OpenShift Networking Documentation](https://docs.openshift.com/container-platform/latest/networking/understanding-networking.html)
- [OVN-Kubernetes Architecture](https://docs.openshift.com/container-platform/latest/networking/ovn_kubernetes_network_provider/about-ovn-kubernetes.html)
25 changes: 25 additions & 0 deletions layouts/calculator/single.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!-- Simple Hugo Page Template for Standalone Calculator -->
<!-- Copy this to: layouts/_default/single.html or layouts/calculator/single.html -->
<!-- This version integrates with your existing Hugo theme -->

{{ define "main" }}
<div class="calculator-page">
{{ if .Title }}
<header class="page-header">
<h1>{{ .Title }}</h1>
{{ if .Description }}
<p class="page-description">{{ .Description }}</p>
{{ end }}
</header>
{{ end }}

<div class="page-content">
{{ .Content }}
</div>

<!-- Include calculator -->
<link rel="stylesheet" href="{{ "/experts/calculator/css/network-calculator.css" | relURL }}">
<script src="{{ "/experts/calculator/javascript/network-calculator.js" | relURL }}"></script>
{{ readFile "/experts/calculator/network-calculator-embed.html" | safeHTML }}
</div>
{{ end }}
4 changes: 4 additions & 0 deletions layouts/shortcodes/network-calculator.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{{/* Hugo Shortcode: network-calculator - Usage: {{< network-calculator >}} */}}
<link rel="stylesheet" href="{{ "/experts/calculator/css/network-calculator.css" | relURL }}">
<script src="{{ "/experts/calculator/javascript/network-calculator.js" | relURL }}"></script>
{{ readFile "static/calculator/network-calculator-embed.html" | safeHTML }}
226 changes: 226 additions & 0 deletions static/calculator/css/network-calculator.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
/* OpenShift Network Calculator Styles */

.network-calculator {
max-width: 800px;
margin: 0 auto;
padding: 16px;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
font-size: 14px;
}

.ovn-info {
margin-top: 16px;
padding: 12px;
background-color: #f8f9fa;
border-radius: 4px;
border-left: 4px solid #0066cc;
}

.ovn-info h4 {
margin-top: 0;
color: #333;
font-size: 16px;
}

.ovn-info p {
margin-bottom: 8px;
color: #555;
font-size: 14px;
}

.ovn-info ul {
margin: 0;
padding-left: 20px;
color: #555;
font-size: 14px;
}

.ovn-info code {
background-color: #e9ecef;
padding: 2px 6px;
border-radius: 3px;
font-family: 'Courier New', monospace;
font-size: 13px;
}

.ovn-info em {
color: #666;
font-size: 13px;
}

.network-calculator h2 {
margin-top: 0;
color: #333;
border-bottom: 2px solid #0066cc;
padding-bottom: 8px;
font-size: 20px;
}

.network-calculator h3 {
margin-top: 8px;
margin-bottom: 16px;
color: #555;
font-size: 14px;
font-weight: 500;
}

.calculator-form {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 16px;
margin-bottom: 16px;
}

.form-group {
display: flex;
flex-direction: column;
}

.form-group.full-width {
grid-column: 1 / -1;
}

.form-group label {
font-weight: 500;
margin-bottom: 4px;
color: #555;
font-size: 14px;
}

.form-group input {
padding: 8px 12px;
border: 1px solid #ddd;
border-radius: 4px;
font-size: 14px;
transition: border-color 0.3s;
}

.form-group input:focus {
outline: none;
border-color: #0066cc;
box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.1);
}

.form-group input.error {
border-color: #dc3545;
}

.error-message {
color: #dc3545;
font-size: 12px;
margin-top: 5px;
display: none;
}

.error-message.show {
display: block;
}

.calculate-button {
grid-column: 1 / -1;
padding: 10px 20px;
background-color: #0066cc;
color: white;
border: none;
border-radius: 4px;
font-size: 14px;
font-weight: 600;
cursor: pointer;
transition: background-color 0.3s;
}

.calculate-button:hover {
background-color: #0052a3;
}

.calculate-button:active {
background-color: #003d7a;
}

.calculate-button:disabled {
background-color: #ccc;
cursor: not-allowed;
}

.results-container {
margin-top: 20px;
padding: 16px;
background-color: #f8f9fa;
border-radius: 4px;
border: 1px solid #dee2e6;
}

.results-container h3 {
margin-top: 0;
color: #333;
font-size: 16px;
}

.results-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 15px;
margin-top: 15px;
}

.result-item {
padding: 12px;
background-color: white;
border-radius: 4px;
border: 1px solid #dee2e6;
}

.result-item label {
display: block;
font-size: 12px;
color: #666;
text-transform: uppercase;
letter-spacing: 0.5px;
margin-bottom: 5px;
}

.result-item .value {
font-size: 16px;
font-weight: 600;
color: #333;
}

.result-item .value.conflict {
color: #dc3545;
}

.result-item .value.no-conflict {
color: #28a745;
}

.result-json {
margin-top: 20px;
padding: 15px;
background-color: #282c34;
color: #abb2bf;
border-radius: 4px;
overflow-x: auto;
font-family: 'Courier New', monospace;
font-size: 13px;
line-height: 1.5;
}

.result-json pre {
margin: 0;
white-space: pre-wrap;
word-wrap: break-word;
}

@media (max-width: 768px) {
.calculator-form {
grid-template-columns: 1fr;
}

.calculate-button {
grid-column: 1;
}

.results-grid {
grid-template-columns: 1fr;
}
}
Loading