Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add xds config tab to inbound tray #3182

Closed
Tracked by #3181
lahabana opened this issue Nov 13, 2024 · 3 comments · Fixed by #3186
Closed
Tracked by #3181

add xds config tab to inbound tray #3182

lahabana opened this issue Nov 13, 2024 · 3 comments · Fixed by #3186
Assignees
Labels
kind/feature New feature triage/accepted The issue was reviewed and is complete enough to start working on it
Milestone

Comments

@lahabana
Copy link
Contributor

lahabana commented Nov 13, 2024

This view:

image

Should have a new tab calls "XDS Configuration"

These come from dynamic_active_clusters and dynamic_listeners and have the name for listener inbound:{{networking.address}}:{{inbound[].port}} and localhost:{{inbound[].port}}.

Should check with backend that it's always {{networking.address}} or not.

Here's the extracted data for the demo:

  • for redis:

listeners:

        {
          "name": "inbound:10.244.0.6:6379",
          "active_state": {
            "version_info": "79d858b7-8577-4316-92fe-4babf4f5453d",
            "listener": {
              "@type": "type.googleapis.com/envoy.config.listener.v3.Listener",
              "name": "inbound:10.244.0.6:6379",
              "address": {
                "socket_address": {
                  "address": "10.244.0.6",
                  "port_value": 6379
                }
              },
              "filter_chains": [
                {
                  "filters": [
                    {
                      "name": "envoy.filters.network.tcp_proxy",
                      "typed_config": {
                        "@type": "type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy",
                        "stat_prefix": "localhost_6379",
                        "cluster": "localhost:6379",
                        "idle_timeout": "7200s"
                      }
                    }
                  ]
                }
              ],
              "metadata": {
                "filter_metadata": {
                  "io.kuma.tags": {
                    "pod-template-hash": "54754f5b57",
                    "k8s.kuma.io/service-port": "6379",
                    "app": "redis",
                    "kuma.io/zone": "default",
                    "kuma.io/protocol": "tcp",
                    "k8s.kuma.io/service-name": "redis",
                    "kubernetes.io/hostname": "mesh-zone",
                    "k8s.kuma.io/namespace": "kuma-demo",
                    "kuma.io/service": "redis_kuma-demo_svc_6379"
                  }
                }
              },
              "traffic_direction": "INBOUND",
              "bind_to_port": false,
              "enable_reuse_port": false
            },
            "last_updated": "2024-11-13T17:48:29.270Z"
          }
        },

cluster:

        {
          "version_info": "cec466d9-ad97-4258-85cc-8d80b87e1383",
          "cluster": {
            "@type": "type.googleapis.com/envoy.config.cluster.v3.Cluster",
            "name": "localhost:6379",
            "type": "STATIC",
            "connect_timeout": "10s",
            "upstream_bind_config": {
              "source_address": {
                "address": "127.0.0.6",
                "port_value": 0
              }
            },
            "alt_stat_name": "localhost_6379",
            "load_assignment": {
              "cluster_name": "localhost:6379",
              "endpoints": [
                {
                  "lb_endpoints": [
                    {
                      "endpoint": {
                        "address": {
                          "socket_address": {
                            "address": "10.244.0.6",
                            "port_value": 6379
                          }
                        }
                      }
                    }
                  ]
                }
              ]
            }
          },
          "last_updated": "2024-11-13T17:48:29.210Z"
        },
  • for demo-app:

listener:

{
  "name": "inbound:10.244.0.7:5000",
  "active_state": {
    "version_info": "51af195a-e878-4dcc-8d48-f36954b3e283",
    "listener": {
      "@type": "type.googleapis.com/envoy.config.listener.v3.Listener",
      "name": "inbound:10.244.0.7:5000",
      "address": {
        "socket_address": {
          "address": "10.244.0.7",
          "port_value": 5000
        }
      },
      "filter_chains": [
        {
          "filters": [
            {
              "name": "envoy.filters.network.http_connection_manager",
              "typed_config": {
                "@type": "type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager",
                "stat_prefix": "localhost_5000",
                "route_config": {
                  "name": "inbound:demo-app_kuma-demo_svc_5000",
                  "virtual_hosts": [
                    {
                      "name": "demo-app_kuma-demo_svc_5000",
                      "domains": [
                        "*"
                      ],
                      "routes": [
                        {
                          "match": {
                            "prefix": "/"
                          },
                          "route": {
                            "cluster": "localhost:5000",
                            "timeout": "0s",
                            "idle_timeout": "3600s"
                          }
                        }
                      ]
                    }
                  ],
                  "validate_clusters": false,
                  "request_headers_to_remove": [
                    "x-kuma-tags"
                  ]
                },
                "http_filters": [
                  {
                    "name": "envoy.filters.http.router",
                    "typed_config": {
                      "@type": "type.googleapis.com/envoy.extensions.filters.http.router.v3.Router"
                    }
                  }
                ],
                "forward_client_cert_details": "SANITIZE_SET",
                "set_current_client_cert_details": {
                  "uri": true
                },
                "stream_idle_timeout": "3600s",
                "common_http_protocol_options": {
                  "idle_timeout": "0s"
                },
                "request_headers_timeout": "0s"
              }
            }
          ]
        }
      ],
      "metadata": {
        "filter_metadata": {
          "io.kuma.tags": {
            "kuma.io/protocol": "http",
            "pod-template-hash": "fcc8bc4cb",
            "k8s.kuma.io/service-name": "demo-app",
            "app": "demo-app",
            "kuma.io/service": "demo-app_kuma-demo_svc_5000",
            "k8s.kuma.io/service-port": "5000",
            "k8s.kuma.io/namespace": "kuma-demo",
            "kubernetes.io/hostname": "mesh-zone",
            "kuma.io/zone": "default"
          }
        }
      },
      "traffic_direction": "INBOUND",
      "bind_to_port": false,
      "enable_reuse_port": false
    },
    "last_updated": "2024-11-13T17:49:01.314Z"
  }
}

cluster:

        {
          "version_info": "c77634e3-cc08-4b55-9d9b-4d9694f8ffb3",
          "cluster": {
            "@type": "type.googleapis.com/envoy.config.cluster.v3.Cluster",
            "name": "localhost:5000",
            "type": "STATIC",
            "connect_timeout": "10s",
            "upstream_bind_config": {
              "source_address": {
                "address": "127.0.0.6",
                "port_value": 0
              }
            },
            "alt_stat_name": "localhost_5000",
            "load_assignment": {
              "cluster_name": "localhost:5000",
              "endpoints": [
                {
                  "lb_endpoints": [
                    {
                      "endpoint": {
                        "address": {
                          "socket_address": {
                            "address": "10.244.0.7",
                            "port_value": 5000
                          }
                        }
                      }
                    }
                  ]
                }
              ]
            },
            "typed_extension_protocol_options": {
              "envoy.extensions.upstreams.http.v3.HttpProtocolOptions": {
                "@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions",
                "common_http_protocol_options": {
                  "idle_timeout": "7200s",
                  "max_connection_duration": "0s",
                  "max_stream_duration": "0s"
                },
                "explicit_http_config": {
                  "http_protocol_options": {}
                }
              }
            }
          },
          "last_updated": "2024-11-13T17:49:01.215Z"
        },
@github-actions github-actions bot added the triage/pending This issue will be looked at on the next triage meeting label Nov 13, 2024
@lahabana lahabana added this to the 2.10.x milestone Nov 13, 2024
@lahabana lahabana added triage/accepted The issue was reviewed and is complete enough to start working on it kind/feature New feature and removed triage/pending This issue will be looked at on the next triage meeting labels Nov 13, 2024
@johncowen
Copy link
Contributor

The below JSON is the sort of thing I'm left with when clicking on the inbound card for the redis dataplane and filtering for only redis things (FYI using my own demo deployment not the JSONs attached here).

Its only picking out the dynamic_active_clusters, dynamic_listeners and dynamic_endpoint_configs (when including endpoints is checked in the GUI). The way I'm picking relevant data depending on the property is below (I'll be filling these dynamically later instead of just hardcoding)

          case 'dynamic_active_clusters':
            found = value.filter(item => item.cluster.name === 'default_redis_kuma-demo_default_msvc_6379')
            break
          case 'dynamic_listeners':
            found = value.filter(item => item.name === 'inbound:10.42.0.7:6379') // <= this is the networkAddress:port
            break
          case 'dynamic_endpoint_configs':
            found = value.filter(item => item.endpoint_config.cluster_name === 'default_redis_kuma-demo_default_msvc_6379')
            break

Questions from me:

  • Is this what you are expecting to see? (seems so to me)
  • There is also a bootstrap.node property which can include info related to the dataplane via a cluster: "redis_kuma-demo_svc_6379" property. Should I include that also maybe?

Lemme know!

{
  "configs": [
    {
      "dynamic_active_clusters": [
        {
          "version_info": "08cd3692-e32e-4849-9a08-2706e61c4747",
          "cluster": {
            "@type": "type.googleapis.com/envoy.config.cluster.v3.Cluster",
            "name": "default_redis_kuma-demo_default_msvc_6379",
            "type": "EDS",
            "eds_cluster_config": {
              "eds_config": {
                "ads": {},
                "resource_api_version": "V3"
              }
            },
            "connect_timeout": "5s",
            "circuit_breakers": {
              "thresholds": [
                {
                  "max_connections": 1024,
                  "max_pending_requests": 1024,
                  "max_requests": 1024,
                  "max_retries": 3
                }
              ]
            },
            "typed_extension_protocol_options": {
              "envoy.extensions.upstreams.http.v3.HttpProtocolOptions": {
                "@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions",
                "explicit_http_config": {
                  "http2_protocol_options": {}
                }
              }
            }
          },
          "last_updated": "2024-11-14T12:12:36.195Z"
        }
      ]
    },
    {
      "dynamic_endpoint_configs": [
        {
          "endpoint_config": {
            "@type": "type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment",
            "cluster_name": "default_redis_kuma-demo_default_msvc_6379",
            "endpoints": [
              {
                "locality": {
                  "zone": "default"
                },
                "lb_endpoints": [
                  {
                    "endpoint": {
                      "address": {
                        "socket_address": {
                          "address": "10.42.0.7",
                          "port_value": 6379
                        }
                      },
                      "health_check_config": {}
                    },
                    "health_status": "HEALTHY",
                    "metadata": {
                      "filter_metadata": {
                        "envoy.transport_socket_match": {
                          "k8s.kuma.io/service-port": "6379",
                          "kubernetes.io/hostname": "k3d-kuma-server-0",
                          "k8s.kuma.io/service-name": "redis",
                          "app": "redis",
                          "kuma.io/protocol": "tcp",
                          "kuma.io/zone": "default",
                          "k8s.kuma.io/namespace": "kuma-demo",
                          "pod-template-hash": "8fcbfc795"
                        },
                        "envoy.lb": {
                          "k8s.kuma.io/namespace": "kuma-demo",
                          "kuma.io/zone": "default",
                          "pod-template-hash": "8fcbfc795",
                          "k8s.kuma.io/service-name": "redis",
                          "k8s.kuma.io/service-port": "6379",
                          "app": "redis",
                          "kubernetes.io/hostname": "k3d-kuma-server-0",
                          "kuma.io/protocol": "tcp"
                        }
                      }
                    },
                    "load_balancing_weight": 1
                  }
                ],
                "load_balancing_weight": 0
              }
            ],
            "policy": {
              "overprovisioning_factor": 140
            }
          }
        }
      ]
    },
    {
      "dynamic_listeners": [
        {
          "name": "inbound:10.42.0.7:6379",
          "active_state": {
            "version_info": "afa6bad8-f349-4a26-ae62-a91ea6fb759f",
            "listener": {
              "@type": "type.googleapis.com/envoy.config.listener.v3.Listener",
              "name": "inbound:10.42.0.7:6379",
              "address": {
                "socket_address": {
                  "address": "10.42.0.7",
                  "port_value": 6379
                }
              },
              "filter_chains": [
                {
                  "filters": [
                    {
                      "name": "envoy.filters.network.tcp_proxy",
                      "typed_config": {
                        "@type": "type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy",
                        "stat_prefix": "localhost_6379",
                        "cluster": "localhost:6379",
                        "idle_timeout": "7200s"
                      }
                    }
                  ]
                }
              ],
              "metadata": {
                "filter_metadata": {
                  "io.kuma.tags": {
                    "pod-template-hash": "8fcbfc795",
                    "k8s.kuma.io/service-name": "redis",
                    "kuma.io/protocol": "tcp",
                    "k8s.kuma.io/namespace": "kuma-demo",
                    "kubernetes.io/hostname": "k3d-kuma-server-0",
                    "kuma.io/service": "redis_kuma-demo_svc_6379",
                    "kuma.io/zone": "default",
                    "k8s.kuma.io/service-port": "6379",
                    "app": "redis"
                  }
                }
              },
              "traffic_direction": "INBOUND",
              "bind_to_port": false,
              "enable_reuse_port": false
            },
            "last_updated": "2024-11-11T12:27:04.672Z"
          }
        }
      ]
    }
  ]
}

@johncowen
Copy link
Contributor

Ah! Guessing the above JSON, is for both listeners and clusters right? Guessing for the inbound drawer I just want the dynamic_listeners? So:

{
  "configs": [
    {
      "dynamic_listeners": [
        {
          "name": "inbound:10.42.0.7:6379",
          "active_state": {
            "version_info": "afa6bad8-f349-4a26-ae62-a91ea6fb759f",
            "listener": {
              "@type": "type.googleapis.com/envoy.config.listener.v3.Listener",
              "name": "inbound:10.42.0.7:6379",
              "address": {
                "socket_address": {
                  "address": "10.42.0.7",
                  "port_value": 6379
                }
              },
              "filter_chains": [
                {
                  "filters": [
                    {
                      "name": "envoy.filters.network.tcp_proxy",
                      "typed_config": {
                        "@type": "type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy",
                        "stat_prefix": "localhost_6379",
                        "cluster": "localhost:6379",
                        "idle_timeout": "7200s"
                      }
                    }
                  ]
                }
              ],
              "metadata": {
                "filter_metadata": {
                  "io.kuma.tags": {
                    "pod-template-hash": "8fcbfc795",
                    "k8s.kuma.io/service-name": "redis",
                    "kuma.io/protocol": "tcp",
                    "k8s.kuma.io/namespace": "kuma-demo",
                    "kubernetes.io/hostname": "k3d-kuma-server-0",
                    "kuma.io/service": "redis_kuma-demo_svc_6379",
                    "kuma.io/zone": "default",
                    "k8s.kuma.io/service-port": "6379",
                    "app": "redis"
                  }
                }
              },
              "traffic_direction": "INBOUND",
              "bind_to_port": false,
              "enable_reuse_port": false
            },
            "last_updated": "2024-11-11T12:27:04.672Z"
          }
        }
      ]
    }
  ]
}

@johncowen
Copy link
Contributor

WIP PR with progress on this #3186

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature triage/accepted The issue was reviewed and is complete enough to start working on it
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants