> ## Documentation Index
> Fetch the complete documentation index at: https://ayakaleaf-pro.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 5. Ayakaleaf Pro'yu dağıtın

> Ayakaleaf Pro pod'unu, veri birimini ve bir NodePort Service'ini dağıtın.

```yaml title="40-overleaf.yaml" wrap theme={null}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: overleaf-data
  namespace: overleaf
spec:
  accessModes: [ReadWriteOnce]
  resources:
    requests:
      storage: 20Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: overleaf
  namespace: overleaf
spec:
  replicas: 1
  strategy:
    type: Recreate          # one pod owns the data volume; never run two at once
  selector:
    matchLabels:
      app: overleaf
  template:
    metadata:
      labels:
        app: overleaf
    spec:
      terminationGracePeriodSeconds: 60   # time to flush pending edits, like the Toolkit
      # Keep the environment to what the ConfigMap and Secret set: no REDIS_PORT=tcp://... and the like
      enableServiceLinks: false
      containers:
        - name: sharelatex
          image: ghcr.io/ayaka-notes/overleaf-pro:6.3.2
          envFrom:
            - configMapRef:
                name: overleaf-env
            - secretRef:
                name: overleaf-secrets
          ports:
            - containerPort: 80
          readinessProbe:
            httpGet:
              path: /status
              port: 80
            periodSeconds: 10
          resources:
            requests:
              cpu: 500m
              memory: 1536Mi
            limits:
              memory: 3Gi
          volumeMounts:
            - name: data
              mountPath: /var/lib/overleaf
            - name: compiles
              mountPath: /var/lib/overleaf/data/compiles
            - name: output
              mountPath: /var/lib/overleaf/data/output
            - name: cache
              mountPath: /var/lib/overleaf/data/cache
            - name: docker-sock
              mountPath: /var/run/docker.sock
      volumes:
        - name: data
          persistentVolumeClaim:
            claimName: overleaf-data
        # Compile scratch space on the node; same paths as SANDBOXED_COMPILES_HOST_DIR_*
        - name: compiles
          hostPath:
            path: /srv/overleaf/compiles
            type: DirectoryOrCreate
        - name: output
          hostPath:
            path: /srv/overleaf/output
            type: DirectoryOrCreate
        - name: cache
          hostPath:
            path: /srv/overleaf/cache
            type: DirectoryOrCreate
        - name: docker-sock
          hostPath:
            path: /var/run/docker.sock
            type: Socket
---
apiVersion: v1
kind: Service
metadata:
  name: overleaf
  namespace: overleaf
spec:
  type: NodePort
  selector:
    app: overleaf
  ports:
    - name: http
      port: 80
      targetPort: 80
      nodePort: 30080
```

```bash theme={null}
kubectl apply -f 40-overleaf.yaml
kubectl -n overleaf rollout status deployment/overleaf --timeout=10m
kubectl -n overleaf logs deployment/overleaf | grep -E 'Finished migrations|Missing required'
```

İlk başlatma veritabanı geçişlerini çalıştırır ve bir iki dakika sürer. Pod, `/status` yanıt verdiğinde hazırdır; ardından `OVERLEAF_SITE_URL` adresini açın.

### Manifest neden böyle görünüyor

* **Veri birimi.** `/var/lib/overleaf` altındaki her şey (proje dosyaları, geçmiş, yüklemeler) PVC üzerinde bulunur. local-path gibi düğüme yerel depolamayla veriler tek bir düğümde kalır; ağ blok depolamasıyla pod düğümler arasında taşınabilir.
* **Derleme birimleri ve Docker soketi.** Ayakaleaf Pro, düğümün Docker'ından bir TeX Live konteyneri başlatmasını ister ve projenin derleme dizinini ona **düğümdeki yolu üzerinden** verir. Bu nedenle bu dizinler `hostPath` birimleridir ve yolları `SANDBOXED_COMPILES_HOST_DIR_*` içinde tekrarlanır. İçerikleri geçici verilerdir ve yedeklenmeleri gerekmez.
* **`enableServiceLinks: false`.** Kubernetes, ad alanındaki her Service için her pod'a Docker tarzı değişkenler ekler: `redis` Service'i `REDIS_PORT=tcp://10.x.x.x:6379`, `git-bridge` Service'i `GIT_BRIDGE_PORT=tcp://...` olur. Bazı Overleaf hizmetleri bu adlara sahip değişkenleri okur. Bu pod'da `OVERLEAF_REDIS_*` ve ConfigMap'teki ayarlar önceliklidir, ancak git-bridge `GIT_BRIDGE_PORT` değerini port olarak alır ve durur (bkz. [Git entegrasyonu](https://ayakaleaf-pro.mintlify.site/tr/on-premises/configuration/kubernetes/integrations/git-integration.md)). Bağlantıları kapatmak, ortamı yalnızca sizin ayarladıklarınızla sınırlar.
* **`Recreate`.** İki pod asla aynı veri birimini kullanmamalı veya aynı anda geçiş çalıştırmamalıdır.
* **Dışarıya açma.** NodePort Service'i her düğümün `30080` portunda yanıt verir. Üretimde önüne ingress denetleyicinizi veya yük dengeleyicinizi koyun ve TLS'yi orada sonlandırın; WebSocket'lere, 10 dakikalık istek zaman aşımlarına (uzun derlemeler) ve 50 MB'lık yüklemelere izin vermeli ve `X-Forwarded-For` ile `X-Forwarded-Proto` başlıklarını iletmelidir.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.