kumahq / kuma

🐻 The multi-zone service mesh for containers, Kubernetes and VMs. Built with Envoy. CNCF Sandbox Project.
https://kuma.io/install
Apache License 2.0
3.67k stars 333 forks source link

MeshService status Unavailable but is reachable #12042

Open schogges opened 1 week ago

schogges commented 1 week ago

What happened?

After I deployed my services as k8s Service and configured the Mesh with meshServices.mode: "Exclusive", my services became MeshService and went into state Unavailable (check for spec.state: Unavailable in examplary MeshService YAML Dump below). When sending requests I get the expected responses, so the services are actually available.

Deployment Configs ```yaml apiVersion: kuma.io/v1alpha1 kind: Mesh metadata: name: default spec: mtls: enabledBackend: ca-1 backends: - name: ca-1 type: builtin meshServices: mode: Exclusive --- apiVersion: apps/v1 kind: Deployment metadata: name: finance-api namespace: app labels: app: finance-api spec: replicas: 1 selector: matchLabels: app: finance-api template: metadata: labels: app: finance-api spec: containers: - name: finance-api image: finance-api:0.0.1 imagePullPolicy: IfNotPresent ports: - containerPort: 8002 readinessProbe: httpGet: path: /health scheme: HTTP port: 8002 initialDelaySeconds: 5 timeoutSeconds: 5 --- apiVersion: v1 kind: Service metadata: name: finance-api namespace: app labels: app: finance-api spec: selector: app: finance-api ports: - protocol: TCP port: 80 appProtocol: http targetPort: 8002 ```
MeshService YAML Dump ```yaml apiVersion: kuma.io/v1alpha1 kind: MeshService metadata: annotations: kuma.io/display-name: finance-api creationTimestamp: "2024-11-11T15:48:33Z" generation: 4 labels: app: finance-api k8s.kuma.io/is-headless-service: "false" k8s.kuma.io/namespace: app k8s.kuma.io/service-name: finance-api kuma.io/env: kubernetes kuma.io/managed-by: k8s-controller kuma.io/mesh: default kuma.io/origin: zone kuma.io/zone: west name: finance-api namespace: app ownerReferences: - apiVersion: v1 kind: Service name: finance-api uid: 8e8e6442-ae6e-449b-a761-818e508a6e89 resourceVersion: "368987" uid: 2edc7175-e34c-4722-b931-4102baaedff8 spec: identities: - type: ServiceTag value: finance-api_app_svc_80 ports: - appProtocol: http name: "80" port: 80 targetPort: 8002 selector: dataplaneTags: app: finance-api k8s.kuma.io/namespace: app state: Unavailable status: addresses: - hostname: finance-api.moritz-services.svc.mesh.local hostnameGeneratorRef: coreName: my-mesh-service-vw6c7xdbd9cx26vx.kuma-system origin: HostnameGenerator dataplaneProxies: connected: 1 total: 1 hostnameGenerators: - conditions: - message: "" reason: Generated status: "True" type: Generated hostnameGeneratorRef: coreName: my-mesh-service-vw6c7xdbd9cx26vx.kuma-system tls: status: Ready vips: - ip: 10.96.215.190 ```
lobkovilya commented 3 days ago

Triage: also would be nice to add "state" explanation to the kuma-website