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

# 2. Tạo namespace và secret

> Tạo namespace và các secret mà Ayakaleaf Pro cần.

Mọi thứ đều nằm trong namespace `overleaf`:

```bash theme={null}
kubectl create namespace overleaf
```

Ayakaleaf Pro đọc các secret của nó từ biến môi trường. Hãy tạo chúng một lần và lưu trong một Secret:

```bash wrap theme={null}
HISTORY=$(openssl rand -hex 32)
kubectl -n overleaf create secret generic overleaf-secrets \
  --from-literal=OVERLEAF_INVITE_TOKEN_SECRET="$(openssl rand -base64 32)" \
  --from-literal=OVERLEAF_SESSION_SECRET="$(openssl rand -hex 32)" \
  --from-literal=WEB_API_PASSWORD="$(openssl rand -hex 32)" \
  --from-literal=STAGING_PASSWORD="$HISTORY" \
  --from-literal=V1_HISTORY_PASSWORD="$HISTORY" \
  --from-literal=CRYPTO_RANDOM="$(openssl rand -hex 32)" \
  --from-literal=OT_JWT_AUTH_KEY="$(openssl rand -hex 32)"
```

| Secret | Lý do |
| - | - |
| `OVERLEAF_INVITE_TOKEN_SECRET` | Bắt buộc. Nếu thiếu, pod sẽ dừng với thông báo "Missing required secrets". Thay đổi giá trị này sẽ làm mất hiệu lực các lời mời tham gia dự án đang chờ. |
| `OVERLEAF_SESSION_SECRET` | Ký các cookie phiên. Nếu thiếu, mỗi lần pod khởi động lại sẽ đăng xuất tất cả mọi người. |
| `WEB_API_PASSWORD`, `CRYPTO_RANDOM`, `OT_JWT_AUTH_KEY` | Các secret nội bộ. Container tự tạo chúng mỗi lần khởi động nếu chúng bị thiếu; với nhiều hơn một replica, tất cả các replica phải dùng chung chúng. |
| `STAGING_PASSWORD` và `V1_HISTORY_PASSWORD` | Secret nội bộ cho lịch sử; cả hai phải có **cùng** một giá trị. |

> [!WARNING]
>
> Hãy sao lưu Secret (`kubectl -n overleaf get secret overleaf-secrets -o yaml`) cùng với dữ liệu của bạn. Các tính năng mã hóa token trong MongoDB cũng cần các mật khẩu mã hóa riêng trong Secret này, ví dụ `GITHUB_TOKEN_CIPHER_PASSWORD` cho [Đồng bộ hóa GitHub](https://ayakaleaf-pro.mintlify.site/vi/on-premises/configuration/overleaf-toolkit/integrations/github-synchronisation.md).


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