AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • Início
  • system&network
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • Início
  • system&network
    • Recentes
    • Highest score
    • tags
  • Ubuntu
    • Recentes
    • Highest score
    • tags
  • Unix
    • Recentes
    • tags
  • DBA
    • Recentes
    • tags
  • Computer
    • Recentes
    • tags
  • Coding
    • Recentes
    • tags
Início / server / Perguntas / 1171564
Accepted
Nilcouv
Nilcouv
Asked: 2025-01-24 02:31:20 +0800 CST2025-01-24 02:31:20 +0800 CST 2025-01-24 02:31:20 +0800 CST

Wikijs - Ingress "Todos os serviços de backend estão em estado NÃO ÍNTEGRA"

  • 772

Problema: Estou executando o Wiki.js em um cluster zonal do GKE e estou encontrando um problema com minha configuração do Ingress. O controlador do Ingress retorna "Todos os serviços de backend estão em estado UNHEALTHY" e o grupo de endpoints de rede zonal mostra 0/1 endpoints operacionais. Isso acontece após editar as configurações no painel de administração do wikijs.

Ambiente:

  • Cluster Zonal do GKE
  • Versão do Wiki.js: 2.5

Situação atual:

  • Todos os pods estão funcionando
  • ainda é possível conectar-se ao wikijs através do IP do serviço
  • Grupo de endpoint de rede zonal: 0/1 operacional

Configuração atual:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: test-wikijs
  namespace: test
  labels:
    app: test-wikijs
spec:
  replicas: 1
  selector:
    matchLabels:
      app: test-wikijs
  template:
    metadata:
      labels:
        app: test-wikijs
    spec:
      initContainers:
      - name: init-permissions
        image: busybox
        command: ["sh", "-c", "chmod -R 777 /wiki/data && chown -R 1000:1000 /wiki/data"]
        volumeMounts:
        - name: wikijs-data
          mountPath: /wiki/data
      containers:
      - name: test-wikijs
        image: requarks/wiki:2.5
        ports:
        - containerPort: 3000
        env:
          - name: DB_TYPE
            valueFrom:
              configMapKeyRef:
                name: test-wikjs-config
                key: DB_TYPE
          - name: DB_HOST
            valueFrom:
              configMapKeyRef:
                name: test-wikjs-config
                key: DB_HOST
          - name: DB_PORT
            valueFrom:
              configMapKeyRef:
                name: test-wikjs-config
                key: DB_PORT
          - name: DB_NAME
            valueFrom:
              secretKeyRef:
                name: sql-secret
                key: POSTGRES_DB
          - name: DB_USER
            valueFrom:
              secretKeyRef:
                name: sql-secret
                key: POSTGRES_USER
          - name: DB_PASS
            valueFrom:
              secretKeyRef:
                name: sql-secret
                key: POSTGRES_PASSWORD
        volumeMounts:
        - name: wikijs-data
          mountPath: /wiki/data
      volumes:
      - name: wikijs-data
        persistentVolumeClaim:
          claimName: wikijs-data-pvc
---
# Service WikiJS
apiVersion: v1
kind: Service
metadata:
  name: test-wikijs         # Nom du service
  namespace: test
  labels:
    app: test-wikijs
spec:
  selector:
    app: test-wikijs         # Sélectionne les pods avec le label app=wikijs
  ports:
  - port: 80            # Port exposé par le service
    targetPort: 3000    # Port de l'application WikiJS
  type: LoadBalancer    # Type de service qui expose l'application à l'extérieur

Registros

PS C:\Users\nicol\Git\test> # Liste des ingress
>> kubectl get ingress -n test
>>
>> # Description détaillée de l'ingress
>> kubectl describe ingress wikijs-ingress-multi -n test
NAME                   CLASS    HOSTS   ADDRESS         PORTS   AGE
wikijs-ingress-multi   <none>   *       **.**.***.***   80      51m
Name:             wikijs-ingress-multi
Labels:           <none>
Namespace:        test
Address:          **.**.***.***
Ingress Class:    <none>
Default backend:  test-wikijs:80 (10.112.1.14:3000)
Rules:
  Host        Path  Backends
  ----        ----  --------
  *           *     test-wikijs:80 (10.112.1.14:3000)
