Skip to content

rgordill/couchbase-performance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Couchbase Performance Project

This repository contains ArgoCD manifests and tools for deploying and testing Couchbase on OpenShift with integrated Prometheus monitoring.

🎯 Overview

A complete GitOps-based Couchbase deployment solution featuring:

  • ArgoCD Applications: Declarative deployment using App of Apps pattern
  • Couchbase Operator: Automated cluster management
  • Multi-bucket Setup: Pre-configured buckets for different workloads
  • RBAC Configuration: User management and role bindings
  • Prometheus Integration: Full metrics export to user-workload-monitoring
  • Performance Testing: Tools and scripts for benchmarking
  • Backup & Recovery: Automated backup configurations

πŸ“ Repository Structure

couchbase-performance/
β”œβ”€β”€ argocd/                              # ArgoCD deployment manifests
β”‚   β”œβ”€β”€ main/                            # Bootstrap: project, app-of-apps, PreSync (cluster-configuration)
β”‚   β”‚   β”œβ”€β”€ app-of-apps.yaml             # Root application (syncs argocd/main)
β”‚   β”‚   β”œβ”€β”€ project.yaml
β”‚   β”‚   └── kustomization.yaml
β”‚   β”œβ”€β”€ applications/                    # Individual app definitions
β”‚   β”‚   β”œβ”€β”€ couchbase-operator-app.yaml
β”‚   β”‚   β”œβ”€β”€ couchbase-cluster-app.yaml
β”‚   β”‚   └── couchbase-monitoring-app.yaml
β”‚   β”œβ”€β”€ manifests/
β”‚   β”‚   └── couchbase/                   # Couchbase Kubernetes resources
β”‚   β”‚       β”œβ”€β”€ operator/                # Operator installation
β”‚   β”‚       β”œβ”€β”€ cluster/                 # Cluster configuration
β”‚   β”‚       └── monitoring/              # Prometheus integration
β”‚   β”œβ”€β”€ deploy.sh                        # Deployment script
β”‚   β”œβ”€β”€ cleanup.sh                       # Cleanup script
β”‚   β”œβ”€β”€ verify.sh                        # Verification script
β”‚   β”œβ”€β”€ README.md                        # ArgoCD documentation
β”‚   β”œβ”€β”€ CONFIGURATION.md                 # Configuration guide
β”‚   └── PROMETHEUS_QUERIES.md            # Useful Prometheus queries
└── performance/                         # Performance testing tools
    └── PERFORMANCE_TESTING.md           # Testing guide

πŸš€ Quick Start

Prerequisites

  • OpenShift 4.12+ cluster
  • ArgoCD installed on the cluster
  • kubectl CLI configured (or oc on OpenShift)
  • User Workload Monitoring enabled

Deploy

  1. Clone the repository:

    git clone https://github.com/your-org/couchbase-performance.git
    cd couchbase-performance
  2. Update repository URL in ArgoCD manifests:

    export REPO_URL="https://github.com/your-org/couchbase-performance.git"
    sed -i "s|repoURL:.*|repoURL: ${REPO_URL}|g" argocd/main/app-of-apps.yaml argocd/applications/*.yaml
  3. Deploy using the script:

    cd argocd
    ./deploy.sh
  4. Verify deployment:

    ./verify.sh

Access Couchbase

# Get Admin UI URL
kubectl get ingress -n couchbase

# Default credentials (CHANGE IN PRODUCTION!)
Username: Administrator
Password: P@ssw0rd123!

πŸ“Š Monitoring

Access Prometheus Metrics

  1. OpenShift Console: Navigate to Observe β†’ Metrics

  2. Query examples:

    # Operations per second
    rate(couchbase_bucket_ops_total[5m])
    
    # Memory usage
    couchbase_bucket_mem_used_bytes / 1024 / 1024 / 1024
    
    # Item count
    couchbase_bucket_item_count
    
  3. See more queries: Check argocd/PROMETHEUS_QUERIES.md

Grafana Dashboards

Import the provided dashboard from argocd/manifests/couchbase/monitoring/grafana-dashboard.yaml

🌐 Access

πŸ”§ Configuration

Customize Cluster Size

Edit argocd/manifests/couchbase/cluster/cluster.yaml:

servers:
  - name: data
    size: 2  # Data + index + query (change as needed)
  - name: analytics
    size: 1  # Analytics + eventing (3 replicas total by default)

Adjust Memory Quotas

cluster:
  dataServiceMemoryQuota: 2Gi  # Adjust as needed
  indexServiceMemoryQuota: 1Gi

Add Custom Buckets

Edit argocd/manifests/couchbase/cluster/buckets.yaml or add new bucket definitions.

See detailed configuration guide: argocd/CONFIGURATION.md

πŸ§ͺ Performance Testing

The repository includes performance testing tools and guides.

See: performance/PERFORMANCE_TESTING.md

Quick Performance Test

# Generate load
kubectl exec -it -n couchbase couchbase-cluster-0000 -- \
  cbc-pillowfight \
  -U couchbase://localhost/performance \
  -u performance-user \
  -P P3rf0rm@nce! \
  --num-items 100000 \
  --num-threads 4

πŸ” Security

Default Credentials

⚠️ WARNING: Change default credentials before production use!

User Password Purpose
Administrator P@ssw0rd123! Cluster admin
performance-user P3rf0rm@nce! Application user
readonly-user R3ad0nly! Read-only access

Update Credentials

# Update admin password
kubectl create secret generic cb-admin-auth \
  --from-literal=username=Administrator \
  --from-literal=password=YourNewPassword \
  --dry-run=client -o yaml | kubectl apply -n couchbase -f -

# Restart cluster to apply
kubectl rollout restart statefulset -n couchbase -l app=couchbase

πŸ’Ύ Backup & Recovery

Automated Backups

Configured in argocd/manifests/couchbase/cluster/backup.yaml:

  • Full backup: Weekly (Sunday 2 AM)
  • Incremental backup: Daily (Monday-Saturday 2 AM)
  • Retention: 30 days

Manual Backup

# Trigger manual backup
kubectl create -f - <<EOF
apiVersion: couchbase.com/v2
kind: CouchbaseBackupRestore
metadata:
  name: manual-backup-$(date +%Y%m%d)
  namespace: couchbase
spec:
  backup: couchbase-backup-plan
  action: backup
EOF

πŸ“š Documentation

πŸ› οΈ Troubleshooting

Check Application Status

argocd app get couchbase-cluster

View Logs

# Operator logs
kubectl logs -n couchbase -l app.kubernetes.io/name=couchbase-operator --tail=100

# Couchbase logs
kubectl logs -n couchbase -l app=couchbase --tail=100

Common Issues

  1. Pods not starting: Check storage class availability
  2. Metrics not showing: Verify user-workload-monitoring is enabled
  3. Connection refused: Check network policies and routes

See detailed troubleshooting: argocd/CONFIGURATION.md#troubleshooting

πŸ”„ Multi-Environment Deployment

Use the ApplicationSet for deploying across multiple environments:

kubectl apply -f argocd/applicationset.yaml

This creates separate deployments for dev, staging, and production with appropriate sizing.

🧹 Cleanup

Remove all Couchbase resources:

cd argocd
./cleanup.sh

πŸ“ Contributing

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

πŸ“„ License

This project is licensed under the GNU General Public License v2.0 (GPL-2). See LICENSE for the full text.

🀝 Support

For issues and questions:

πŸ“š Additional Resources

About

Performance tests for couchbase

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors