Skip to content
Draft
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
2 changes: 1 addition & 1 deletion bin/controller-gen
29 changes: 29 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Documentation

This directory contains various documentation for the OpenAPI Aggregator Operator.

## Files

- **[olm-install.md](olm-install.md)** - Installation guide using Operator Lifecycle Manager
- **[medium-article.md](medium-article.md)** - Full Medium article introducing the operator
- **[medium-article-short.md](medium-article-short.md)** - Condensed version for quicker reading
- **[medium-publishing-guide.md](medium-publishing-guide.md)** - Guide for publishing articles on Medium

## Medium Articles

The Medium articles are designed to introduce the OpenAPI Aggregator Operator to a broader audience beyond just the technical README. They focus on:

- **Problem-solution narrative**: Starting with the pain points developers face
- **Practical examples**: Real-world scenarios and use cases
- **Quick wins**: Showing immediate value and benefits
- **Accessibility**: Written for developers who may not be Kubernetes experts

These articles can be published on Medium, company blogs, or used as reference material for presentations and demos.

## Contributing

When adding new documentation:
1. Keep technical docs in this directory
2. Use clear, descriptive filenames
3. Update this README when adding new files
4. Consider the target audience for each document
107 changes: 107 additions & 0 deletions docs/medium-article-short.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Solving API Chaos in Kubernetes with One Simple Operator

*Stop juggling multiple Swagger UIs and discover all your APIs in one place*

If you've worked with microservices in Kubernetes, you've felt this pain: hunting down API documentation across dozens of services, each with its own Swagger UI endpoint, each requiring its own port-forward command. What if there was a better way?

## The Problem Every Kubernetes Team Faces

Your production cluster runs 20+ microservices. Each has its own API. When you need to test an integration or onboard a new developer, you find yourself:

- Digging through Kubernetes manifests to find API endpoints
- Running multiple `kubectl port-forward` commands
- Switching between browser tabs with different Swagger UIs
- Asking teammates "Where's the docs for the payment service?"

This isn't just inconvenient β€” it's a productivity killer.

## The Solution: OpenAPI Aggregator Operator

The OpenAPI Aggregator Operator automatically discovers APIs in your cluster and presents them in a unified Swagger UI. Think of it as having one dashboard for all your APIs, updated in real-time.

Here's how simple it is:

### 1. Install the Operator
```bash
kubectl apply -f https://raw.githubusercontent.com/hellices/openapi-aggregator-operator/main/install.yaml
```

### 2. Mark Your Services
Add one annotation to services that expose APIs:
```yaml
metadata:
annotations:
openapi.aggregator.io/swagger: "true"
```

### 3. Create the Aggregator
```yaml
apiVersion: observability.aggregator.io/v1alpha1
kind: OpenAPIAggregator
metadata:
name: api-aggregator
spec:
watchNamespaces: [""] # Watch all namespaces
```

### 4. Deploy Swagger UI
```yaml
apiVersion: observability.aggregator.io/v1alpha1
kind: SwaggerServer
metadata:
name: unified-apis
spec:
port: 9090
```

### 5. Access Your APIs
```bash
kubectl port-forward svc/unified-apis 9090:9090
```

Open http://localhost:9090 β€” every API in your cluster, in one interface.

## Real Impact

**Before**: 30 minutes to find and test an API across 3 different services.
**After**: 2 minutes to browse, select, and test any API from one dashboard.

**Before**: New developers spend their first day figuring out where documentation lives.
**After**: One URL gives them access to every API in the system.

## Advanced Features

**Namespace Control**: Only watch specific namespaces for sensitive environments.

**Ingress Integration**: Share the dashboard with your entire team.

**Method Filtering**: Control which HTTP methods are exposed per service.

## Why This Matters

This isn't just about convenience. It's about:
- **Developer Velocity**: Less time hunting, more time building
- **Team Collaboration**: Self-service API discovery across teams
- **Quality**: Visible APIs tend to be better documented
- **Onboarding**: New team members become productive faster

## Try It Now

The operator is:
- βœ… Open source (Apache 2.0)
- βœ… Production-ready
- βœ… Easy to install and remove
- βœ… Compatible with existing setups

**Get started**: https://github.com/hellices/openapi-aggregator-operator

Your scattered API documentation problem can be solved in 15 minutes. The only question is: what are you waiting for?

---

**Resources:**
- [GitHub Repository](https://github.com/hellices/openapi-aggregator-operator)
- [Full Documentation](https://github.com/hellices/openapi-aggregator-operator/blob/main/README.md)
- [Quick Start Guide](https://github.com/hellices/openapi-aggregator-operator#quick-start)

*Follow for more Kubernetes solutions that solve real developer problems.*
241 changes: 241 additions & 0 deletions docs/medium-article.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,241 @@
# Simplifying API Management in Kubernetes: Meet the OpenAPI Aggregator Operator

*How a single operator can transform the way you discover, manage, and interact with APIs across your Kubernetes clusters*

![Header Image: A unified dashboard showing multiple API endpoints in one interface]

If you've ever worked with microservices in Kubernetes, you know the pain: dozens of services, each with its own API documentation scattered across different endpoints, different formats, and often buried in Kubernetes configurations that are hard to navigate. As your cluster grows, so does the chaos of managing API documentation.

What if I told you there's a way to automatically discover all your APIs, aggregate their documentation, and present them in a beautiful, unified Swagger UI interface? Enter the **OpenAPI Aggregator Operator** β€” a Kubernetes-native solution that brings order to API chaos.

## The Problem: API Documentation Scattered Everywhere

Picture this: You're a developer joining a new team. Your mission? Understand the 15 microservices running in the production Kubernetes cluster. Each service has its own API, its own documentation format, and its own way of being accessed. You spend hours:

- Port-forwarding to individual services
- Hunting down API documentation URLs
- Switching between different Swagger UI instances
- Trying to remember which service does what

Sound familiar? This is the reality for most teams running microservices architectures.

## The Solution: Centralized API Discovery and Management

The OpenAPI Aggregator Operator solves this problem elegantly by introducing two key concepts:

1. **Automatic API Discovery** β€” It watches your Kubernetes services and automatically finds those exposing OpenAPI/Swagger specifications
2. **Unified Interface** β€” It aggregates all discovered APIs into a single, beautiful Swagger UI interface

Think of it as having a personal assistant that continuously monitors your cluster, finds all your APIs, and maintains an up-to-date catalog that you can browse from one place.

## How It Works: The Magic Behind the Scenes

The operator introduces two custom resources that work together:

### OpenAPIAggregator: The Discovery Engine

This is your API hunter. You tell it where to look (which namespaces), and it continuously scans for services that have been marked with a simple annotation:

```yaml
metadata:
annotations:
openapi.aggregator.io/swagger: "true"
```

That's it! Any service with this annotation gets automatically discovered and its API specification is collected.

### SwaggerServer: The Presentation Layer

This component takes all the discovered APIs and presents them in a clean, unified Swagger UI. No more juggling multiple browser tabs or trying to remember which port-forward command you need.

## Real-World Use Cases

### 1. Developer Onboarding
New team members can instantly see all available APIs in your cluster without needing to ask "Where's the documentation for service X?"

### 2. API Testing and Debugging
QA engineers and developers can test APIs directly from the centralized interface, making it easy to validate integrations and debug issues.

### 3. API Governance
Platform teams can easily audit which services expose APIs, ensure documentation standards are met, and identify undocumented services.

### 4. Cross-Team Collaboration
Different teams can discover and understand each other's APIs without complex setup procedures or tribal knowledge.

## Getting Started: From Zero to API Nirvana

Let's walk through setting this up in your cluster. Don't worry β€” it's surprisingly simple.

### Step 1: Install the Operator

```bash
kubectl apply -f https://raw.githubusercontent.com/hellices/openapi-aggregator-operator/main/install.yaml
```

This installs the operator in your cluster. No complex configurations needed.

### Step 2: Mark Your Services

For each service that exposes an API, add a simple annotation:

```yaml
apiVersion: v1
kind: Service
metadata:
name: user-service
annotations:
openapi.aggregator.io/swagger: "true"
openapi.aggregator.io/path: "/api-docs" # Optional: defaults to /v2/api-docs
openapi.aggregator.io/port: "8080" # Optional: defaults to 8080
spec:
ports:
- port: 8080
targetPort: 8080
selector:
app: user-service
```

### Step 3: Create the Aggregator

Deploy an OpenAPIAggregator resource to start the discovery process:

```yaml
apiVersion: observability.aggregator.io/v1alpha1
kind: OpenAPIAggregator
metadata:
name: my-api-aggregator
namespace: default
spec:
# Watch services in all namespaces
watchNamespaces: [""]
defaultPath: "/v2/api-docs"
defaultPort: "8080"
```

### Step 4: Deploy the Swagger UI

Create a SwaggerServer to provide the unified interface:

```yaml
apiVersion: observability.aggregator.io/v1alpha1
kind: SwaggerServer
metadata:
name: api-dashboard
namespace: default
spec:
port: 9090
```

### Step 5: Access Your Unified API Dashboard

```bash
kubectl port-forward svc/api-dashboard 9090:9090
```

Open http://localhost:9090 in your browser, and voilΓ ! All your APIs in one beautiful interface.

## Advanced Features: Beyond the Basics

### Namespace Control
You can fine-tune which namespaces to scan:

```yaml
spec:
# Only watch specific namespaces
watchNamespaces: ["production", "staging"]
```

### Ingress Integration
Expose your API dashboard through an ingress for team-wide access:

```yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: api-dashboard
spec:
rules:
- host: apis.yourcompany.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: api-dashboard
port:
number: 9090
```

### Method Filtering
Control which HTTP methods are exposed:

```yaml
metadata:
annotations:
openapi.aggregator.io/allowed-methods: "get,post"
```

## The Technical Architecture: For the Curious

Under the hood, the operator follows Kubernetes best practices:

1. **Controller Pattern**: Two controllers watch for their respective custom resources
2. **ConfigMap Storage**: Discovered API metadata is stored in a ConfigMap
3. **Decoupled Design**: Discovery and presentation are separate concerns
4. **Real-time Updates**: Changes to your services are reflected immediately

## Why This Matters: The Bigger Picture

This isn't just about convenience (though that's a huge win). It's about:

- **Reducing Cognitive Load**: Developers can focus on building, not hunting for documentation
- **Improving API Quality**: When APIs are visible, they tend to be better documented
- **Enabling Self-Service**: Teams can discover and use each other's APIs independently
- **Supporting Governance**: Platform teams gain visibility into their API landscape

## Production Considerations

### Security
The operator respects Kubernetes RBAC. It only watches resources it has permission to see.

### Performance
The operator is lightweight and designed to scale with your cluster. It only processes services with the required annotations.

### Reliability
Built on the battle-tested controller-runtime framework, it's designed for production workloads.

## What's Next?

The OpenAPI Aggregator Operator is actively developed with features like:
- Enhanced filtering capabilities
- Custom UI themes
- Metrics and monitoring integration
- Multi-cluster support

## Try It Today

The best way to understand the value is to try it yourself. The operator is:
- βœ… Open source (Apache 2.0 license)
- βœ… Production-ready
- βœ… Easy to install and remove
- βœ… Well-documented

**Get started**: https://github.com/hellices/openapi-aggregator-operator

## Conclusion

Managing APIs in Kubernetes doesn't have to be chaotic. With the OpenAPI Aggregator Operator, you can transform your scattered API landscape into a unified, discoverable, and maintainable system.

Your future self (and your teammates) will thank you.

---

*Want to see more Kubernetes solutions like this? Follow me for more insights on simplifying cloud-native development.*

**Resources:**
- [GitHub Repository](https://github.com/hellices/openapi-aggregator-operator)
- [Documentation](https://github.com/hellices/openapi-aggregator-operator/blob/main/README.md)
- [Installation Guide](https://github.com/hellices/openapi-aggregator-operator#quick-start)

**Tags:** #Kubernetes #API #Microservices #DevOps #OpenAPI #Swagger #CloudNative #Operator
Loading