kubernetes k8s container orchestration docker kubernetes kubernetes kurulumu

Kubernetes Container Orchestration Hizmetleri

Kubernetes (K8s) ile modern uygulama altyapısı! Container orchestration, otomatik scaling, self-healing, zero-downtime deployment ve cloud-native uygulama yönetimi ile işletmenizi geleceğe taşıyın.

Kubernetes Nedir?

Kubernetes (K8s), Google tarafından geliştirilen, Docker container’larını otomatik olarak yöneten, ölçeklendiren ve orkestra eden açık kaynaklı container orchestration platformudur. Modern mikroservis mimarilerinin vazgeçilmez altyapısıdır.

🎯 Kubernetes’in Gücü

Neden Kubernetes?

Geleneksel Deployment vs Kubernetes:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Geleneksel (Monolith + Manuel):
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
❌ Manuel sunucu kurulumu
❌ Downtime sırasında deployment
❌ Sabit kaynak tahsisi (waste)
❌ Yavaş scaling (saatler)
❌ Manuel fail-over
❌ Ortam tutarsızlığı (dev vs prod)
❌ Bağımlılık kargaşası

Deployment süresi: 2-4 saat
Hata durumu recovery: 30-60 dakika
Kaynak kullanımı: %30-40
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Kubernetes (Container + Orchestration):
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ Otomatik deployment
✅ Zero-downtime (rolling update)
✅ Dinamik kaynak yönetimi
✅ Auto-scaling (saniyeler)
✅ Self-healing (otomatik recovery)
✅ Ortam tutarlılığı (dev = prod)
✅ İzole bağımlılıklar

Deployment süresi: 2-5 dakika
Hata durumu recovery: 10-30 saniye
Kaynak kullanımı: %70-85
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

📊 Kubernetes Benimseme İstatistikleri

Global Veriler (2024-2025):

Fortune 500 Şirketleri:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 %96 Kubernetes kullanıyor veya değerlendiriyor
📈 %83 Production ortamında kullanıyor
🚀 %67 Çoklu cluster çalıştırıyor
☁️ %78 Multi-cloud stratejisi

Küresel İstatistikler:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
👥 14+ milyon developer kullanıyor
📦 6.5+ milyon container orchestration
💰 Altyapı maliyeti tasarrufu: %30-60
⚡ Deployment hızı artışı: %300-500
🔧 Operasyonel verimlilik: %40-70
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Kubernetes Mimarisi

🏗️ Kubernetes Cluster Yapısı

Kubernetes Cluster Architecture:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

                    ┌─────────────────────────┐
                    │    Control Plane        │
                    │   (Master Nodes)        │
                    ├─────────────────────────┤
                    │  • API Server           │
                    │  • etcd (database)      │
                    │  • Scheduler            │
                    │  • Controller Manager   │
                    │  • Cloud Controller     │
                    └───────────┬─────────────┘

                    ┌───────────┴─────────────┐
                    │                         │
         ┌──────────▼──────────┐   ┌─────────▼──────────┐
         │   Worker Node 1     │   │   Worker Node 2    │
         ├─────────────────────┤   ├────────────────────┤
         │ • Kubelet           │   │ • Kubelet          │
         │ • Container Runtime │   │ • Container Runtime│
         │ • kube-proxy        │   │ • kube-proxy       │
         │                     │   │                    │
         │ ┌─────────────┐     │   │ ┌────────────┐    │
         │ │   Pod 1     │     │   │ │   Pod 3    │    │
         │ │ Container A │     │   │ │ Container C│    │
         │ └─────────────┘     │   │ └────────────┘    │
         │ ┌─────────────┐     │   │ ┌────────────┐    │
         │ │   Pod 2     │     │   │ │   Pod 4    │    │
         │ │ Container B │     │   │ │ Container D│    │
         │ └─────────────┘     │   │ └────────────┘    │
         └─────────────────────┘   └────────────────────┘

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

🔧 Temel Kubernetes Bileşenleri

Control Plane Bileşenleri:

1. API Server (kube-apiserver)

Görev: Kubernetes'in beyni
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• Tüm API isteklerini karşılar
• kubectl komutları buraya gelir
• RESTful API sağlar
• Authentication ve authorization
• Etcd ile iletişim

Örnek API çağrısı:
kubectl get pods
→ API Server'a GET isteği
→ etcd'den pod bilgisi çeker
→ Response döner

