> ## 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.

# Kubernetes

> Cấu hình triển khai Kubernetes - nơi đặt các thiết lập, secret và tệp, cùng một trang cho mỗi tính năng.

Một triển khai Kubernetes đọc cùng các biến môi trường như Toolkit. Khi một trang Toolkit nói “thêm giá trị này vào `config/variables.env`”, hãy đặt giá trị đó vào ConfigMap `overleaf-env`, hoặc vào Secret `overleaf-secrets` khi đó là mật khẩu, khóa hoặc token. Sau đó khởi động lại:

```bash theme={null}
kubectl -n overleaf apply -f 30-config.yaml        # after editing the ConfigMap
kubectl -n overleaf patch secret overleaf-secrets --type merge \
  -p '{"stringData":{"GITHUB_TOKEN_CIPHER_PASSWORD":"'"$(openssl rand -hex 32)"'"}}'
kubectl -n overleaf rollout restart deployment/overleaf
```

Các giá trị trong `config/overleaf.rc` là thiết lập của Toolkit, không phải biến môi trường; phần Hỏi & Đáp ở cuối trang này cho biết những gì thay thế chúng.

### Tính năng

Mỗi tính năng của cấu hình Toolkit có một trang tại đây, mô tả các dịch vụ, thiết lập, đường mạng, tác vụ nền, những gì thay đổi khi có nhiều replica, và cách tính năng đã được kiểm thử:

| Tính năng | Dịch vụ trong pod | Ngoài ConfigMap và Secret |
| - | - | - |
| [Xác thực](https://ayakaleaf-pro.mintlify.site/vi/on-premises/configuration/kubernetes/authentication): [OIDC](https://ayakaleaf-pro.mintlify.site/vi/on-premises/configuration/kubernetes/authentication/oidc-authentication.md), [SAML](https://ayakaleaf-pro.mintlify.site/vi/on-premises/configuration/kubernetes/authentication/saml-authentication.md), [LDAP](https://ayakaleaf-pro.mintlify.site/vi/on-premises/configuration/kubernetes/authentication/ldap-authentication.md), [Truy cập công khai](https://ayakaleaf-pro.mintlify.site/vi/on-premises/configuration/kubernetes/authentication/public-access.md), [reCAPTCHA](https://ayakaleaf-pro.mintlify.site/vi/on-premises/configuration/kubernetes/authentication/recaptcha.md), [Hạn chế mật khẩu](https://ayakaleaf-pro.mintlify.site/vi/on-premises/configuration/kubernetes/authentication/password-restrictions.md) | web | client secret, chứng chỉ IdP, CA của LDAP |
| [Biên dịch trong sandbox](https://ayakaleaf-pro.mintlify.site/vi/on-premises/configuration/kubernetes/sandboxed-compiles.md) | clsi | Docker Engine và các image TeX Live trên mọi node |
| [Nhập và xuất bằng Pandoc](https://ayakaleaf-pro.mintlify.site/vi/on-premises/configuration/kubernetes/pandoc-import-and-export.md) | clsi, web | image Pandoc trong Docker trên mọi node |
| [Tích hợp Git](https://ayakaleaf-pro.mintlify.site/vi/on-premises/configuration/kubernetes/integrations/git-integration.md) | git-bridge (pod riêng), web, history-v1 | StatefulSet git-bridge và hai Service |
| Đồng bộ hóa [GitHub](https://ayakaleaf-pro.mintlify.site/vi/on-premises/configuration/kubernetes/integrations/github-synchronisation.md), [GitLab](https://ayakaleaf-pro.mintlify.site/vi/on-premises/configuration/kubernetes/integrations/gitlab-synchronisation.md), [Gitea](https://ayakaleaf-pro.mintlify.site/vi/on-premises/configuration/kubernetes/integrations/gitea-synchronisation.md) | web | Tích hợp Git |
| [Đồng bộ hóa Dropbox](https://ayakaleaf-pro.mintlify.site/vi/on-premises/configuration/kubernetes/integrations/dropbox-synchronisation.md) | web, third-party-datastore, document-updater | Tích hợp Git, webhook truy cập được từ internet, chỉ mục cơ sở dữ liệu |
| Tích hợp [Zotero](https://ayakaleaf-pro.mintlify.site/vi/on-premises/configuration/kubernetes/integrations/zotero-integration.md), [Mendeley](https://ayakaleaf-pro.mintlify.site/vi/on-premises/configuration/kubernetes/integrations/mendeley-integration.md) | web | cipher password trong Secret |
| [MCP Server](https://ayakaleaf-pro.mintlify.site/vi/on-premises/configuration/kubernetes/integrations/mcp-server.md) | web | Tích hợp Git |
| [Tích hợp AI](https://ayakaleaf-pro.mintlify.site/vi/on-premises/configuration/kubernetes/integrations/ai-integration.md) | web, linked-url-proxy | – |
| [Overleaf Import API](https://ayakaleaf-pro.mintlify.site/vi/on-premises/configuration/kubernetes/integrations/overleaf-import-api.md) | web, linked-url-proxy | – |
| [Mẫu](https://ayakaleaf-pro.mintlify.site/vi/on-premises/configuration/kubernetes/templates.md) | web, filestore | S3 khi có nhiều replica |
| [URL bên ngoài](https://ayakaleaf-pro.mintlify.site/vi/on-premises/configuration/kubernetes/external-url.md) | linked-url-proxy | địa chỉ công khai của các node trong `OVERLEAF_LINKED_URL_BLOCKED_NETWORKS` |
| [Ghi log](https://ayakaleaf-pro.mintlify.site/vi/on-premises/configuration/kubernetes/logging.md) | mọi dịch vụ | một volume tại `/var/log/overleaf` để lưu log |
| [Proxy TLS](https://ayakaleaf-pro.mintlify.site/vi/on-premises/configuration/kubernetes/tls-proxy.md) | ingress hoặc load balancer của bạn | TLS kết thúc phía trước các pod |
| [Thương hiệu](https://ayakaleaf-pro.mintlify.site/vi/on-premises/configuration/kubernetes/branding.md) | web | – |
| [Bản địa hóa](https://ayakaleaf-pro.mintlify.site/vi/on-premises/configuration/kubernetes/localization.md) | web | một tên máy chủ cho mỗi ngôn ngữ |
| [Gửi email](https://ayakaleaf-pro.mintlify.site/vi/on-premises/configuration/kubernetes/email-delivery.md) | web | – |
| [Redis](https://ayakaleaf-pro.mintlify.site/vi/on-premises/configuration/kubernetes/redis.md) | mọi dịch vụ có trạng thái trực tiếp | – |
| [S3](https://ayakaleaf-pro.mintlify.site/vi/on-premises/configuration/kubernetes/s3.md) | history-v1, filestore | một dịch vụ S3, bắt buộc khi có nhiều replica |
| [Thêm trợ giúp LaTeX cho người dùng](https://ayakaleaf-pro.mintlify.site/vi/on-premises/configuration/kubernetes/adding-latex-user-help.md) | web | các pod phải truy cập được wiki |
| [Mở rộng theo chiều ngang](https://ayakaleaf-pro.mintlify.site/vi/on-premises/configuration/kubernetes/horizontal-scaling.md) | tất cả | S3, một load balancer với sticky session |

### Chứng chỉ và các tệp khác

Một số tính năng nhận đường dẫn tệp thay vì giá trị: các chứng chỉ SAML (`OVERLEAF_SAML_IDP_CERT`, ...), CA của LDAP (`OVERLEAF_LDAP_TLS_OPTS_CA_PATH`), hoặc một CA riêng cho GitHub Enterprise, GitLab hoặc Gitea tự lưu trữ (`NODE_EXTRA_CA_CERTS`). Hãy đưa các tệp vào một Secret và mount nó tại nơi các trang Toolkit mong đợi, `/var/lib/overleaf/certs`:

```bash theme={null}
kubectl -n overleaf create secret generic overleaf-certs --from-file=idp_cert.pem --from-file=ca.pem
```

```yaml title="40-overleaf.yaml (additions)" theme={null}
          volumeMounts:
            # ...
            - name: certs
              mountPath: /var/lib/overleaf/certs
              readOnly: true
      volumes:
        # ...
        - name: certs
          secret:
            secretName: overleaf-certs
```

Sau đó tham chiếu tới chúng bằng đường dẫn trong ConfigMap, ví dụ `NODE_EXTRA_CA_CERTS: /var/lib/overleaf/certs/ca.pem`, rồi khởi động lại.

> [!WARNING]
>
> **Cipher password.** Hãy đặt mọi `*_CIPHER_PASSWORD` của các tính năng bạn sử dụng trong Secret. Nếu không, một số tính năng sẽ tạo tệp khóa trong volume dữ liệu ở lần sử dụng đầu tiên: với một replica, cách này hoạt động cho đến khi volume bị mất; với nhiều replica, mỗi replica sẽ mã hóa bằng một khóa khác nhau.

### Hỏi & Đáp

> [accordion] Tôi cần những thiết lập Toolkit nào từ `config/overleaf.rc`?
>
> **Trả lời:** Ayakaleaf Pro không đọc thiết lập nào trong số đó. Các thành phần tương ứng trên Kubernetes:
>
> | `config/overleaf.rc` | Kubernetes |
> | - | - |
> | `OVERLEAF_LISTEN_IP`, `OVERLEAF_PORT` | Service (NodePort) hoặc ingress của bạn |
> | `SIBLING_CONTAINERS_ENABLED` | `SANDBOXED_COMPILES*` trong ConfigMap, Docker socket trong pod |
> | `GIT_BRIDGE_ENABLED` | [Tích hợp Git](https://ayakaleaf-pro.mintlify.site/vi/on-premises/configuration/kubernetes/integrations/git-integration.md) |
> | `MONGO_ENABLED`, `REDIS_ENABLED`, `MONGO_URL`, `REDIS_HOST` | các StatefulSet hoặc dịch vụ được quản lý của bạn, `OVERLEAF_MONGO_URL` và `OVERLEAF_REDIS_HOST` |
> | `REDIS_AOF_PERSISTENCE` | `--appendonly yes` trong `20-redis.yaml` |
> | `NGINX_ENABLED`, `TLS_*` | ingress hoặc load balancer của bạn |


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