Intermittent SSH connection failures to Gitea via Traefik on K3s #592
Unanswered
MarcRibasG
asked this question in
Q&A
Replies: 1 comment
-
|
Traefik can be a bit buggy with raw TCP. I remember facing issues with it in the past, and I've seen similar discussions in various places. I no longer use Traefik myself. It might be better to use a load balancer for Gitea's SSH access. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm a little desperate and I don't know where I can find help.
Problem Description:
I am experiencing intermittent connection issues when trying to perform Git operations (e.g., git clone) over SSH to a Gitea instance running in my K3s cluster. The Gitea instance is exposed via Traefik using an SSH entrypoint on port 2222.
Sometimes, commands like git clone git@git.example.com:marc.ribas/test.git fail with:
Cloning into 'test'...
kex_exchange_identification: Connection closed by remote host
Connection closed by x.x.x.x port 2222
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
When this happens, I see corresponding errors in my Traefik logs:
2025-05-21T11:20:04Z ERR Error while handling TCP connection error="writeto tcp 10.42.0.228:44464->10.42.2.244:22: read tcp 10.42.0.228:44464->10.42.2.244:22: read: connection reset by peer"
(Note: The Gitea pod IP like 10.42.2.244 can change if the pod restarts; the issue persists across different Gitea pod IPs.)
And some gitea log to higlight: Timeout before authentication for connection from 10.42.0.228 to 10.42.2.244, pid = 1272
The issue is intermittent. Sometimes connections work fine, other times they fail with the reset by peer from Traefik. HTTP/S access to Gitea (also via Traefik) seems stable.
Environment Details:
Kubernetes: K3s (I'm using Traefik v3 deployed via Helm)
Master Node (core-1): K3s v1.32.4+k3s1
Worker Node (code-1): K3s v1.31.4+k3s1
Cloud Provider: Hetzner Cloud
Ingress Controller: Traefik (deployed via HelmChartConfig, v3 )
Traefik pod runs on node core-1.
Application: Gitea gitea/gitea:1.23.8
Gitea pod runs on node code-1.
My configuration:
Traefik HelmChartConfig:
Gitea Deployment:
I really don't know how to start solving this intermittent problem with the SSH connection when doing git commands. Thank you very much in advance.
Beta Was this translation helpful? Give feedback.
All reactions