2. etcd

Görev: Cluster'ın veritabanı
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• Key-value distributed database
• Cluster state saklar
• ConfigMaps, Secrets
• Yüksek erişilebilirlik (HA)

Önemli: etcd backup = cluster backup!

3. Scheduler (kube-scheduler)

Görev: Pod'ları node'lara yerleştirme
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• Yeni pod'u hangi node'a koyacağını belirler
• Resource ihtiyacı (CPU, RAM)
• Node affinity kuralları
• Taints ve tolerations
• Load balancing

Karar kriterleri:
✓ Node'da yeterli kaynak var mı?
✓ Pod node affinity'si uyuyor mu?
✓ Taint/toleration eşleşiyor mu?
✓ En dengeli dağılım hangisi?

4. Controller Manager

Görev: Desired state = actual state
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• Sürekli cluster durumunu izler
• Arzu edilen duruma getirir (reconciliation)

Controller Türleri:
• Node Controller: Node sağlığı
• Replication Controller: Pod sayısı
• Endpoint Controller: Service-pod bağlantısı
• Service Account Controller: Yetkilendirme

Worker Node Bileşenleri:

1. Kubelet

Görev: Node agent'ı
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• Her node'da çalışır
• Pod'ları başlatır ve izler
• Container sağlık kontrolü
• API Server ile iletişim
• Volume mount

2. Container Runtime

Görev: Container'ları çalıştırma
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Desteklenen Runtime'lar:
• containerd (en yaygın)
• CRI-O
• Docker (deprecated ama hala kullanılır)

Container pull, start, stop işlemleri

3. kube-proxy

Görev: Network proxy
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• Service network kuralları
• Load balancing
• iptables veya IPVS
• Pod'lar arası iletişim

Kubernetes Temel Kavramları

📦 Pod

En küçük deployment birimi

# pod.yaml
apiVersion: v1
kind: Pod
metadata:
  name: nginx-pod
  labels:
    app: web
spec:
  containers:
  - name: nginx
    image: nginx:1.24
    ports:
    - containerPort: 80
    resources:
      requests:
        cpu: "100m"        # 0.1 CPU core
        memory: "128Mi"    # 128 MB RAM
      limits:
        cpu: "500m"        # Maksimum 0.5 CPU
        memory: "512Mi"    # Maksimum 512 MB
    env:
    - name: ENVIRONMENT
      value: "production"
    livenessProbe:
      httpGet:
        path: /health
        port: 80
      initialDelaySeconds: 10
      periodSeconds: 5

Pod Yaşam Döngüsü:

Pod Lifecycle:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1. Pending    → Pod oluşturuldu, image pull ediliyor
2. Running    → Container'lar çalışıyor
3. Succeeded  → Container'lar başarıyla sonlandı
4. Failed     → Container hata ile sonlandı
5. Unknown    → Pod durumu belirlenemiyor

kubectl get pods:
NAME         READY   STATUS    RESTARTS   AGE
nginx-pod    1/1     Running   0          2m

🚀 Deployment

Declarative pod yönetimi

# deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: web-app
  labels:
    app: web
spec:
  replicas: 3                    # 3 pod çalışacak
  strategy:
    type: RollingUpdate          # Zero-downtime update
    rollingUpdate:
      maxSurge: 1                # Aynı anda +1 pod
      maxUnavailable: 0          # Her zaman min 3 pod
  selector:
    matchLabels:
      app: web
  template:
    metadata:
      labels:
        app: web
    spec:
      containers:
      - name: app
        image: mycompany/web-app:v2.1.0
        ports:
        - containerPort: 8080
        env:
        - name: DATABASE_URL
          valueFrom:
            secretKeyRef:
              name: db-secret
              key: url
        resources:
          requests:
            cpu: 200m
            memory: 256Mi
          limits:
            cpu: 1
            memory: 1Gi

Rolling Update:

Rolling Update Process:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Başlangıç (v1.0):
  Pod-1 (v1.0)  ✅
  Pod-2 (v1.0)  ✅
  Pod-3 (v1.0)  ✅

kubectl set image deployment/web-app app=mycompany/web-app:v2.0

Adım 1:
  Pod-1 (v1.0)  ✅
  Pod-2 (v1.0)  ✅
  Pod-3 (v1.0)  ✅
  Pod-4 (v2.0)  🆕 (yeni pod başlatılıyor)

