This topic describes how to install Application Live View Connector. Application Live View Connector is the component responsible for discovering the application pods running on the Kubernetes cluster and register the instances to the Application Live View Server for it to be observed. The Application Live View Connector is also responsible for proxying the actuator queries to the application pods running in the Kubernetes cluster.

Connector Operation and Deployment Model

Application Live View connector is primarily intended to observe the applications on Kubernetes cluster. Application Live View connector can be deployed in 2 modes:

  • Namespace scoped: In this mode, applications running in a namespace of Kubernetes cluster are discovered. In contrast to cluster access mode, this mode discovers the applications across worker nodes in Kubernetes cluster. Application Live View connector can be deployed as Kubernetes Deployment for this mode of connector operation.

  • Cluster access: This is the default mode of Application Live View connector. In this mode, applications across all the namespaces running in a worker node of a Kubernetes cluster are discovered. Connector is deployed as Kubernetes DaemonSets for this mode of connector operation.

The operation mode of Application Live View can be specified by setting the app.live.view.connector.mode property.


Deploy Service Account for Connector (Namespace scoped)

For the Application Live View connector to observe applications in the namespace, a service account should be created with a 'watch' role bound to service account using role binding for namespace scoped deployment.

  1. Create a service account yaml (connector-service-account.yaml) as shown below:

    connector-service-account.yaml

    apiVersion: v1
    kind: ServiceAccount
    metadata:
      name: app-live-view-connector-service-account
    ---
    apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRole
    metadata:
      name: app-live-view-connector-service-account-cluster-role
      rules:
      - apiGroups: ["*"]
        resources: ["pods"]
        verbs: ["watch"]
    ---
    apiVersion: rbac.authorization.k8s.io/v1
    kind: RoleBinding
    metadata:
      name: app-live-view-connector-role-binding
    roleRef:
      apiGroup: rbac.authorization.k8s.io
      kind: ClusterRole
      name: app-live-view-connector-service-account-cluster-role
    subjects:
      - kind: ServiceAccount
        name: app-live-view-connector-service-account
    
  2. Deploy the Service account using kubectl CLI. Run:

    kubectl apply -f connector-service-account.yaml
    


Deploy Service Account for Connector (Cluster Access)

For the Application Live View connector to observe applications across the cluster, a service account should be created with a 'watch' role bound to service account using cluster role binding for Daemon Set deployment.

  1. Create a service account yaml (connector-service-account.yaml) as shown below:

    connector-service-account.yaml

    apiVersion: v1
    kind: ServiceAccount
    metadata:
      name: app-live-view-connector-service-account
    ---
    apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRole
    metadata:
      name: app-live-view-connector-service-account-cluster-role
      rules:
      - apiGroups: ["*"]
        resources: ["pods"]
        verbs: ["watch"]
    ---
    apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRoleBinding
    metadata:
      name: app-live-view-connector-role-binding
    roleRef:
      apiGroup: rbac.authorization.k8s.io
      kind: ClusterRole
      name: app-live-view-connector-service-account-cluster-role
    subjects:
      - kind: ServiceAccount
        name: app-live-view-connector-service-account
    
  2. Deploy the Service account using kubectl CLI. Run:

    kubectl apply -f connector-service-account.yaml
    


Deploy Application Live View Connector

To deploy Application Live View Connector, follow the steps below:

  1. Create a deployment yaml (connector-deployment.yaml) as shown below and replace the placeholder values as necessary:

    connector-deployment.yaml

        apiVersion: apps/v1
        kind: {{TO_BE_CHANGED}} //Deployment or DaemonSet
        metadata:
          name: app-live-view-connector
          labels:
            app: app-live-view-connector
        spec:
          selector:
            matchLabels:
              name: app-live-view-connector
          template:
            metadata:
              labels:
                name: app-live-view-connector
            spec:
              # we must give serviceAccountName 
              serviceAccountName: {{TO_BE_CHANGED}}
              containers:
                - name: app-live-view-connector
                  image: registry.pivotal.io/app-live-view/application-live-view-connector-native:0.1.0
                  imagePullPolicy: Always
                  livenessProbe:
                    httpGet:
                      path: /health
                      port: {{TO_BE_CHANGED}}
                    initialDelaySeconds: {{TO_BE_CHANGED}} // 15
                    periodSeconds: {{TO_BE_CHANGED}} // 5
                    timeoutSeconds: {{TO_BE_CHANGED}} // 3
                  env:
                    # name of the app live view service that is exposed on port 7000 so that connector can communicate with app live veiew
                    - name: app.live.view.client.host
                      value: app-live-view-7000
                    # port for connector to communicate with the app live view via rsocket (always 7000)
                    - name: app.live.view.client.port
                      value: "7000"
                    - name: NODE_NAME
                      valueFrom:
                        fieldRef:
                          fieldPath: spec.nodeName
                    - name: NAMESPACE_NAME
                      valueFrom:
                        fieldRef:
                          fieldPath: metadata.namespace
                    - name: app.live.view.connector.mode
                      value: {{TO_BE_CHANGED}}
    

    In Namespace scoped mode deployment, Kind is set as "Deployment" and app.live.view.connector.mode property is set as "namespace-scoped" in the above yaml.

    In Cluster mode deployment, Kind is set as "DaemonSet" and app.live.view.connector.mode property is set as "cluster-access" in the above yaml.

  2. Deploy the Application Live View Connector using kubectl CLI. Run:

    kubectl apply -f connector-deployment.yaml
    
  3. Verify the deployment by running the below command:

    kubectl get pods
    

    application-live-view-connector pod should be in running state


Connector Configuration Properties

Below environment properties can be configured on the connector.

The list of properties are shown below:

Property Name Default Significance
app.live.view.client.host localhost name of the app live view service that is exposed on port 7000 to communicate with app live view
app.live.view.client.port 7070 port to communicate with the app live view via rsocket (always 7000)
app.live.view.client.ssl.strictSsl true Enable / Disable communication with application instances over https
app.live.view.client.ssl.disableHostnameValidation false Enable / Disable client side hostname validation
app.live.view.client.ssl.trustStoreLocation None File system path to trust store
app.live.view.client.ssl.trustStorePassword None Plaintext password string of trust store
app.live.view.connector.healthPollIntervalInSecs 20 Health status refresh interval in seconds
app.live.view.connector.mode cluster-access mode of App live view connector operation. cluster-access or namespace-scoped
app.live.view.connector.k8sclient.readTimeOutInSecs 0 Kubernetes client read time out in seconds, 0 denotes infinity
app.live.view.connector.k8sclient.maxRetryAttempts 3 Max connection retries to API server on failures
app.live.view.connector.k8sclient.retryDelayInSeconds 5 Time delay before API Server connection retry after failure
app.live.view.connector.discovery.application-actuator-health-port-label tanzu.app.live.view.application.actuator.health.port Configure label for connector
app.live.view.connector.discovery.application-actuator-path-label tanzu.app.live.view.application.actuator.path Configure label for connector
app.live.view.connector.discovery.application-actuator-port-label tanzu.app.live.view.application.actuator.port Configure label for connector
app.live.view.connector.discovery.application-discovery-label tanzu.app.live.view Configure label for connector
app.live.view.connector.discovery.application-flavours tanzu.app.live.view.application.flavours Configure label for connector
app.live.view.connector.discovery.application-name-label tanzu.app.live.view.application.name Configure label for connector
app.live.view.connector.discovery.application-path-label tanzu.app.live.view.application.path Configure label for connector
app.live.view.connector.discovery.application-port-label tanzu.app.live.view.application.port Configure label for connector
app.live.view.connector.discovery.application-protocol-label tanzu.app.live.view.application.protocol Configure label for connector
app.live.view.connector.discovery.conventions-framework-label conventions.tanzu.vmware.com/framework Configure label for connector
app.live.view.connector.discovery.conventions-version-annotation boot.spring.io/version Configure label for connector


Application Labels for Discovery

Application Live View connector will not discover all the application pods running on the Kubernetes worker node. It will discover only the application pods having a label denoting the application as discoverable viz. (tanzu.app.live.view=true) label. Application Live View connector assumes a set of defaults for application discovery, these defaults can be overridden by setting the values in the appropriate labels.

Below is an example of an application deployment yaml file which has the necessary labels to make it discoverable by the connector:

example-app.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: example-app
  name: example-app
spec:
  replicas: 1
  selector:
    matchLabels:
      app: example-app
  strategy: {}
  template:
    metadata:
      labels:
        app: example-app
        tanzu.app.live.view: "true"
        tanzu.app.live.view.application.name: example-app
    spec:
      containers:
      - image: ${EXAMPLE_APP_IMAGE}
        name: example-app
        ports:
          - containerPort: 8080

Note: Replace ${EXAMPLE_APP_IMAGE} placeholder with your application image

Deploy the Sample application using kubectl CLI. Run:

kubectl apply -f example-app.yaml

Exclusive list of labels available are listed below:

Label Name Mandatory Type Default Significance
tanzu.app.live.view true Boolean None toggle to disable / enable pod discovery
tanzu.app.live.view.application.name true String None application name
tanzu.app.live.view.application.port false Integer 8080 application port
tanzu.app.live.view.application.path false String / application context path
tanzu.app.live.view.application.actuator.port false Integer 8080 application actuator port
tanzu.app.live.view.application.actuator.path false String /actuator actuator context path
tanzu.app.live.view.application.protocol false http / https http protocol scheme
tanzu.app.live.view.application.actuator.health.port false Integer 8080 health endpoint port
tanzu.app.live.view.application.flavours false comma separated string spring-boot application flavours


Access the Application Live View UI to verify application discovery

Now, you should be able to see the Application on the Application Live View UI at 
Run a quick check on <dns name from EXTERNAL-IP column in kubectl get svc output>:5112 from browser to see if the sample application is registered with the Application Live View UI
check-circle-line exclamation-circle-line close-line
Scroll to top icon