Compare commits
2 Commits
bc65c8f90f
...
415af7efcd
| Author | SHA1 | Date | |
|---|---|---|---|
| 415af7efcd | |||
| 5427f3ff45 |
20
doc/etap-002-ssh-gitea.md
Normal file
20
doc/etap-002-ssh-gitea.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# Etap 002: SSH flow dla `gitea.mpabi.pl`
|
||||
|
||||
Cel etapu: przejść z push przez HTTPS/token na standardowy push przez SSH do `trade/trade-iac`.
|
||||
|
||||
## Zakres
|
||||
|
||||
1. Wygenerować dedykowany klucz SSH dla Gitei (jeśli brak).
|
||||
2. Dodać konfigurację hosta `gitea.mpabi.pl` w `~/.ssh/config`.
|
||||
3. Dodać klucz publiczny do konta `u1` w Gitei.
|
||||
4. Ustawić `origin` repo `trade-iac` na URL SSH.
|
||||
5. Zweryfikować:
|
||||
- `ssh -T git@gitea.mpabi.pl`,
|
||||
- `git ls-remote origin`,
|
||||
- `git push` bez hasła/tokena HTTP.
|
||||
|
||||
## Kryteria akceptacji
|
||||
|
||||
- SSH auth do Gitei działa dla użytkownika `git`.
|
||||
- `trade-iac` używa `git@gitea.mpabi.pl:trade/trade-iac.git`.
|
||||
- Push działa przez SSH.
|
||||
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