Adım 2:
  Pod-1 (v1.0)  ❌ (terminate ediliyor)
  Pod-2 (v1.0)  ✅
  Pod-3 (v1.0)  ✅
  Pod-4 (v2.0)  ✅

Adım 3:
  Pod-2 (v1.0)  ✅
  Pod-3 (v1.0)  ✅
  Pod-4 (v2.0)  ✅
  Pod-5 (v2.0)  🆕

Adım 4:
  Pod-2 (v1.0)  ❌
  Pod-3 (v1.0)  ✅
  Pod-4 (v2.0)  ✅
  Pod-5 (v2.0)  ✅

Adım 5:
  Pod-3 (v1.0)  ✅
  Pod-4 (v2.0)  ✅
  Pod-5 (v2.0)  ✅
  Pod-6 (v2.0)  🆕

Son:
  Pod-4 (v2.0)  ✅
  Pod-5 (v2.0)  ✅
  Pod-6 (v2.0)  ✅

Toplam downtime: 0 saniye! 🎉
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

🌐 Service

Pod’lara network erişimi

# service.yaml
apiVersion: v1
kind: Service
metadata:
  name: web-service
spec:
  type: LoadBalancer              # Dış dünyaya açık
  selector:
    app: web                      # app=web label'lı pod'lara yönlendir
  ports:
  - protocol: TCP
    port: 80                      # Service portu
    targetPort: 8080              # Container portu
  sessionAffinity: ClientIP       # Sticky sessions

Service Türleri:

Service Types:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

1. ClusterIP (Default)
   • Sadece cluster içinden erişim
   • Internal microservice iletişimi

   web-service.default.svc.cluster.local:80

2. NodePort
   • Node IP + Port ile dış erişim
   • Port range: 30000-32767

   http://<node-ip>:30080

3. LoadBalancer
   • Cloud load balancer oluşturur
   • Public IP alır
   • AWS ELB, GCP Load Balancer, Azure LB

   http://<external-ip>:80

4. ExternalName
   • DNS CNAME
   • Dış servislere erişim

   database.example.com
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

🔀 Ingress

HTTP/HTTPS routing ve SSL termination

# ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: web-ingress
  annotations:
    cert-manager.io/cluster-issuer: letsencrypt-prod
    nginx.ingress.kubernetes.io/ssl-redirect: "true"
spec:
  ingressClassName: nginx
  tls:
  - hosts:
    - www.example.com
    - api.example.com
    secretName: tls-secret
  rules:
  - host: www.example.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: frontend-service
            port:
              number: 80
  - host: api.example.com
    http:
      paths:
      - path: /v1
        pathType: Prefix
        backend:
          service:
            name: api-service
            port:
              number: 8080
      - path: /v2
        pathType: Prefix
        backend:
          service:
            name: api-v2-service
            port:
              number: 8080

Ingress Workflow:

Internet Traffic Flow:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
User → https://www.example.com

DNS → Load Balancer IP

Ingress Controller (NGINX)

SSL Termination (HTTPS → HTTP)

Routing rules (host + path)

Service (frontend-service:80)

Pod (frontend-pod:8080)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

📊 ConfigMap ve Secret

Konfigürasyon yönetimi

# configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: app-config
data:
  app.properties: |
    environment=production
    log_level=info
    max_connections=100
  DATABASE_HOST: "postgres.default.svc.cluster.local"
  DATABASE_PORT: "5432"
  CACHE_TTL: "3600"

---
# secret.yaml
apiVersion: v1
kind: Secret
metadata:
  name: app-secrets
type: Opaque
data:
  # Base64 encoded
  DATABASE_PASSWORD: cGFzc3dvcmQxMjM=
  API_KEY: YWJjZGVmMTIzNDU2

---
# Pod ile kullanım
apiVersion: v1
kind: Pod
metadata:
  name: app-pod
spec:
  containers:
  - name: app
    image: myapp:1.0
    envFrom:
    - configMapRef:
        name: app-config
    - secretRef:
        name: app-secrets
    volumeMounts:
    - name: config-volume
      mountPath: /etc/config
  volumes:
  - name: config-volume
    configMap:
      name: app-config

📈 Horizontal Pod Autoscaler (HPA)

Otomatik ölçeklendirme

