Files
K3S/addons/ingress-nginx/README.md
Sergey Antropoff 38aaadbfb1 docs: sync addon docs with explicit external/internal service modes
Обновлена документация под новые аддоны (gitlab, redis, mongodb, kafka, kafka-ui, rabbitmq) и новую модель явного выбора зависимостей. Добавлены и унифицированы описания переключателей *_database_mode и *_redis_mode, обновлена таблица зависимостей аддонов, примеры конфигурации и список vault-секретов.
2026-04-29 23:21:04 +03:00

132 lines
3.9 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ingress-nginx
HTTP/S Ingress controller. Устанавливается как LoadBalancer сервис, получает IP от kube-vip. Включает кастомную страницу ошибок и поддерживает все стандартные аннотации nginx-ingress.
## Быстрый старт
```yaml
# group_vars/all/addons.yml
addon_ingress_nginx: true
```
```bash
make addon-ingress-nginx
```
## Параметры
| Переменная | Умолч. | Описание |
|---|---|---|
| `ingress_nginx_service_type` | `LoadBalancer` | LoadBalancer \| NodePort |
| `ingress_nginx_load_balancer_ip` | `""` | Статический IP (авто если пусто) |
| `ingress_nginx_replica_count` | `1` | Количество реплик |
| `ingress_nginx_use_daemonset` | `false` | DaemonSet вместо Deployment |
| `ingress_nginx_class_name` | `nginx` | IngressClass имя |
| `ingress_nginx_custom_errors_enabled` | `true` | Кастомная страница ошибок |
## Кастомная страница ошибок
```yaml
ingress_nginx_custom_errors_enabled: true
ingress_nginx_error_cluster_name: "Production K3S"
ingress_nginx_error_cluster_domain: "cluster.example.com"
```
## Основные аннотации
```yaml
metadata:
annotations:
# TLS через cert-manager
cert-manager.io/cluster-issuer: "letsencrypt-prod"
# Размер загружаемых файлов
nginx.ingress.kubernetes.io/proxy-body-size: "100m"
# Таймауты
nginx.ingress.kubernetes.io/proxy-read-timeout: "300"
nginx.ingress.kubernetes.io/proxy-send-timeout: "300"
# CORS
nginx.ingress.kubernetes.io/enable-cors: "true"
nginx.ingress.kubernetes.io/cors-allow-origin: "https://app.example.com"
# Basic Auth
nginx.ingress.kubernetes.io/auth-type: basic
nginx.ingress.kubernetes.io/auth-secret: basic-auth
nginx.ingress.kubernetes.io/auth-realm: "Authentication Required"
# Rate limiting
nginx.ingress.kubernetes.io/limit-rps: "10"
# WebSocket
nginx.ingress.kubernetes.io/proxy-http-version: "1.1"
nginx.ingress.kubernetes.io/configuration-snippet: |
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# Redirect HTTP → HTTPS
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
# SSL passthrough (для TCP-приложений)
nginx.ingress.kubernetes.io/ssl-passthrough: "true"
```
## Пример Ingress с TLS
```yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: my-app
namespace: my-app
annotations:
cert-manager.io/cluster-issuer: "letsencrypt-prod"
nginx.ingress.kubernetes.io/proxy-body-size: "50m"
spec:
ingressClassName: nginx
tls:
- hosts:
- myapp.example.com
secretName: myapp-tls
rules:
- host: myapp.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: my-app
port:
number: 80
```
## Basic Auth Secret
```bash
htpasswd -c auth admin
kubectl create secret generic basic-auth \
--from-file=auth \
-n my-app
```
## NodePort (без kube-vip)
```yaml
ingress_nginx_service_type: "NodePort"
ingress_nginx_http_nodeport: 30080
ingress_nginx_https_nodeport: 30443
```
## DaemonSet (для edge/RPi кластеров)
```yaml
ingress_nginx_use_daemonset: true
```
## Официальные ресурсы
- Официальный сайт: [https://kubernetes.github.io/ingress-nginx/](https://kubernetes.github.io/ingress-nginx/)
- Официальная документация: [https://kubernetes.github.io/ingress-nginx/user-guide/](https://kubernetes.github.io/ingress-nginx/user-guide/)
- Версии Helm chart / ПО: [https://artifacthub.io/packages/helm/ingress-nginx/ingress-nginx](https://artifacthub.io/packages/helm/ingress-nginx/ingress-nginx)