πŸ—οΈ Harbor + Nexus ν•˜μ΄λΈŒλ¦¬λ“œ μ•„ν‚€ν…μ²˜: 베슀트 퍼포먼슀

μ§„μ›…Β·2025λ…„ 6μ›” 24일

DEVOPS

λͺ©λ‘ 보기
2/3

πŸ—οΈ Harbor + Nexus ν•˜μ΄λΈŒλ¦¬λ“œ μ•„ν‚€ν…μ²˜: 베슀트 퍼포먼슀

🎯 졜적 μ„±λŠ₯ μ•„ν‚€ν…μ²˜ 섀계

πŸ“ μ•„ν‚€ν…μ²˜ 원칙

1. μ—­ν•  뢄리 기반 섀계

Harbor (Container Specialist):
  μ—­ν• : μ»¨ν…Œμ΄λ„ˆ 이미지 μ „μš©
  λŒ€μƒ: 운영 ν™˜κ²½, ν”„λ‘œλ•μ…˜ μ›Œν¬λ‘œλ“œ
  μ΅œμ ν™”: μ»¨ν…Œμ΄λ„ˆ ν‘Έμ‹œ/ν’€ μ„±λŠ₯

Nexus (Package Repository):
  μ—­ν• : 개발 μ˜μ‘΄μ„± νŒ¨ν‚€μ§€
  λŒ€μƒ: 개발 ν™˜κ²½, λΉŒλ“œ ν”„λ‘œμ„ΈμŠ€
  μ΅œμ ν™”: Maven/npm λΉŒλ“œ μ„±λŠ₯

2. λ„€νŠΈμ›Œν¬ μ§€μ—­μ„± μ΅œμ ν™”

배치 μ „λž΅:
  Harbor: Kubernetes ν΄λŸ¬μŠ€ν„° κ·Όμ ‘
  Nexus: κ°œλ°œνŒ€/CI μ„œλ²„ κ·Όμ ‘
  
λͺ©μ : λ„€νŠΈμ›Œν¬ λ ˆμ΄ν„΄μ‹œ μ΅œμ†Œν™”

πŸ›οΈ 베슀트 퍼포먼슀 μ•„ν‚€ν…μ²˜

Architecture Diagram

graph TB
    subgraph "Development Zone"
        DEV[개발자 PC]
        IDE[IDE/VSCode]
        CI[CI/CD Pipeline]
    end
    
    subgraph "Build Zone"
        NEXUS[Nexus Repository]
        BUILD[Build Servers]
        CACHE[Build Cache]
    end
    
    subgraph "Container Zone"
        HARBOR[Harbor Registry]
        SCAN[Security Scanner]
        REPLICA[Harbor Replica]
    end
    
    subgraph "Runtime Zone"
        K8S[Kubernetes Cluster]
        PODS[Application Pods]
        PROXY[Pull-through Cache]
    end
    
    DEV --> IDE
    IDE --> NEXUS
    CI --> NEXUS
    CI --> BUILD
    BUILD --> HARBOR
    HARBOR --> SCAN
    HARBOR --> K8S
    HARBOR --> REPLICA
    PROXY --> HARBOR
    K8S --> PODS

πŸš€ μ„±λŠ₯ μ΅œμ ν™” μ „λž΅

1. Harbor ν΄λŸ¬μŠ€ν„° 섀계

# harbor-performance.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: harbor-performance-config
data:
  harbor.yml: |
    # μ„±λŠ₯ μ΅œμ ν™” μ„€μ •
    database:
      type: postgresql
      postgresql:
        host: postgres-cluster.db.svc.cluster.local
        port: 5432
        database: registry
        username: harbor
        password: ${HARBOR_DB_PASSWORD}
        # μ—°κ²° ν’€ μ΅œμ ν™”
        max_idle_conns: 50
        max_open_conns: 1000
        conn_max_lifetime: 5m
    
    redis:
      # Redis ν΄λŸ¬μŠ€ν„° μ‚¬μš©
      host: redis-cluster.cache.svc.cluster.local:6379
      password: ${REDIS_PASSWORD}
      # μ—°κ²° ν’€ μ„€μ •
      db: 0
      pool:
        max_idle: 100
        max_active: 1000
        idle_timeout: 300s
    
    storage:
      # κ³ μ„±λŠ₯ μŠ€ν† λ¦¬μ§€ λ°±μ—”λ“œ
      s3:
        region: us-west-2
        bucket: harbor-registry-prod
        # λ©€ν‹°νŒŒνŠΈ μ—…λ‘œλ“œ μ΅œμ ν™”
        multipartcopythresholdsize: 32MB
        multipartcopymaxconcurrency: 100
        # μ²­ν‚Ή μ΅œμ ν™”
        chunksize: 5MB
        
    # 둜그 레벨 μ΅œμ ν™” (운영 ν™˜κ²½)
    log:
      level: warn
      
    # μ„±λŠ₯ νŠœλ‹
    core:
      # μ›Œμ»€ ν”„λ‘œμ„ΈμŠ€ 수 μ΅œμ ν™”
      workers: 16
      # μš”μ²­ νƒ€μž„μ•„μ›ƒ
      timeout: 300s
      
    registry:
      # λ ˆμ§€μŠ€νŠΈλ¦¬ μ„±λŠ₯ μ„€μ •
      workers: 8
      # μŠ€ν† λ¦¬μ§€ λ“œλΌμ΄λ²„ μ΅œμ ν™”
      storage_driver_config: |
        maintenance:
          uploadpurging:
            enabled: true
            age: 168h
            interval: 24h
            dryrun: false

2. Nexus μ„±λŠ₯ μ΅œμ ν™”

# nexus-performance.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: nexus-performance-config
data:
  nexus.properties: |
    # JVM νž™ λ©”λͺ¨λ¦¬ μ΅œμ ν™”
    -Xms4G
    -Xmx8G
    -XX:MaxDirectMemorySize=6G
    
    # GC μ΅œμ ν™”
    -XX:+UseG1GC
    -XX:MaxGCPauseMillis=200
    -XX:G1HeapRegionSize=16m
    
    # μ„±λŠ₯ νŠœλ‹
    -Dnexus.cleanup.retainDays=30
    -Dnexus.scripts.allowCreation=false
    
    # λ°μ΄ν„°λ² μ΄μŠ€ μ—°κ²° ν’€
    nexus.datastore.connectionPool.maxPoolSize=50
    nexus.datastore.connectionPool.minPoolSize=10
    
    # HTTP 컀λ„₯ν„° μ΅œμ ν™”
    nexus.jetty.connector.http.acceptors=4
    nexus.jetty.connector.http.selectors=8
    
  cleanup.properties: |
    # 정리 μž‘μ—… μ΅œμ ν™”
    cleanup.policy.retention.days=30
    cleanup.policy.last.downloaded.days=7
    cleanup.policy.last.blob.updated.days=3

3. λ„€νŠΈμ›Œν¬ μ΅œμ ν™”

# network-optimization.yaml
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: registry-network-optimization
spec:
  podSelector:
    matchLabels:
      app: harbor
  policyTypes:
  - Ingress
  - Egress
  ingress:
  - from:
    - namespaceSelector:
        matchLabels:
          name: kube-system
    - namespaceSelector:
        matchLabels:
          name: development
    ports:
    - protocol: TCP
      port: 80
    - protocol: TCP
      port: 443
  
---
# 캐싱 λ ˆμ΄μ–΄ μΆ”κ°€
apiVersion: v1
kind: Service
metadata:
  name: harbor-cache-proxy
  annotations:
    # μ—°κ²° μœ μ§€ μ΅œμ ν™”
    service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: "300"
    # μŠ€ν‹°ν‚€ μ„Έμ…˜
    service.beta.kubernetes.io/aws-load-balancer-target-group-attributes: stickiness.enabled=true
spec:
  type: LoadBalancer
  ports:
  - port: 80
    targetPort: 8080
    name: http
  - port: 443
    targetPort: 8443
    name: https
  selector:
    app: harbor-proxy

πŸ”„ μ›Œν¬ν”Œλ‘œμš° 기반 μ΅œμ ν™”

개발 단계 (Nexus μ΅œμ ν™”)

# nexus-dev-optimization.yaml
Development Workflow:
  Phase 1 - Dependency Resolution:
    Tool: Nexus Repository
    Optimization:
      - Local SSD storage for Maven/.m2 cache
      - Nexus proxy repositories for public repos
      - Aggressive caching (7 days retention)
      - Parallel downloads enabled
    
    Performance Metrics:
      - Maven dependency resolution: < 30s
      - npm install: < 2 minutes
      - Nexus response time: < 100ms
      
  Configuration:
    maven:
      proxy_repositories:
        maven-central:
          remote_url: https://repo1.maven.org/maven2/
          cache_policy: "cache_for_7_days"
          download_policy: "parallel_max_10"
    
    npm:
      proxy_repositories:
        npmjs:
          remote_url: https://registry.npmjs.org/
          cache_policy: "cache_for_3_days"
          metadata_max_age: 1440  # 24 hours

λΉŒλ“œ 단계 (Harbor μ€€λΉ„)

# build-stage-optimization.yaml
Build Workflow:
  Phase 2 - Container Build:
    Optimization:
      - Multi-stage Docker builds
      - Layer caching optimization
      - Parallel build stages
      - Build cache reuse
    
    Docker Build Config:
      DOCKER_BUILDKIT: 1
      BUILDKIT_PROGRESS: plain
      # λΉŒλ“œ μΊμ‹œ μ΅œμ ν™”
      build_args:
        - BUILDKIT_INLINE_CACHE=1
        - MAX_PARALLEL_DOWNLOADS=10
      
    Performance Targets:
      - Docker build time: < 5 minutes
      - Layer reuse rate: > 80%
      - Cache hit rate: > 70%

배포 단계 (Harbor μ΅œμ ν™”)

# harbor-deployment-optimization.yaml
Deployment Workflow:
  Phase 3 - Container Registry:
    Tool: Harbor
    Optimization:
      - Pull-through cache for base images
      - Image layer deduplication
      - Parallel layer downloads
      - Regional replication
    
    Harbor Performance Config:
      registry:
        # 병렬 λ‹€μš΄λ‘œλ“œ μ΅œμ ν™”
        maxconcurrentuploads: 10
        maxconcurrentdownloads: 10
        
        # 청크 μ‚¬μ΄μ¦ˆ μ΅œμ ν™” (λ„€νŠΈμ›Œν¬ λŒ€μ—­ν­ 기반)
        # κ³ λŒ€μ—­ν­: 32MB, 일반: 5MB, μ €λŒ€μ—­ν­: 1MB
        chunksize: 5242880  # 5MB
        
        # νƒ€μž„μ•„μ›ƒ μ„€μ •
        timeout:
          read: 300s
          write: 300s
          
      # μŠ€ν† λ¦¬μ§€ μ΅œμ ν™”
      storage:
        cache:
          blobdescriptor: redis
          # 메타데이터 μΊμ‹œ
          layerinfo: redis

🌐 λ©€ν‹° 리전 μ΅œμ ν™”

지역별 배치 μ „λž΅

# multi-region-architecture.yaml
Regional Distribution:
  
  Primary Region (US-West):
    Harbor Primary:
      role: master
      storage: AWS S3 (us-west-2)
      capacity: 10TB
      performance: High IOPS SSD
      
    Nexus Primary:
      role: master
      storage: EBS GP3 (10,000 IOPS)
      capacity: 5TB
      
  Secondary Region (US-East):
    Harbor Replica:
      role: read-replica
      replication: real-time
      storage: AWS S3 (us-east-1)
      
    Nexus Cache:
      role: proxy-cache
      cache_size: 1TB
      cache_policy: "most_accessed_artifacts"
      
  Asian Region (AP-Northeast):
    Harbor Replica:
      role: read-replica
      replication: scheduled (every 4 hours)
      storage: AWS S3 (ap-northeast-1)
      
    Nexus Proxy:
      role: proxy-only
      cache_size: 500GB

