= Kiali image:https://img.shields.io/twitter/url/http/shields.io.svg?style=social["Tweet about Kiali", link="https://twitter.com/intent/tweet?text=Learn%20what%20your%20Istio-Mesh%20is%20doing.%20Visit%20https://www.kiali.io/%20and%20@kialiProject"] :toc: macro :toc-title:
image:https://img.shields.io/badge/license-Apache2-blue.svg["Apache 2.0 license", link="LICENSE"]
== Introduction
link:https://kiali.io/[kiali] is a management console for Istio service mesh. Kiali can be quickly installed as an Istio add-on or integrated as a trusted component within a production environment.
=== Table of contents
toc::[]
=== Contributing
First, check the link:https://kiali.io/community/[Community section on kiali.io], which provides a brief introduction on contributing, how to report issues and request features, and how to reach us.
For those interested in making code contributions, please also check the link:./CONTRIBUTING.md[Contribution Guide].
=== Getting Started
The target audience of this README are developers. For those who are not developers but wish to learn more about Kiali, the link:https://kiali.io/docs[Kiali documentation] should be more helpful. For instructions on installing Kiali, please read the link:https://kiali.io/docs/installation/[Installation] page.
=== AI Documentation (Dev Preview)
Kiali includes a Chat AI integration in developer preview. The APIs and configuration are still evolving and may change without notice. See link:./ai/README.md[AI README] for details.
=== How and where Kiali is released?
Read the link:./RELEASING.adoc[RELEASING.adoc] file.
== Developer setup
Ensure the following tools are available:
- The link:http://golang.org/doc/install[Go Programming Language] ** Kiali releases are built with a specified minimum version of Go, as indicated in the link:https://github.com/kiali/kiali/blob/master/Makefile#L31[Makefile]. While Kiali may compile with other versions, using the version specified in the Makefile is recommended for consistent builds.
- link:http://git-scm.com/book/en/v2/Getting-Started-Installing-Git[git]
- gcc
- link:https://docs.docker.com/installation/[Docker] or link:https://podman.io[Podman]
** If using
podman, set the environment variableDORP=podman. - link:https://nodejs.org[NodeJS] (Node.js >= 20 with the NPM command)
** link:https://nodejs.org/api/corepack.html[Corepack] is used to manage the Yarn version. Enable it with
corepack enable. The exact Yarn version is pinned infrontend/package.jsonvia thepackageManagerfield. - The GNU make (or a compatible alternative)
Once the required developer tools are available, the code can be obtained and built using the following script:
[source,shell]
Checkout the source code
mkdir kiali_sources cd kiali_sources export KIALI_SOURCES=$(pwd)
git clone https://github.com/kiali/kiali.git git clone https://github.com/kiali/kiali-operator.git git clone https://github.com/kiali/helm-charts.git
ln -s $KIALI_SOURCES/kiali-operator kiali/operator
Build the front-end
make build-ui
Build the back-end
cd $KIALI_SOURCES/kiali make build
Go test flags can be passed via the GO_TEST_FLAGS environment variable.
make -e GO_TEST_FLAGS="-race -v -run="TestCanConnectToIstiodReachable"" test
[NOTE] The rest of this README assumes the directory tree created by the previous commands:
-- kiali_sources |- kiali |- kiali-operator - helm-charts
=== Create a Kubernetes cluster and install a Service Mesh
To use Kiali, a management console for Istio-based service meshes, an Istio-compatible service mesh is required. Istio meshes are installed on Kubernetes clusters.
We provide a few unsupported scripts that can help to get started. The scripts below are already in the Kiali Repository. Ensure that the correct path is being used to run the scripts without issues.
- One way to setup your development environment locally is to run the link:hack/run-integration-tests.sh[
run-integration-tests.sh] script. This will start a local cluster, install Istio and Bookinfo, and then start Kiali. It supports every deployment scenario including multi-cluster, external Kiali, etc. It is also run as part of the CI pipeline so there's a high chance it will work for you. The multi-cluster suites currently do not work with podman and you must have docker engine installed on your system. - The link:hack/crc-openshift.sh[
crc-openshift.sh] script allows creation of an OpenShift cluster on a local machine. - For those familiar with minikube, the link:hack/k8s-minikube.sh[
k8s-minikube.sh] script can be used. This script includes an option to install Dex, which is helpful for testing with OpenID. - Alternatively, the link:hack/start-kind.sh[
start-kind.sh] script can be used to create a single-node KinD cluster with MetalLB enabled, allowing Kiali to be tested in a real environment. - Finally, the link:hack/istio/install-istio-via-istioctl.sh[
install-istio-via-istioctl.sh] and the link:hack/istio/install-bookinfo-demo.sh[install-bookinfo-demo.sh] scripts can assist in installing Istio and the Bookinfo sample application in the cluster, respectively. Trying to run these scripts without any arguments is also an option.
These scripts are written to rely on the minimum dependencies as possible and will try to download any required tools.
Based on the type of cluster in use, define the CLUSTER_TYPE environment variable in the shell. Set it to openshift (default if not specified), minikube or kind so the Makefiles can assist with additional operations. For other cluster types, set CLUSTER_TYPE=local.
[NOTE]
For minikube it is recommended to enable the registry and ingress add-ons, which can be configured by the k8s-minikube.sh script.
[NOTE]
When using docker with Minikube's registry add-on or any custom non-secure registry, ensure the link:https://docs.docker.com/registry/insecure/[Docker daemon is properly configured to use your registry].
=== Running Kiali from your local kubeconfig (with hot-reload)
This is the simplest way to get started developing on Kiali. You will startup the backend which reads from your local kubeconfig file and connects to the cluster set as your current context by default. Kiali uses link:air[https://github.com/air-verse/air] to enable hot reloads for the backend server.
[source,shell]
make build-ui make run-backend
To pass additional arguments to the backend, set the KIALI_RUN_ARGS environment variable.
For example:
make KIALI_RUN_ARGS="--log-level debug" run-backend
To pass additional contexts from your kubeconfig for multi-cluster Kiali:
make KIALI_RUN_ARGS="--remote-cluster-contexts kind-mesh --cluster-name-overrides kind-mesh=mesh" run-backend
The kube context name must match the Istio cluster name otherwise you must provide a cluster name override as shown above.
In a separate terminal, start the frontend dev server. This will start the frontend dev server that connects to the backend running in the other terminal. It will also open the Kiali UI in your default browser.
[source,shell]
make run-frontend
Now kiali will be rebuilt and reloaded automatically when you make changes to either the backend or the frontend.
=== Building the Container Image and deploying to a cluster
Assuming the following conditions:
- The back-end and front-end have been successfully built. Note that the front-end assets need to be built before the back-end, as the back-end will embed the front-end assets during its build process.
- A Kubernetes cluster with an Istio-based Service Mesh has been created
- The
CLUSTER_TYPE=localenvironment variable is not being used
The commands below will deploy a development build of Kiali to the cluster.
[source,shell]
cd $KIALI_SOURCES/kiali
Build the Kiali-server and Kiali-operator container images and push them to the cluster
make cluster-push
To build and push only the Kiali-server container images:
make cluster-push-kiali
To build and push only the Kiali-operator container images:
make cluster-push-operator
Deploy the operator to the cluster
make operator-create
Create a KialCR to instruct the operator to deploy Kiali
make kiali-create
When using the CLUSTER_TYPE=local environment variable, additional environment variables must be declared to specify the container registry for pushing container images. The make container-push* targets should be used instead of the cluster-push* targets. For example, if the container registry is localhost:5000:
[source,shell]
export QUAY_NAME=localhost:5000/kiali/kiali export CONTAINER_NAME=localhost:5000/kiali/kiali export OPERATOR_QUAY_NAME=localhost:5000/kiali/kiali-operator export OPERATOR_CONTAINER_NAME=localhost:5000/kiali/kiali-operator
cd $KIALI_SOURCES/kiali
Build the Kiali-server and Kiali-operator container images and push them to the cluster
make container-build container-push