feat(k3s): expose gitea ssh via traefik tcp 2222
This commit is contained in:
26
doc/etap-003-gitea-ssh-expose-k3s.md
Normal file
26
doc/etap-003-gitea-ssh-expose-k3s.md
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
# Etap 003: Wystawienie SSH Gitei z k3s
|
||||||
|
|
||||||
|
Cel etapu: udostępnić SSH Gitei na publicznym porcie, żeby `git@gitea.mpabi.pl` trafiało do serwisu `gitea-ssh` w klastrze.
|
||||||
|
|
||||||
|
## Zakres
|
||||||
|
|
||||||
|
1. Dodać `HelmChartConfig` dla Traefika z entrypointem TCP `gitssh` na porcie `2222`.
|
||||||
|
2. Dodać `IngressRouteTCP` w namespace `gitea`, który kieruje ruch z `gitssh` do `service/gitea-ssh:22`.
|
||||||
|
3. Wdrożyć manifesty do klastra i zweryfikować:
|
||||||
|
- Traefik ma port `2222`,
|
||||||
|
- `IngressRouteTCP` jest aktywny,
|
||||||
|
- `ssh -p 2222 git@gitea.mpabi.pl` odpowiada Giteą.
|
||||||
|
|
||||||
|
## Decyzja techniczna
|
||||||
|
|
||||||
|
- Nie ruszamy hostowego `:22` (zostaje dla SSH systemu).
|
||||||
|
- Git SSH dla Gitei idzie przez `:2222`.
|
||||||
|
- Klienci Git powinni używać:
|
||||||
|
- `ssh://git@gitea.mpabi.pl:2222/trade/trade-iac.git`
|
||||||
|
- albo aliasu SSH z `Port 2222`.
|
||||||
|
|
||||||
|
## Kryteria akceptacji
|
||||||
|
|
||||||
|
- `kubectl -n kube-system get svc traefik` pokazuje port `2222/TCP`.
|
||||||
|
- `kubectl -n gitea get ingressroutetcp gitea-ssh` istnieje.
|
||||||
|
- Push/pull repo przez SSH na porcie `2222` działa.
|
||||||
13
k3s/gitea-ssh/ingressroutetcp-gitea-ssh.yaml
Normal file
13
k3s/gitea-ssh/ingressroutetcp-gitea-ssh.yaml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
apiVersion: traefik.io/v1alpha1
|
||||||
|
kind: IngressRouteTCP
|
||||||
|
metadata:
|
||||||
|
name: gitea-ssh
|
||||||
|
namespace: gitea
|
||||||
|
spec:
|
||||||
|
entryPoints:
|
||||||
|
- gitssh
|
||||||
|
routes:
|
||||||
|
- match: HostSNI(`*`)
|
||||||
|
services:
|
||||||
|
- name: gitea-ssh
|
||||||
|
port: 22
|
||||||
14
k3s/gitea-ssh/traefik-helmchartconfig-gitssh.yaml
Normal file
14
k3s/gitea-ssh/traefik-helmchartconfig-gitssh.yaml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
apiVersion: helm.cattle.io/v1
|
||||||
|
kind: HelmChartConfig
|
||||||
|
metadata:
|
||||||
|
name: traefik
|
||||||
|
namespace: kube-system
|
||||||
|
spec:
|
||||||
|
valuesContent: |-
|
||||||
|
ports:
|
||||||
|
gitssh:
|
||||||
|
port: 2222
|
||||||
|
expose:
|
||||||
|
default: true
|
||||||
|
exposedPort: 2222
|
||||||
|
protocol: TCP
|
||||||
Reference in New Issue
Block a user