λ„€νŠΈμ›Œν¬ μ΅œμ ν™”

# network-performance.yaml
Network Optimization:
  
  CDN Integration:
    Harbor:
      - CloudFlare for image layers
      - Edge caching for frequently accessed images
      - Automatic cache invalidation
      
    Nexus:
      - Regional proxy servers
      - Smart routing based on client location
      
  Bandwidth Management:
    Upload:
      - Compression enabled
      - Delta sync for image layers
      - Resumable uploads
      
    Download:
      - Parallel connections (max 8)
      - Connection pooling
      - Keep-alive connections
      
  Monitoring:
    Metrics:
      - Network latency per region
      - Bandwidth utilization
      - Cache hit rates
      - Error rates

⚑ μ„±λŠ₯ λͺ¨λ‹ˆν„°λ§ 및 μ΅œμ ν™”

μ„±λŠ₯ λ©”νŠΈλ¦­ μˆ˜μ§‘

# monitoring-setup.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: performance-monitoring
data:
  prometheus.yml: |
    global:
      scrape_interval: 15s
      
    scrape_configs:
      # Harbor λ©”νŠΈλ¦­
      - job_name: 'harbor'
        static_configs:
          - targets: ['harbor:8080']
        metrics_path: /api/v2.0/metrics
        
      # Nexus λ©”νŠΈλ¦­
      - job_name: 'nexus'
        static_configs:
          - targets: ['nexus:8081']
        metrics_path: /service/metrics/prometheus
        
    # μ„±λŠ₯ μž„κ³„κ°’ μ•Œλ¦Ό
    rule_files:
      - "performance_alerts.yml"
      
  performance_alerts.yml: |
    groups:
      - name: registry_performance
        rules:
          # Harbor μ„±λŠ₯ μ•Œλ¦Ό
          - alert: HarborHighLatency
            expr: harbor_http_request_duration_seconds{quantile="0.95"} > 2
            for: 5m
            labels:
              severity: warning
            annotations:
              summary: "Harbor high latency detected"
              
          # Nexus μ„±λŠ₯ μ•Œλ¦Ό
          - alert: NexusHighMemoryUsage
            expr: nexus_jvm_memory_used_bytes / nexus_jvm_memory_max_bytes > 0.85
            for: 5m
            labels:
              severity: warning
            annotations:
              summary: "Nexus high memory usage"

μžλ™ μŠ€μΌ€μΌλ§

# auto-scaling.yaml
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: harbor-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: harbor-core
  minReplicas: 2
  maxReplicas: 10
  metrics:
  - type: Resource
    resource:
      name: cpu
      target:
        type: Utilization
        averageUtilization: 70
  - type: Resource
    resource:
      name: memory
      target:
        type: Utilization
        averageUtilization: 80
  # μ»€μŠ€ν…€ λ©”νŠΈλ¦­ 기반 μŠ€μΌ€μΌλ§
  - type: Object
    object:
      metric:
        name: harbor_concurrent_requests
      target:
        type: Value
        value: "100"
        
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: nexus-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: nexus
  minReplicas: 1
  maxReplicas: 3
  metrics:
  - type: Resource
    resource:
      name: cpu
      target:
        type: Utilization
        averageUtilization: 75

πŸ”§ CI/CD νŒŒμ΄ν”„λΌμΈ μ΅œμ ν™”

νŒŒμ΄ν”„λΌμΈ 단계별 μ΅œμ ν™”

