Skip to content

gitea(v 1.20.3) is not coming up after redis cluster pod ip is changed. #26893

@Baitanik

Description

@Baitanik

Description

We are installing gitea rootless 1.20.3 with helm chart 9.2.0 in azure k8s env.
We have dual stack (Ipv4 & Ipv6) configured in k8s .
Fresh install it is working fine.. redis pods with replica 6 (default) is coming up & gitea is also able to connect.

Now when the cluster is rebooted , as usual all pod IP is getting changed ... Now gitea is somewhere internally maintaining old Redis IP and due to that gitea is trying to connect to redis with old IP and it is not coming up after cluster reboot.

Below are the snippets of describe pods of the same. Error log is also mentioned at the end.

Before reboot :

Name:         xxx-gitea-redis-cluster-0
Namespace:   xxx-gitea-v120
Priority:     0
Node:         aks-xxxadmpool-12601847-vmss000004/10.21.59.11
Start Time:   Fri, 01 Sep 2023 09:59:51 +0000
Labels:       app.kubernetes.io/instance=xxx-gitea
                  app.kubernetes.io/managed-by=Helm
                  app.kubernetes.io/name=redis-cluster
                  controller-revision-hash=xxx-gitea-redis-cluster-cc896c5b4
                  helm.sh/chart=redis-cluster-8.6.9
                  statefulset.kubernetes.io/pod-name=xxx-gitea-redis-cluster-0
                 Annotations:  checksum/config: e66322f24abef75632d7c5335b085dac39cc52cba33a41fcaa2ce3cf4f41de65
              checksum/scripts: 40078a148340be5bb4194b7a9f71cc5472de9f6a1420054ece727d5cffa90ca9
              checksum/secret: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
Status:       Running
IP:           10.244.1.28
IPs:
  IP:           10.244.1.28 
  IP:           fd12:3456:789a:0:1::701 
Controlled By:  StatefulSet/xxx-gitea-redis-cluster
Containers:
  xxx-gitea-redis-cluster:
    Image:         docker.io/bitnami/redis-cluster:7.0.12-debian-11-r2

After reboot

 
Name:         xxx-gitea-redis-cluster-0
Namespace:    xxx-gitea-v120
Priority:     0
Node:         aks-ccmadmpool-12601847-vmss000007/10.21.59.11
Start Time:   Mon, 04 Sep 2023 05:14:06 +0000
Labels:       app.kubernetes.io/instance=xxx-gitea
                  app.kubernetes.io/managed-by=Helm
                  app.kubernetes.io/name=redis-cluster
                  controller-revision-hash=xxx-gitea-redis-cluster-cc896c5b4
                  helm.sh/chart=redis-cluster-8.6.9
                  statefulset.kubernetes.io/pod-name=xxx-gitea-redis-cluster-0
Annotations:  checksum/config: e66322f24abef75632d7c5335b085dac39cc52cba33a41fcaa2ce3cf4f41de65
                       checksum/scripts: 40078a148340be5bb4194b7a9f71cc5472de9f6a1420054ece727d5cffa90ca9
                       checksum/secret: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
Status:       Running
IP:           10.244.1.68
IPs:
  IP:           10.244.1.68 
  IP:           fd12:3456:789a:0:1::44 
Controlled By:  StatefulSet/xxx-gitea-redis-cluster
Containers:

In gitea log after reboot ::

2023/09/04 05:30:53 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /data/packages
2023/09/04 05:31:06 routers/init.go:60:mustInit() [F] code.gitea.io/gitea/modules/cache.NewContext failed: dial tcp [fd12:3456:789a:0:1::701]:6379: connect: no route to host

as here you can see the gitea is trying to connect to old address of redis master cluster.

Could you please help on this to resolve the issue

Gitea Version

1.20.3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

azure k8s cluster

How are you running Gitea?

We are running gitea in azure kubernetes environment.
k8s server version : 1.25

Database

PostgreSQL

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/needs-feedbackFor bugs, we need more details. For features, the feature must be described in more detail

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions