Skip to content

TykTechnologies/tyk-ops

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

30 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Tyk Control Plane Operations Repository

This repository provides comprehensive deployment solutions for Tyk Control Plane, supporting both traditional script-based deployment and modern GitOps workflows.

πŸš€ Quick Start

Traditional Helm Deployment

# One-command Helm-based deployment
make helm-deploy

GitOps Deployment

# One-command GitOps deployment
make gitops-deploy

πŸ“ Repository Structure

tyk-ops/
β”œβ”€β”€ terraform/                     # Infrastructure as Code
β”‚   └── deployments/control-plane/ # Terraform configurations
β”œβ”€β”€ kubernetes/                    # Kubernetes manifests
β”‚   └── tyk-control-plane/         # Helm values and configs
β”œβ”€β”€ gitops/                        # GitOps manifests
β”‚   β”œβ”€β”€ applications/              # ArgoCD applications
β”‚   β”œβ”€β”€ prerequisites/             # Prerequisites (cert-manager, CRDs)
β”‚   └── control-plane/             # Control plane manifests
β”œβ”€β”€ scripts/                       # Deployment scripts
β”‚   β”œβ”€β”€ install-argocd.sh         # ArgoCD installation
β”‚   β”œβ”€β”€ setup-gitops.sh           # GitOps setup
β”‚   └── [traditional scripts...]
└── docs/                          # Documentation
    β”œβ”€β”€ deployment-playbook.md     # Traditional deployment guide
    └── gitops-deployment-guide.md # GitOps deployment guide

🎯 Deployment Options

1. Traditional Helm-Based Deployment

Perfect for getting started quickly or when you need manual control:

# Deploy infrastructure
terraform apply -var-file="examples/dev.tfvars"

# Extract secrets
./scripts/extract-infrastructure-secrets.sh

# Setup prerequisites
./scripts/setup-cluster-prerequisites.sh

# Deploy Tyk Control Plane
./scripts/deploy-tyk-control-plane.sh

Benefits:

  • Quick setup
  • Manual control
  • Easy troubleshooting
  • Immediate feedback

2. GitOps with ArgoCD

Modern, production-ready approach for scalable deployments:

# 1. Provision infrastructure (AKS cluster + databases)
cd terraform/deployments/control-plane/azure
terraform apply -var-file="examples/dev.tfvars"

# 2. Extract secrets and configure kubectl
./scripts/extract-infrastructure-secrets.sh

# 3. Install ArgoCD on the provisioned cluster
make install-argocd

# 4. Setup Tyk applications in ArgoCD (auto-detects your Git repo)
make setup-gitops

# 5. Monitor ArgoCD deployment (Tyk deploys automatically)
make gitops-status

πŸ”„ How GitOps Works: Step 5 creates ArgoCD applications that automatically deploy:

  • Prerequisites: cert-manager, Tyk Operator CRDs, namespaces
  • Tyk Control Plane: Dashboard, Gateway, MDCB, Pump, Developer Portal, Operator

πŸ”„ Automated Sync: All applications have automated sync enabled - any Git commit to the main branch will trigger automatic re-deployment within 3 minutes (default ArgoCD polling interval).

πŸ“ Demo Repository: Fork this repository and the setup script automatically detects your fork and configures ArgoCD to use it!

πŸ”“ Repository Access: Ensure your forked repository is publicly accessible or configure ArgoCD with appropriate credentials for private repositories.

Benefits:

  • Declarative configuration
  • Automated synchronization
  • Audit trail and rollback
  • Multi-environment support

πŸ—οΈ Architecture

Components Deployed

  • Tyk Dashboard: API management interface
  • Tyk Gateway: API gateway for control plane
  • Tyk MDCB: Multi-Data Center Bridge
  • Tyk Pump: Analytics processor
  • Tyk Developer Portal: API portal
  • Tyk Operator: Kubernetes-native API management

Infrastructure Support

  • Azure AKS: Current implementation
  • AWS EKS: Planned support
  • GCP GKE: Planned support
  • DigitalOcean DOKS: Planned support

πŸ”§ Configuration

Environment Files

  • .env: Tyk licenses and admin credentials
  • infrastructure.env: Generated from Terraform outputs

Terraform Variables

  • dev.tfvars: Development environment
  • staging.tfvars: Staging environment
  • prod.tfvars: Production environment

πŸ“Š Monitoring

Check Deployment Status

# Traditional deployment
make status

# GitOps deployment
make gitops-status

Access Services

# Tyk Dashboard
kubectl port-forward -n tyk svc/tyk-cp-tyk-dashboard 3000:3000

# Developer Portal
kubectl port-forward -n tyk svc/tyk-cp-tyk-dev-portal 3001:3001

# Tyk Gateway
kubectl port-forward -n tyk svc/tyk-cp-tyk-gateway 8080:8080

ArgoCD Dashboard (GitOps)

# Access ArgoCD UI
kubectl port-forward svc/argocd-server -n argocd 8080:443
# Open: https://localhost:8080

πŸ› οΈ Available Commands

Traditional Helm Deployment

make setup-prerequisites  # Install prerequisites
make deploy               # Deploy Tyk Control Plane
make helm-deploy          # Complete Helm-based deployment
make status              # Check deployment status

GitOps Deployment

make install-argocd      # Install ArgoCD
make create-secrets      # Create Kubernetes secrets (optional)
make setup-gitops        # Setup GitOps applications
make gitops-deploy       # Complete GitOps deployment
make gitops-status       # Check GitOps status

Monitoring Commands

make logs-dashboard      # Show Dashboard logs
make logs-mdcb          # Show MDCB logs
make logs-portal        # Show Portal logs
make logs-all           # Show all component logs

πŸ“š Documentation

Deployment Guides

Architecture Documentation

πŸ” Security

Secret Management

  • Infrastructure secrets generated from Terraform outputs
  • Kubernetes secrets created automatically
  • No secrets committed to Git repository
  • Support for external secret management (Vault, External Secrets Operator)

Network Security

  • All services deployed with ClusterIP (no internet exposure)
  • SSL/TLS enabled for all communications
  • Network policies can be applied for additional security

🌍 Multi-Environment Support

Environment Configuration

# Development
terraform apply -var-file="examples/dev.tfvars"

# Staging
terraform apply -var-file="examples/staging.tfvars"

# Production
terraform apply -var-file="examples/prod.tfvars"

GitOps Branch Strategy

  • main: Production deployments
  • staging: Staging deployments
  • develop: Development deployments

🚨 Troubleshooting

Common Issues

  1. Tyk Operator CrashLoopBackOff: Check CRD installation
  2. MDCB Issues: Verify license and security secrets
  3. Database Connection: Check PostgreSQL connection strings
  4. ArgoCD Sync Issues: Check application status and logs
  5. SSH Agent Error: ArgoCD requires HTTPS Git URLs, not SSH
    • The setup script automatically converts SSH URLs to HTTPS
    • If you encounter SSH errors, ensure your repository is publicly accessible

Get Help

# Check all pods
kubectl get pods -n tyk

# Check recent events
kubectl get events -n tyk --sort-by='.lastTimestamp'

# Check ArgoCD applications (GitOps)
kubectl get applications -n argocd

πŸ”„ GitOps Management

Automated Deployment

  • Git-driven: All changes are made via Git commits
  • Automatic sync: ArgoCD polls the repository every 3 minutes for changes
  • Instant deployment: Push to main/master branch triggers automatic re-deployment
  • Self-healing: ArgoCD automatically reverts manual kubectl changes

Making Changes

# 1. Make changes to GitOps manifests
vim gitops/applications/tyk-control-plane.yaml

# 2. Commit and push changes
git add .
git commit -m "Update Tyk configuration"
git push origin main

# 3. ArgoCD automatically detects and applies changes (within 3 minutes)
# No manual intervention required!

Sync Policies

  • Root Application: Automated sync with pruning and self-healing
  • Prerequisites: Automated sync with retry logic
  • Tyk Control Plane: Automated sync with retry logic

Manual Sync (Optional)

# Force immediate sync without waiting for polling
kubectl patch app tyk-control-plane -n argocd -p '{"metadata":{"annotations":{"argocd.argoproj.io/refresh":"hard"}}}'

# Or use ArgoCD CLI
argocd app sync tyk-control-plane

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ†˜ Support

For issues and questions:

  • Check the troubleshooting sections in the documentation
  • Review the logs using the provided commands
  • Open an issue in this repository
  • Contact the Tyk team for enterprise support

Get started with Tyk Control Plane today! πŸš€

Choose your deployment method:

  • Quick Start: make helm-deploy (Traditional Helm)
  • Production Ready: make gitops-deploy (GitOps)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published