Annotations:  ingress.gcp.kubernetes.io/pre-shared-cert:
                mcrt-5eff98e5-8917-4807-9148-79c10698f34a,mcrt-76d117a0-71b0-422f-8947-1e39df945093,mcrt-ac4dc442-6a28-4d0f-b8bf-767f1ee1511a
              ingress.kubernetes.io/backends: {"k8s1-16d8895a-test-test-wikijs-80-1cd44efb":"UNHEALTHY"}
              ingress.kubernetes.io/forwarding-rule: k8s2-fr-3t143vku-test-wikijs-ingress-multi-xlcxo7jh
              ingress.kubernetes.io/https-forwarding-rule: k8s2-fs-3t143vku-test-wikijs-ingress-multi-xlcxo7jh
              ingress.kubernetes.io/https-target-proxy: k8s2-ts-3t143vku-test-wikijs-ingress-multi-xlcxo7jh
              ingress.kubernetes.io/ssl-cert:
                mcrt-5eff98e5-8917-4807-9148-79c10698f34a,mcrt-76d117a0-71b0-422f-8947-1e39df945093,mcrt-ac4dc442-6a28-4d0f-b8bf-767f1ee1511a
              ingress.kubernetes.io/static-ip: k8s2-fr-3t143vku-test-wikijs-ingress-multi-xlcxo7jh
              ingress.kubernetes.io/target-proxy: k8s2-tp-3t143vku-test-wikijs-ingress-multi-xlcxo7jh
              ingress.kubernetes.io/url-map: k8s2-um-3t143vku-test-wikijs-ingress-multi-xlcxo7jh
              networking.gke.io/managed-certificates: shortwikitestbe,shortwikitesteu,shortwikitestcom
Events:
  Type    Reason     Age                  From                     Message
  ----    ------     ----                 ----                     -------
  Normal  Sync       50m                  loadbalancer-controller  UrlMap "k8s2-um-3t143vku-test-wikijs-ingress-multi-xlcxo7jh" created
  Normal  Sync       50m                  loadbalancer-controller  TargetProxy "k8s2-tp-3t143vku-test-wikijs-ingress-multi-xlcxo7jh" created
  Normal  Sync       49m                  loadbalancer-controller  ForwardingRule "k8s2-fr-3t143vku-test-wikijs-ingress-multi-xlcxo7jh" created
  Normal  IPChanged  49m                  loadbalancer-controller  IP is now **.**.***.***
  Normal  Sync       49m                  loadbalancer-controller  TargetProxy "k8s2-ts-3t143vku-test-wikijs-ingress-multi-xlcxo7jh" created
  Normal  Sync       49m                  loadbalancer-controller  ForwardingRule "k8s2-fs-3t143vku-test-wikijs-ingress-multi-xlcxo7jh" created
  Normal  Sync       6m7s (x11 over 51m)  loadbalancer-controller  Scheduled for sync

# État du service
>> kubectl get service test-wikijs -n test
>>
>> # Endpoints
>> kubectl get endpoints test-wikijs -n test
>>
>> # Description détaillée du service
>> kubectl describe service test-wikijs -n test
NAME               TYPE           CLUSTER-IP       EXTERNAL-IP    PORT(S)        AGE
test-wikijs   LoadBalancer   34.118.239.183   **.**.**.***   80:32537/TCP   28h
NAME               ENDPOINTS          AGE
test-wikijs   10.112.1.14:3000   28h
Name:                     test-wikijs
Namespace:                test
Labels:                   app=test-wikijs
Annotations:              cloud.google.com/neg: {"ingress":true}
                          cloud.google.com/neg-status:
                            {"network_endpoint_groups":{"80":"k8s1-16d8895a-test-test-wikijs-80-1cd44efb"},"zones":["europe-west1-b"]}
Selector:                 app=test-wikijs
Type:                     LoadBalancer
IP Family Policy:         SingleStack
IP Families:              IPv4
IP:                       34.118.239.183
IPs:                      34.118.239.183
LoadBalancer Ingress:     **.**.**.***
Port:                     <unset>  80/TCP
TargetPort:               3000/TCP
NodePort:                 <unset>  32537/TCP
Endpoints:                10.112.1.14:3000
Session Affinity:         None
External Traffic Policy:  Cluster
Events:
  Type    Reason                Age                 From                Message
  ----    ------                ----                ----                -------
  Normal  EnsuringLoadBalancer  57m (x3 over 112m)  service-controller  Ensuring load balancer
  Normal  EnsuredLoadBalancer   57m (x3 over 112m)  service-controller  Ensured load balancer
  Normal  Create                57m                 neg-controller      Created NEG "k8s1-16d8895a-test-test-wikijs-80-1cd44efb" for test/test-wikijs-k8s1-16d8895a-test-test-wikijs-80-1cd44efb-/80-3000-GCE_VM_IP_PORT-L7 in "europe-west1-b".
  Normal  Attach                57m (x2 over 83m)   neg-controller      Attach 1 network endpoint(s) (NEG "k8s1-16d8895a-test-test-wikijs-80-1cd44efb" in zone "europe-west1-b")

Questões:

  1. O que pode estar causando o "estado NÃO ÍNTEGRA" no Ingress?
  2. Por que os pontos de extremidade da rede estão mostrando 0/1 operacional?
  3. Há alguma configuração específica do GKE que eu deva verificar?
kubernetes
  • 1 1 respostas
  • 49 Views

