ACI-Kubernetes-Visualiser

Visualising Kubernetes ACI

CISCO VKACI

Introduction

Visualisation of Kubernetes using ACI (Vkaci) is an open-source tool that generates a cluster topology and provides a visual representation, using neo4j graph database by accessing ACI and K8s APIs. This tool lets you quickly build visualisations of K8s and ACI end to end topologies. The objective of this documentation is to outline the creation, design, and installation of Vkaci to help users view their topologies.

Cisco Application Centric Infrastructure (Cisco ACI) is a component of Cisco’s purpose-based networking design, which enables data centre agility and resiliency. It creates a policy that captures higher-level business and user intent and turns it into the network constructs needed to dynamically supply network, security, and infrastructure services.

The Kubernetes API allows you to query and manipulate the state of Kubernetes API objects (For example: Pods, Namespaces, ConfigMaps, and Events).

Licensing Requirements

Please note

Fundamental Requirement

GPL 3 is a strong copyleft license, meaning that any copy or modification of the original code must also be released under the GPL v3. In other words, you can take the GPL 3’d code, add to it or make major changes, then distribute your version. However, your version is subject to the same license requirements, meaning that it must be under GPL v3 as well — anyone can see your modified code and install it for their own purposes.

Developers Requirement

Research indicates that open source software contributors are motivated more by a desire to learn and be part of the OSS community than by financial rewards. Hence consider distribution of this code ethically and not for any external companies production or commercial environment.

Installing

Connectivity Requirements in Cluster

Vkaci needs to connect to the APIC (OOB or InBand) via certificate-based authentication. It is expected that your APIC is pre-configured for certificate-based authentication.

Installation – Helm Chart

A Helm chart for Vkaci has been created to enable simple deployment of the Vkaci app and a dependent Neo4j database along with required services on a K8s cluster.

The helm chart can currently be found in the source code for VKACI and is also available in the following repo:

https://datacenter.github.io/ACI-Kubernetes-Visualiser

Required Variables:**

Name Description Example
apicIps Comma separated list of your APIC Ips. 10.67.185.102,10.67.185.41,10.67.185.42
apicCertName Name of the certificate configured in the APIC. ansible.crt
apicKeyData The base64 encoded string that represents the certificate data. Steps to generate data below.
apicUsername Name of the APIC certificate user. ansible
vrfTenant Tenant where the cluster VRF is deployed. calico
vrfName Name of the VRF used by the cluster. vrf

Web UI External Connectivity:

To access the webui you have the following options:

service:
  externalTrafficPolicy: Cluster
  nodePort: 30000
  type: NodePort
service:
  externalTrafficPolicy: Local
  type: NodePort
  externalIPs:
  - 192.168.14.2
service:
  type: LoadBalancer

neo4j External Connectivity:

Currently the Client (Web Browser) needs to be able to access the neo4j database directly. This can be achieved by exposing the neo4j service as NodePort or LoadBalancer type. This is done by configuring the neo4j-standalone.services.default. Based on this configuration the vkaci deployment will be configured to pass, to the browser, the neo4j service IP.

Depending on your network and CNI you might wish to expose the neo4j service in different ways, here are a few options:

Recommended for: Kube-Router or Calico

neo4j-standalone:
  services:
    # This setting configure the default neo4j service to 
    default:
      externalTrafficPolicy: Cluster # Needs to be cluster so that if the POD is not running on the specified nodes K8s will still route the traffic to it 
      type: NodePort
      nodeExternalIP: 192.168.11.1
      port: 30002 #This is mandatory and must be specified by the user, ensure you are not picking an already used port!

Recommended for: Kube-Router or Calico

neo4j-standalone:
  services:
    # This setting configure the default neo4j service to 
    default:
      externalTrafficPolicy: Local  # Ensure the Service IP is advertised as a /32 where supported (Calico or Kube-Router)
      type: NodePort
      externalIPs:
        - 192.168.14.1

Recommended for: Cilium

neo4j-standalone:
  services:
    # This setting configure the default neo4j service to 
    default:
      type: LoadBalancer
      loadBalancerIP: 192.168.14.0 #

Example values.yml:

# VKACI APIC Variables
apicIps: "10.67.185.102,10.67.185.41,10.67.185.42"
apicCertName: "ansible.crt"
apicKeyData: "<base64 certificate data>"
apicUsername: "ansible"
vrfTenant: "calico"
vrfName: "vrf"
# Neo4j Variables
neo4j-standalone:
  services:
    default:
      type: NodePort
      externalIPs:
        - 192.168.14.0

Here you can find more examples!

To generate the base64 data for apicKeyData from the apic key file use the base64 command. Eg.

base64 certificate.key

Installation - In Cluster

Pre Requisites: A working K8s or OpenShift cluster and the ability to expose (to the client web browser) the neo4j database directly

helm repo add vkaci https://datacenter.github.io/ACI-Kubernetes-Visualiser
# VKACI APIC Variables
# All of these will need to be set correctly
apicIps: "<comma separated list of your APIC IP>" # The POD IP needs to have connectivity to ACI
apicUsername: "<User Name>"
apicCertName: "<The name of the certificate for the user>"
vrfTenant: "<Name of the Tenant Where the cluster VRF is located>"
vrfName: "<Name of the Cluster VRF>"
apicKeyData: <base64 certificate data>

service:
  externalTrafficPolicy: Local
  type: NodePort
  externalIPs:
  - 192.168.22.1

# Neo4j Chart Settings
neo4j-standalone:
  services:
    # This setting configure the default neo4j service to
    default:
      externalTrafficPolicy: Local  # Ensure the Service IP is advertised as a /32 where supported (Calico or Kube-Router)
      type: NodePort
      externalIPs:
        - 192.168.22.2
  neo4j:
    password: "" # Set a very good password
helm install -n vkaci vkaci vkaci/vkaci -f values.yaml