# hpa.yaml
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: web-app-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: web-app
  minReplicas: 3
  maxReplicas: 10
  metrics:
  - type: Resource
    resource:
      name: cpu
      target:
        type: Utilization
        averageUtilization: 70      # CPU %70 üzerinde scale up
  - type: Resource
    resource:
      name: memory
      target:
        type: Utilization
        averageUtilization: 80      # RAM %80 üzerinde scale up
  behavior:
    scaleUp:
      stabilizationWindowSeconds: 60
      policies:
      - type: Percent
        value: 50                   # Bir seferde %50 artır
        periodSeconds: 60
    scaleDown:
      stabilizationWindowSeconds: 300
      policies:
      - type: Pods
        value: 1                    # Yavaş yavaş azalt
        periodSeconds: 120

HPA Örnek Senaryo:

Auto-Scaling in Action:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
09:00 - Normal trafik
  Pods: 3
  CPU: %40

12:00 - Öğle yoğunluğu başladı
  Pods: 3
  CPU: %75 ⚠️ (threshold: %70)

12:02 - HPA scale up başlattı
  Pods: 3 → 5 (yeni pod'lar başlatılıyor)
  CPU: %75

12:05 - Yeni pod'lar hazır
  Pods: 5
  CPU: %45 ✅

13:30 - Trafik azaldı
  Pods: 5
  CPU: %25

13:35 - HPA scale down (yavaş)
  Pods: 5 → 4

14:00
  Pods: 4 → 3 (normal seviyeye döndü)
  CPU: %35
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Kubernetes İleri Özellikler

💾 Persistent Volume (PV) ve Persistent Volume Claim (PVC)

Kalıcı veri saklama

# persistent-volume.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
  name: postgres-pv
spec:
  capacity:
    storage: 100Gi
  volumeMode: Filesystem
  accessModes:
  - ReadWriteOnce              # Tek node yazma
  persistentVolumeReclaimPolicy: Retain
  storageClassName: fast-ssd
  csi:
    driver: ebs.csi.aws.com    # AWS EBS
    volumeHandle: vol-0123456789

---
# persistent-volume-claim.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: postgres-pvc
spec:
  accessModes:
  - ReadWriteOnce
  storageClassName: fast-ssd
  resources:
    requests:
      storage: 50Gi

---
# Pod ile kullanım
apiVersion: v1
kind: Pod
metadata:
  name: postgres
spec:
  containers:
  - name: postgres
    image: postgres:15
    volumeMounts:
    - name: data
      mountPath: /var/lib/postgresql/data
  volumes:
  - name: data
    persistentVolumeClaim:
      claimName: postgres-pvc

🔐 RBAC (Role-Based Access Control)

Güvenlik ve yetkilendirme

# service-account.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
  name: developer-sa
  namespace: dev-team

---
# role.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: pod-reader
  namespace: dev-team
rules:
- apiGroups: [""]
  resources: ["pods", "pods/log"]
  verbs: ["get", "list", "watch"]
- apiGroups: ["apps"]
  resources: ["deployments"]
  verbs: ["get", "list", "create", "update"]

---
# rolebinding.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: read-pods
  namespace: dev-team
subjects:
- kind: ServiceAccount
  name: developer-sa
  namespace: dev-team
roleRef:
  kind: Role
  name: pod-reader
  apiGroup: rbac.authorization.k8s.io

🎯 Network Policies

Pod’lar arası network izolasyonu

# network-policy.yaml
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: backend-policy
  namespace: production
spec:
  podSelector:
    matchLabels:
      app: backend
  policyTypes:
  - Ingress
  - Egress
  ingress:
  - from:
    - podSelector:
        matchLabels:
          app: frontend     # Sadece frontend'den gelen trafik
    - namespaceSelector:
        matchLabels:
          name: production  # Sadece production namespace
    ports:
    - protocol: TCP
      port: 8080
  egress:
  - to:
    - podSelector:
        matchLabels:
          app: database     # Sadece database'e giden trafik
    ports:
    - protocol: TCP
      port: 5432
  - to:                     # DNS çözümlemesi için
    - namespaceSelector:
        matchLabels:
          name: kube-system
    ports:
    - protocol: UDP
      port: 53

📦 StatefulSet

Stateful uygulamalar için

# statefulset.yaml
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: mongodb
spec:
  serviceName: mongodb-headless
  replicas: 3
  selector:
    matchLabels:
      app: mongodb
  template:
    metadata:
      labels:
        app: mongodb
    spec:
      containers:
      - name: mongodb
        image: mongo:6.0
        ports:
        - containerPort: 27017
        volumeMounts:
        - name: data
          mountPath: /data/db
  volumeClaimTemplates:
  - metadata:
      name: data
    spec:
      accessModes: ["ReadWriteOnce"]
      storageClassName: fast-ssd
      resources:
        requests:
          storage: 50Gi

StatefulSet Özellikleri:

StatefulSet vs Deployment:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
StatefulSet:
✅ Stable, unique network identity
   mongodb-0, mongodb-1, mongodb-2
✅ Stable, persistent storage
   Her pod'un kendine ait PVC
✅ Ordered deployment ve scaling
   0 → 1 → 2 sıralı başlar
✅ Ordered, graceful termination
   2 → 1 → 0 sıralı kapanır

Kullanım Alanları:
• Veritabanları (PostgreSQL, MySQL, MongoDB)
• Message queues (Kafka, RabbitMQ)
• Distributed systems (Zookeeper, Consul)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Kubernetes Deployment Stratejileri

🚀 Deployment Patterns

1. Recreate (Downtime var)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
v1: ████ (terminate all)
Downtime: ⏱️ 30-60 saniye
v2: ████ (start all new)

Use case: Development ortamı


2. Rolling Update (Zero downtime)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
v1: ████
v1: ███░ (1 pod v2'ye geçiyor)
v1: ██░░
v1: █░░░
v2: ░░░░

Downtime: 0
Use case: Production (default)


3. Blue/Green Deployment
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Blue (v1):  ████ (mevcut)
Green (v2): ████ (yeni, paralel kurulum)

Traffic switch: Blue → Green (instant)

Downtime: 0
Use case: Critical apps, kolay rollback


4. Canary Deployment
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
v1: ████████████ (90% trafik)
v2: █            (10% trafik, test)

Monitor → OK ise v2'yi artır

v1: ██████       (50%)
v2: ██████       (50%)

v1: ░░░░░░       (0%)
v2: ████████████ (100%)

Use case: Yeni özellik testi, risk azaltma
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Kubernetes Managed Services

☁️ Managed Kubernetes Platformları

AWS EKS (Elastic Kubernetes Service)

AWS EKS Özellikleri:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ Fully managed control plane
✅ Auto-scaling (Karpenter)
✅ AWS entegrasyonları:
   • ELB (Load Balancer)
   • EBS, EFS (Storage)
   • IAM (Security)
   • CloudWatch (Monitoring)
   • Route 53 (DNS)
✅ Fargate desteği (serverless nodes)
✅ Multi-AZ high availability

Fiyat:
• Cluster: $0.10/saat ($73/ay)
• Worker nodes: EC2 fiyatları

Google GKE (Google Kubernetes Engine)

GKE Özellikleri:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ Google tarafından geliştirilen K8s
✅ Autopilot mode (serverless)
✅ Auto-repair, auto-upgrade
✅ Binary Authorization (güvenlik)
✅ Google Cloud entegrasyonları
✅ En olgun K8s platformu

Fiyat:
• Standard: $0.10/saat
• Autopilot: Kullandığınız kaynak kadar

Azure AKS (Azure Kubernetes Service)

AKS Özellikleri:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ Free control plane
✅ Azure DevOps entegrasyonu
✅ Azure AD authentication
✅ Virtual nodes (serverless)
✅ Azure Monitor entegrasyonu
✅ Defender for Containers (security)

Fiyat:
• Cluster: Ücretsiz!
• Worker nodes: VM fiyatları

DigitalOcean Kubernetes (DOKS)

DOKS Özellikleri:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ Basit ve uygun fiyat
✅ Free control plane
✅ 1-click apps (Helm charts)
✅ Load balancer dahil
✅ KOBİ friendly

Fiyat:
• Cluster: Ücretsiz
• Worker nodes: $12/ay'dan başlayan

Helm - Kubernetes Paket Yöneticisi

📦 Helm Nedir?

Helm = apt/yum for Kubernetes
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Ubuntu'da:   apt install nginx
Kubernetes:  helm install nginx bitnami/nginx

Helm Chart = Kubernetes manifestlerinin paketi

Helm Chart Yapısı:

mychart/
├── Chart.yaml              # Chart metadata
├── values.yaml             # Default değerler
├── templates/
│   ├── deployment.yaml
│   ├── service.yaml
│   ├── ingress.yaml
│   └── configmap.yaml
└── charts/                 # Dependency charts

Örnek Helm Kullanımı:

# Helm repo ekleme
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update

# PostgreSQL kurulumu
helm install my-postgres bitnami/postgresql \
  --set auth.password=mypassword \
  --set primary.persistence.size=50Gi \
  --set metrics.enabled=true

# Kurulu chart'ları listele
helm list

# Upgrade
helm upgrade my-postgres bitnami/postgresql \
  --set primary.persistence.size=100Gi

# Rollback
helm rollback my-postgres 1

# Uninstall
helm uninstall my-postgres

Popüler Helm Charts:

Bitnami Charts:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• PostgreSQL, MySQL, MongoDB
• Redis, RabbitMQ, Kafka
• NGINX, Apache
• WordPress, Drupal

Prometheus Stack:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• Prometheus (monitoring)
• Grafana (dashboards)
• AlertManager (alerts)

Ingress Controllers:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• ingress-nginx
• cert-manager (Let's Encrypt SSL)
• external-dns (DNS yönetimi)

Kubernetes Monitoring ve Logging

📊 Monitoring Stack

Prometheus + Grafana

# Helm ile kurulum
helm repo add prometheus-community \
  https://prometheus-community.github.io/helm-charts

helm install prometheus prometheus-community/kube-prometheus-stack \
  --set prometheus.prometheusSpec.retention=30d \
  --set grafana.adminPassword=admin123 \
  --set grafana.ingress.enabled=true \
  --set grafana.ingress.hosts[0]=grafana.example.com

Monitoring Metrikleri:

Kubernetes Metrikleri:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Cluster Seviyesi:
• Node CPU, RAM, Disk kullanımı
• Pod sayısı ve durumu
• Network throughput

Pod Seviyesi:
• Container CPU, RAM
• Restart sayısı
• Network I/O
• Disk I/O

Application Seviyesi:
• HTTP request/response time
• Error rate
• Custom metrics (Prometheus client library)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

📝 Logging Stack

EFK Stack (Elasticsearch + Fluentd + Kibana)

Log Flow:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Container → stdout/stderr

Node'daki Fluentd (DaemonSet)

Elasticsearch (cluster)

Kibana (visualization)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Query:
kubectl logs pod-name -f          # Pod log
kubectl logs -l app=web -f        # Label ile tüm pod'lar
kubectl logs pod-name --previous  # Crash olan pod'un logu

Kubernetes Security Best Practices

🔐 Güvenlik Kontrol Listesi

Kubernetes Security Checklist:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ RBAC etkinleştir
✅ Network Policies kullan
✅ Pod Security Standards (PSS)
✅ Secrets encryption at rest
✅ Image vulnerability scanning
✅ Private container registry
✅ Resource limits tanımla
✅ ReadOnlyRootFilesystem
✅ runAsNonRoot: true
✅ Privileged containers yasak
✅ API Server güvenliği
✅ etcd encryption
✅ Audit logging
✅ Regular security scans
✅ Keep Kubernetes updated
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Secure Pod Örneği:

apiVersion: v1
kind: Pod
metadata:
  name: secure-app
spec:
  securityContext:
    runAsNonRoot: true
    runAsUser: 1000
    fsGroup: 2000
    seccompProfile:
      type: RuntimeDefault
  containers:
  - name: app
    image: myapp:1.0
    securityContext:
      allowPrivilegeEscalation: false
      readOnlyRootFilesystem: true
      capabilities:
        drop:
        - ALL
    resources:
      limits:
        cpu: 500m
        memory: 512Mi
      requests:
        cpu: 100m
        memory: 128Mi

Kubernetes CI/CD Entegrasyonu

🔄 GitOps Workflow

ArgoCD ile GitOps:

GitOps Flow:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Developer → Git Push (manifest değişikliği)

GitHub/GitLab (Git repo)

ArgoCD (sürekli izler)

ArgoCD → Kubernetes Apply

Kubernetes Cluster (güncel deployment)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Avantajlar:
✅ Git = Single source of truth
✅ Declarative
✅ Otomatik sync
✅ Kolay rollback (git revert)
✅ Audit trail (git history)

Başarı Hikayeleri

🏢 Fintech Şirketi - Mikroservis Migrasyonu

Firma: Online ödeme platformu

Başlangıç Durumu:

  • Monolitik Java uygulaması
  • Tek sunucuda deployment
  • Deployment süresi: 4 saat
  • Downtime: 2-3 saat
  • Scaling manuel (1 hafta)
  • Peak saatlerde yavaşlık

Çözüm: Kubernetes + Mikroservis Mimarisi

Mimari Dönüşüm:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Monolith:
  payment-app.war (1 uygulama)

Mikroservisler:
  • user-service (kullanıcı yönetimi)
  • payment-service (ödeme işlemleri)
  • notification-service (bildirimler)
  • fraud-detection-service (dolandırıcılık tespiti)
  • reporting-service (raporlama)

Her mikroservis:
  → Deployment (3 replika)
  → Service (load balancing)
  → HPA (auto-scaling)
  → PVC (persistent data)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Teknoloji Stack:

  • Cluster: AWS EKS (3 node, t3.xlarge)
  • Container Runtime: containerd
  • Ingress: NGINX Ingress Controller
  • Service Mesh: Istio
  • Monitoring: Prometheus + Grafana
  • Logging: EFK Stack
  • CI/CD: Jenkins + ArgoCD

Sonuçlar (6 Ay Sonra):

  • Deployment Süresi: 4 saat → 5 dakika
  • Zero Downtime: Rolling update
  • Auto-Scaling: Peak saatlerde otomatik
  • Kaynak Kullanımı: %30 artış (waste azaldı)
  • Availability: %99.5 → %99.95
  • Developer Productivity: %200 artış
  • Maliyet: %40 azalma (efficient resource kullanımı)

🛒 E-Ticaret Platformu - Black Friday Hazırlığı

Firma: Türk e-ticaret sitesi

Sorun:

  • Black Friday’de site crash
  • Geçen yıl: 4 saat downtime
  • Manuel scaling yetersiz

Çözüm: Kubernetes + HPA

Black Friday Traffic:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Normal gün: 10,000 req/sn
Black Friday: 150,000 req/sn (15x)

Kubernetes Konfigürasyonu:
• HPA: min 10, max 100 pods
• Node auto-scaling (Cluster Autoscaler)
• Redis cache cluster
• Database read replicas
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Sonuçlar (Black Friday 2024):

  • Downtime: 0 saniye
  • Peak Pods: 10 → 85 (otomatik)
  • Response Time: <200ms (stabil)
  • Satış: %340 artış (geçen yıla göre)
  • Müşteri Memnuniyeti: %95

Kubernetes Eğitim ve Danışmanlık

📚 Eğitim Programlarımız

1. Kubernetes Temel Eğitimi (3 Gün)

Gün 1: Kubernetes Temelleri
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• Container ve Docker
• Kubernetes mimarisi
• kubectl kullanımı
• Pod, Deployment, Service
• Hands-on lab

Gün 2: İleri Konular
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• ConfigMap, Secret
• Persistent Volumes
• Ingress, Network Policies
• RBAC
• Helm

Gün 3: Production Best Practices
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• Monitoring (Prometheus)
• Logging (EFK)
• Security
• CI/CD entegrasyonu
• Troubleshooting
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Fiyat: 15,000 TL/kişi (şirket içi eğitim: teklif alın)

Hemen Başlayın

Kubernetes ile modern uygulama altyapısı kurun! Container orchestration, otomatik scaling, zero-downtime deployment ve cloud-native uygulamalar için profesyonel destek.

Kubernetes Hizmetlerimiz:

  • ✅ Kubernetes cluster kurulumu (on-premise/cloud)
  • ✅ Managed Kubernetes (AWS EKS, GKE, AKS)
  • ✅ Mikroservis mimarisi tasarımı
  • ✅ CI/CD pipeline (GitOps, ArgoCD)
  • ✅ Monitoring ve logging altyapısı
  • ✅ Security hardening
  • ✅ Kubernetes eğitimi
  • ✅ 7/24 destek ve bakım

Ücretsiz Kubernetes Danışmanlığı | Demo Cluster Talebi


İlgili Çözümler:

Popüler Aramalar: kubernetes, k8s, container orchestration, docker kubernetes, kubernetes kurulumu, mikroservis, cloud native, devops, kubectl, helm

Bu çözüm işletmeniz için uygun mu?

Uzman ekibimizle görüşün, size özel bir teklif hazırlayalım.