[Reverse proxy][Kubernetes][Traefik]Unable to access gitea. #9241

Closed
opened 2025-11-02 08:33:05 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @ChenpiDog on GitHub (Jul 20, 2022).

Description

Enter the domain name of the reverse proxy but jump to http://localhost:3000/ , so that gitea cannot be accessed normally.

Here are all my configurations:

01-service.yaml
apiVersion: v1
kind: Service
metadata:
name: traefik

spec:
ports:
- protocol: TCP
name: web
port: 8000
- protocol: TCP
name: admin
port: 8080
- protocol: TCP
name: websecure
port: 4443
selector:
app: traefik


apiVersion: v1
kind: Service
metadata:
name: gitea

spec:
ports:
- protocol: TCP
name: web
port: 3000
- protocol: TCP
name: ssh
port: 22
selector:
app: gitea

02-deployment.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
namespace: default
name: traefik-ingress-controller


kind: Deployment
apiVersion: apps/v1
metadata:
namespace: default
name: traefik
labels:
app: traefik

spec:
replicas: 1
selector:
matchLabels:
app: traefik
template:
metadata:
labels:
app: traefik
spec:
serviceAccountName: traefik-ingress-controller
containers:
- name: traefik
image: traefik:v2.8
args:
- --api.insecure
- --accesslog
- --entrypoints.web.Address=:8000
- --entrypoints.websecure.Address=:4443
- --providers.kubernetescrd
- --certificatesresolvers.myresolver.acme.tlschallenge
- --certificatesresolvers.myresolver.acme.email=foo@you.com
- --certificatesresolvers.myresolver.acme.storage=acme.json
# Please note that this is the staging Let's Encrypt server.
# Once you get things working, you should remove that whole line altogether.
# - --certificatesresolvers.myresolver.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory
ports:
- name: web
containerPort: 8000
- name: websecure
containerPort: 4443
- name: admin
containerPort: 8080


kind: Deployment
apiVersion: apps/v1
metadata:
namespace: default
name: gitea
labels:
app: gitea

spec:
replicas: 1
selector:
matchLabels:
app: gitea
template:
metadata:
labels:
app: gitea
spec:
containers:
- name: gitea
image: gitea/gitea:1.16.8
ports:
- name: web
containerPort: 3000

03-ingressroute.yaml
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: simpleingressroute
namespace: default
spec:
entryPoints:
- web
routes:

  • match: Host(test.gitea.com) && PathPrefix(/notls)
    kind: Rule
    services:
    • name: gitea
      port: 3000

apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: ingressroutetls
namespace: default
spec:
entryPoints:
- websecure
routes:

  • match: Host(test.gitea.com) && PathPrefix(/tls)
    kind: Rule
    services:
    • name: gitea
      port: 3000
      tls:
      certResolver: myresolver

Gitea Version

1.16.8

Can you reproduce the bug on the Gitea demo site?

No

Operating System

No response

Browser Version

Google

Originally created by @ChenpiDog on GitHub (Jul 20, 2022). ### Description Enter the domain name of the reverse proxy but jump to http://localhost:3000/ , so that gitea cannot be accessed normally. Here are all my configurations: **01-service.yaml** apiVersion: v1 kind: Service metadata: name: traefik spec: ports: - protocol: TCP name: web port: 8000 - protocol: TCP name: admin port: 8080 - protocol: TCP name: websecure port: 4443 selector: app: traefik --- apiVersion: v1 kind: Service metadata: name: gitea spec: ports: - protocol: TCP name: web port: 3000 - protocol: TCP name: ssh port: 22 selector: app: gitea **02-deployment.yaml** apiVersion: v1 kind: ServiceAccount metadata: namespace: default name: traefik-ingress-controller --- kind: Deployment apiVersion: apps/v1 metadata: namespace: default name: traefik labels: app: traefik spec: replicas: 1 selector: matchLabels: app: traefik template: metadata: labels: app: traefik spec: serviceAccountName: traefik-ingress-controller containers: - name: traefik image: traefik:v2.8 args: - --api.insecure - --accesslog - --entrypoints.web.Address=:8000 - --entrypoints.websecure.Address=:4443 - --providers.kubernetescrd - --certificatesresolvers.myresolver.acme.tlschallenge - --certificatesresolvers.myresolver.acme.email=foo@you.com - --certificatesresolvers.myresolver.acme.storage=acme.json # Please note that this is the staging Let's Encrypt server. # Once you get things working, you should remove that whole line altogether. # - --certificatesresolvers.myresolver.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory ports: - name: web containerPort: 8000 - name: websecure containerPort: 4443 - name: admin containerPort: 8080 --- kind: Deployment apiVersion: apps/v1 metadata: namespace: default name: gitea labels: app: gitea spec: replicas: 1 selector: matchLabels: app: gitea template: metadata: labels: app: gitea spec: containers: - name: gitea image: gitea/gitea:1.16.8 ports: - name: web containerPort: 3000 **03-ingressroute.yaml** apiVersion: traefik.containo.us/v1alpha1 kind: IngressRoute metadata: name: simpleingressroute namespace: default spec: entryPoints: - web routes: - match: Host(`test.gitea.com`) && PathPrefix(`/notls`) kind: Rule services: - name: gitea port: 3000 --- apiVersion: traefik.containo.us/v1alpha1 kind: IngressRoute metadata: name: ingressroutetls namespace: default spec: entryPoints: - websecure routes: - match: Host(`test.gitea.com`) && PathPrefix(`/tls`) kind: Rule services: - name: gitea port: 3000 tls: certResolver: myresolver ### Gitea Version 1.16.8 ### Can you reproduce the bug on the Gitea demo site? No ### Operating System _No response_ ### Browser Version Google
Author
Owner

@techknowlogick commented on GitHub (Jul 20, 2022):

Have you provided Gitea any configuration? Please also use the helm chart as that is the supported path for installing Gitea on kubernetes. If the helm chart fails please open another ticket.

@techknowlogick commented on GitHub (Jul 20, 2022): Have you provided Gitea any configuration? Please also use the helm chart as that is the supported path for installing Gitea on kubernetes. If the helm chart fails please open another ticket.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#9241