iac/k3s/manifests/flux/bridge-gitea.yaml

40 lines
1.1 KiB
YAML
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.

# DNS-мост: имя `gitea` в namespace flux-system → compose-контейнер gitea.
# Service без селектора + ручной Endpoints, по образцу bridge-postgres/bridge-minio.
#
# Зачем: source-controller Flux работает ВНУТРИ k3s, где резолвит CoreDNS, а имя
# сервиса compose-сети там не существует. Без моста GitRepository падает с
# "lookup gitea on 10.43.0.10:53: no such host".
#
# __GITEA_BRIDGE_IP__ подставляет контейнер flux-k8s-init из переменной
# GITEA_BRIDGE_IP — она же задаёт ipv4_address сервиса gitea в docker-compose.
---
apiVersion: v1
kind: Namespace
metadata:
name: flux-system
---
apiVersion: v1
kind: Service
metadata:
name: gitea
namespace: flux-system
spec:
ports:
- name: http
port: 3000
targetPort: 3000
protocol: TCP
---
apiVersion: v1
kind: Endpoints
metadata:
name: gitea
namespace: flux-system
subsets:
- addresses:
- ip: __GITEA_BRIDGE_IP__
ports:
- name: http
port: 3000
protocol: TCP