1 respostas

  • Voted
  1. Best Answer
    Nilcouv
    2025-01-27T16:40:28+08:002025-01-27T16:40:28+08:00

    Resposta: Problema de verificação de integridade do GKE Ingress com Wiki.js

    O problema ocorre porque o Wiki.js redireciona /para /login, o que a verificação de integridade do GKE interpreta como uma falha. Veja como consertar:

    1. Crie um BackendConfig para configurar corretamente a verificação de integridade:
    apiVersion: cloud.google.com/v1
        kind: BackendConfig
        metadata:
          name: test-backend-config
          namespace: test
          labels:
            app: test-wikijs
        spec:
          healthCheck:
            checkIntervalSec: 15    # Check every 15 seconds
            timeoutSec: 15          # Timeout after 15 seconds
            healthyThreshold: 1     # Number of successes required to be marked healthy
            unhealthyThreshold: 2   # Number of failures required to be marked unhealthy
            type: HTTP             # HTTP health check type
            requestPath: /login    # Check /login directly instead of root path to fix the problem
            port: 3000            # Wiki.js default port
    
    2. Atualize seu Ingress para usar este BackendConfig:
    apiVersion: "networking.k8s.io/v1"
    kind: "Ingress"
    metadata:
      name: "wikijs-ingress-multi-cert"
      namespace: "test"
      annotations:
        networking.gke.io/managed-certificates: "shorttesteu,shorttestbe,shorttestcom"   # certificats names
        cloud.google.com/backend-config: '{"default": "test-backend-config"}' # health check
        kubernetes.io/ingress.global-static-ip-name: "test-static-IP"  # static IP name
    spec:
      defaultBackend:
        service:
          name: "test-wikijs"
          port:
            number: 80
    status:
      loadBalancer: {}
    

    Explicação

    A verificação de integridade falha porque:

    1. Por padrão, ele verifica o caminho raiz/
    2. Wiki.js redireciona /para/login
    3. As verificações de integridade do GKE não seguem redirecionamentos
    4. O redirecionamento (HTTP 302) é interpretado como uma falha

    Ao configurar a verificação de integridade para verificar diretamente /login, evitamos o redirecionamento e a verificação de integridade é aprovada com sucesso.

    Verificação

    Após aplicar essas alterações:

    1. Aguarde alguns minutos para que a verificação de integridade seja atualizada
    2. Verifique o status de entrada:
    kubectl describe ingress wikijs-ingress-multi-cert -n test
    
    • 0

relate perguntas

  • Containerd falhou ao iniciar após Nvidia Config

  • Como posso modificar o configmap CoreDNS antes de inicializar o cluster usando o kubeadm?

Sidebar

Stats

  • Perguntas 205573
  • respostas 270741
  • best respostas 135370
  • utilizador 68524
  • Highest score
  • respostas
  • Marko Smith

    Você pode passar usuário/passar para autenticação básica HTTP em parâmetros de URL?

    • 5 respostas
  • Marko Smith

    Ping uma porta específica

    • 18 respostas
  • Marko Smith

    Verifique se a porta está aberta ou fechada em um servidor Linux?

    • 7 respostas
  • Marko Smith

    Como automatizar o login SSH com senha?

    • 10 respostas
  • Marko Smith

    Como posso dizer ao Git para Windows onde encontrar minha chave RSA privada?

    • 30 respostas
  • Marko Smith

    Qual é o nome de usuário/senha de superusuário padrão para postgres após uma nova instalação?

    • 5 respostas
  • Marko Smith

    Qual porta o SFTP usa?

    • 6 respostas
  • Marko Smith

    Linha de comando para listar usuários em um grupo do Windows Active Directory?

    • 9 respostas
  • Marko Smith

    O que é um arquivo Pem e como ele difere de outros formatos de arquivo de chave gerada pelo OpenSSL?

    • 3 respostas
  • Marko Smith

    Como determinar se uma variável bash está vazia?

    • 15 respostas
  • Martin Hope
    Davie Ping uma porta específica 2009-10-09 01:57:50 +0800 CST
  • Martin Hope
    kernel O scp pode copiar diretórios recursivamente? 2011-04-29 20:24:45 +0800 CST
  • Martin Hope
    Robert ssh retorna "Proprietário incorreto ou permissões em ~/.ssh/config" 2011-03-30 10:15:48 +0800 CST
  • Martin Hope
    Eonil Como automatizar o login SSH com senha? 2011-03-02 03:07:12 +0800 CST
  • Martin Hope
    gunwin Como lidar com um servidor comprometido? 2011-01-03 13:31:27 +0800 CST
  • Martin Hope
    Tom Feiner Como posso classificar a saída du -h por tamanho 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich O que é um arquivo Pem e como ele difere de outros formatos de arquivo de chave gerada pelo OpenSSL? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent Como determinar se uma variável bash está vazia? 2009-05-13 09:54:48 +0800 CST

Hot tag

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • Início
  • Perguntas
    • Recentes
    • Highest score
  • tag
  • help

Footer

AskOverflow.Dev

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve