skupperproject/skupper

[v1] flow-collector improvements for external vm clients

Opened this issue · 3 comments

Investigate v1 flow-collector improvements for external vm clients.

Goal is to allow metrics to be tracked per external vm client ip.

Posted draft PR: #1857: [v1] flow-collector: add source ip to site-clients process name

Attaching skupper console screen shots: Process, Topology / Components, Topology / Processes.

skupper-console-processes

skuper-console-topology-components
skupper-console-topology-processes

Here are steps to test with external VM clients.

  1. Start minikube with metallb
minikube start
minikube addons enable metallb
kubectl apply -f metallb-config.yaml
$ cat metallb-config.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  namespace: metallb-system
  name: config
data:
  config: |
    address-pools:
    - name: default
      protocol: layer2
      addresses:
      - 192.168.49.240-192.168.49.250
  1. Create skupper sites: east, west. Link skupper sites.

  2. Create service for the server VM.

    Note: My server VM IP = 192.168.56.119.

kubectl -n east apply -f service-backend-ext-config.yaml
kubectl -n east apply -f endpoints-backend-ext-config.yaml
$ cat service-backend-ext-config.yaml
apiVersion: v1
kind: Service
metadata:
  name: backend-ext
spec:
  ports:
    - protocol: TCP
      port: 8080
$ cat endpoints-backend-ext-config.yaml
apiVersion: v1
kind: Endpoints
metadata:
  name: backend-ext
subsets:
  - addresses:
      - ip: 192.168.56.119
    ports:
      - port: 8080
  1. Expose VM service on the VAN.
    # Expose the service as 'backend' on the VAN.
    # NOTE: You cannot expose the service on the VAN with the same
    # name/address as the existing kube service
    # That causes skupper to mess with the backing Endpoints resource to point to the router,
    # instead of the external VM it was set up for

    kubectl -n east annotate service/backend-ext skupper.io/port="8080"
    kubectl -n east annotate service/backend-ext skupper.io/address="vm-backend"
    kubectl -n east annotate service/backend-ext skupper.io/target="backend-ext"
    kubectl -n east annotate service/backend-ext skupper.io/proxy="tcp"
  1. Create LoadBalancer service.

    Lookup service port in skupper-internal.
    Edit service-backend-lb.yaml to use service port

    kubectl -n west apply -f service-backend-lb.yaml
$ cat service-backend-lb.yaml
apiVersion: v1
kind: Service
metadata:
  name: backend-lb
spec:
  type: LoadBalancer
  externalTrafficPolicy: Local
  ports:
  - name: http
    port: 8080
    protocol: TCP
    targetPort: 1024
  selector:
    application: skupper-router
    skupper.io/component: router
  loadBalancerIP: 192.168.49.250
  1. Now, my client VM in west can issue requests to the loadBalancerIP.