aspenmesh / istio-vet

Utility for validating Istio configuration in kubernetes cluster
Apache License 2.0
135 stars 35 forks source link
istio istio-vet kubernetes service-mesh

Istio Vet

GoDoc Go Report Card

The istio-vet tool is a utility to validate the configuration of Istio and user applications installed in a Kubernetes cluster.

This tool works with Istio version 0.7.1 and above.

Introduction

The istio-vet utility helps discover incompatible configuration of user applications and Istio components in a kubernetes cluster. Misconfigurations might cause unexpected or incorrect service mesh behavior which can be easily detected and fixed using this tool.

The istio-vet tool invokes a list of independent vetters. Each vetter performs validation on a subset of configurations and generates notes on any misconfiguration.

Note that istio-vet and vetters only read configuration objects from the kubernetes API server.

Example

Vetter meshversion inspects the version of running Istio components and the sidecar version deployed in pods in the mesh. It generates the following note on any version mismatch:

Summary: "Mismatched sidecar version - myapp-xyz-1234"

Message: "WARNING: The pod myapp-xyz-1234 in namespace default is running with
sidecar proxy version 0.2.10 but your environment is running Istio
version 0.2.12. Consider upgrading the sidecar proxy in the pod."

Running Istio-Vet

You can build and run Istio-Vet from this repo, or use the docker image (locally or from within in a kubernetes cluster).

If you want to build Istio-Vet from this repo, please see the instructions for Contributors.

Using Istio-Vet via Docker

Instructions to run Istio-Vet from our official Docker Image: quay.io/aspenmesh/istio-vet:main

Local

When run locally, kube config for the kubernetes cluster needs to be mounted inside the container.

docker run --rm -v $HOME/.kube/config:/root/.kube/config quay.io/aspenmesh/istio-vet:main

In-Cluster

The istio-vet container can be deployed as a Job in a kubernetes cluster using the manifest file in the install directory.

kubectl apply -f install/kubernetes/istio-vet.yaml

To inspect the output of the istio-vet, use the following command:

kubectl -n istio-system logs -l "app=istio-vet" --tail=0

Note that the Job would have to be manually run every time to get the latest output from the istio-vet utility.

Please visit aspenmesh.io and sign-up to receive alerts, insights and analytics from your service mesh.

Repository Layout

This repository contains code for the vet tool and supported vetters packages. It includes:

More details about vetters can be found in the individual vetters package documentation.

Contributing

Individuals or business entities who contribute to this project must have completed and submitted the F5® Contributor License Agreement to cla@aspenmesh.io prior to their code submission being included in this project. Please include your github username in the CLA email.

Build Prerequisites

To build Istio-Vet locally, you will need to install the following:

Clone Istio-Vet

Make this directory. (Dependencies rely on this file structure)

  mkdir -p $GOPATH/src/github.com/aspenmesh
  cd $GOPATH/src/github.com/aspenmesh

Fork and clone this repo into your aspenmesh folder, then cd into istio-vet

  git clone git@github.com:<your-repo>/istio-vet.git
  cd istio-vet

Build Istio-Vet

Run Istio-Vet

You should now be able to run vet at the command line and see its options.

To use the vetters, point Istio-Vet to a kubeconfig file which is associated with a running cluster:

  KUBECONFIG=<full-path-to-kubeconfig>kube.config vet