registry/deploy/pkg/k8s/deploy.go
adam jones 03ac9c955e
Add database backup functionality with GCS integration (#297)
<!-- Provide a brief summary of your changes -->
Implements automated database backup functionality with Google Cloud
Storage integration, including retention policies and MinIO support for
local development.

## Motivation and Context
<!-- Why is this change needed? What problem does it solve? -->
This change adds critical database backup capabilities to ensure data
durability and disaster recovery. The solution provides automated
backups with configurable retention policies and supports both
production (GCS) and development (MinIO) environments.

## How Has This Been Tested?
<!-- Have you tested this in a real application? Which scenarios were
tested? -->
- Tested backup creation and restoration with MinIO in local development
- Verified GCS bucket lifecycle policies for automatic deletion after 60
days
- Tested backup retention and cleanup logic

## Breaking Changes
<!-- Will users need to update their code or configurations? -->
No breaking changes. This is an additive feature that doesn't affect
existing functionality.

## Types of changes
<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [x] Documentation update

## Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [x] My code follows the repository's style guidelines
- [x] New and existing tests pass locally
- [x] I have added appropriate error handling
- [x] I have added or updated documentation as needed

## Additional context
<!-- Add any other context, implementation notes, or design decisions
-->
- Implements 60-day retention period for backups as a safety net
- Uses GCS lifecycle rules for automatic cleanup
- Includes MinIO setup instructions for local development testing
- Port-forwarding commands updated for consistency across documentation
- Fixes #184
2025-08-25 17:27:40 +01:00

43 lines
1.1 KiB
Go

package k8s
import (
corev1 "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/core/v1"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/modelcontextprotocol/registry/deploy/infra/pkg/providers"
)
// DeployAll orchestrates the complete deployment of the MCP Registry to Kubernetes
func DeployAll(ctx *pulumi.Context, cluster *providers.ProviderInfo, backupStorage *providers.BackupStorageInfo, environment string) (service *corev1.Service, err error) {
// Setup cert-manager
err = SetupCertManager(ctx, cluster)
if err != nil {
return nil, err
}
// Setup ingress controller
ingressNginx, err := SetupIngressController(ctx, cluster, environment)
if err != nil {
return nil, err
}
// Deploy PostgreSQL databases
pgCluster, err := DeployPostgresDatabases(ctx, cluster, environment)
if err != nil {
return nil, err
}
// Deploy k8up backup operator
err = DeployK8up(ctx, cluster, environment, backupStorage)
if err != nil {
return nil, err
}
// Deploy MCP Registry
service, err = DeployMCPRegistry(ctx, cluster, environment, ingressNginx, pgCluster)
if err != nil {
return nil, err
}
return service, nil
}