# optimized-pipeline.yaml
Pipeline Stages:
  
  Stage 1 - Build Dependencies (Nexus):
    optimization:
      - Cache Maven/npm dependencies locally
      - Use Nexus proxy for faster downloads
      - Parallel dependency resolution
      
    implementation:
      cache_strategy: "aggressive"
      parallel_downloads: true
      local_cache_size: "10GB"
      
  Stage 2 - Application Build:
    optimization:
      - Use cached dependencies
      - Multi-stage Docker builds
      - Build cache reuse
      
    implementation:
      docker_buildkit: true
      cache_from: 
        - "harbor.company.com/cache/app-base:latest"
      build_args:
        - BUILDKIT_INLINE_CACHE=1
        
  Stage 3 - Security Scan (Harbor):
    optimization:
      - Scan only new layers
      - Parallel vulnerability scanning
      - Cache scan results
      
    implementation:
      scan_policy: "incremental"
      parallel_scanners: 4
      cache_scan_results: "7_days"
      
  Stage 4 - Deploy (Harbor):
    optimization:
      - Pre-pull images to nodes
      - Use image pull secrets
      - Optimize image pull policy
      
    implementation:
      image_pull_policy: "IfNotPresent"
      image_pull_secrets: ["harbor-registry-secret"]
      pre_pull_images: true

πŸ“Š μ„±λŠ₯ 벀치마크 및 λͺ©ν‘œ

μ„±λŠ₯ KPI

Performance Targets:

Harbor (Container Registry):
  Image Push:
    - Small images (< 100MB): < 30 seconds
    - Medium images (100MB-1GB): < 2 minutes  
    - Large images (> 1GB): < 5 minutes
    
  Image Pull:
    - First pull: < 1 minute per GB
    - Cached pull: < 10 seconds
    - Parallel pulls: 10+ concurrent
    
  API Response:
    - Catalog API: < 200ms
    - Manifest API: < 100ms
    - Blob API: < 50ms
    
Nexus (Package Repository):
  Maven Dependencies:
    - Initial build: < 5 minutes
    - Incremental build: < 30 seconds
    - Dependency resolution: < 100ms per artifact
    
  npm Packages:
    - npm install: < 2 minutes
    - npm ci: < 1 minute
    - Package search: < 500ms
    
  Storage Performance:
    - Read IOPS: > 10,000
    - Write IOPS: > 5,000
    - Throughput: > 1GB/s

πŸš€ μ΅œμ’… ꢌμž₯ μ•„ν‚€ν…μ²˜

Production-Ready Architecture

Recommended Setup:

Infrastructure:
  Harbor Cluster:
    - 3 nodes (master-master-master)
    - 16 CPU, 32GB RAM per node
    - 1TB NVMe SSD per node
    - S3 backend storage (multi-region)
    
  Nexus Cluster:
    - 2 nodes (active-passive)
    - 8 CPU, 16GB RAM per node  
    - 500GB NVMe SSD per node
    - PostgreSQL backend
    
  Network:
    - 10Gbps internal network
    - CDN for global distribution
    - Load balancers with health checks
    
Deployment Strategy:
  Phase 1: Infrastructure Setup (Week 1-2)
  Phase 2: Harbor Production Deployment (Week 3)
  Phase 3: Nexus Migration/Setup (Week 4)
  Phase 4: CI/CD Integration (Week 5-6)
  Phase 5: Performance Tuning (Week 7-8)
  
Monitoring:
  - Prometheus + Grafana dashboards
  - Custom performance metrics
  - Automated alerting
  - Capacity planning reports

이 μ•„ν‚€ν…μ²˜λŠ” 각 λ„κ΅¬μ˜ 강점을 μ΅œλŒ€ν™”ν•˜λ©΄μ„œ μ„±λŠ₯ μ˜€λ²„ν—€λ“œλ₯Ό μ΅œμ†Œν™”ν•˜λŠ” μ„€κ³„μž…λ‹ˆλ‹€! 🎯

profile
bytebliss

0개의 λŒ“κΈ€