Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
github.com/kiali/kiali
= 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 trusted as a part of your 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.
If you would like to make code contributions, please also check the link:./CONTRIBUTING.md[Contribution Guide].
=== Getting Started
The target audience of this README are developers. If you are not a developer but want 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.
=== How and where Kiali is released?
Read the link:./RELEASING.adoc[RELEASING.adoc] file.
== Developer setup
Make sure you have the following tools:
podman
declare the environment variable DORP=podman
.Once you have the required developer tools, you can get and build the code with the following script:
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
cd $KIALI_SOURCES/kiali make build 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
Since Kiali is a management console for an Istio-based service mesh, you will need an Istio-like Service Mesh to try Kiali. Then, Istio Meshes are installed on Kubernetes clusters.
We provide a few unsupported scripts that can help to get started:
crc-openshift.sh
] script to create an OpenShift cluster on your local machine.k8s-minikube.sh
] script. It has the option to install Dex which is useful if you want to test with OpenID.start-kind.sh
] script to create a single node KinD cluster with metallb enabled for testing Kiali against a real environment.install-istio-via-istioctl.sh
] and the link:hack/istio/install-bookinfo-demo.sh[install-bookinfo-demo.sh
] scripts can assist into installing Istio and the Bookinfo sample application in your cluster, respectively. You can try running these scripts without any arguments.These scripts are written to rely on the minimum dependencies as possible and will try to download any required tools.
Depending on the type of cluster you are using, you should define the CLUSTER_TYPE
environment variable on your shell to openshift
(this is the default if not set), minikube
or kind
value so that the Makefiles can assist in other operations. If you are not using any of these clusters, you should set the environment variable to CLUSTER_TYPE=local
.
[NOTE]
If you are using minikube
it's recommended that you enable the registry
and ingress
add-on. The k8s-minikube.sh
script should do this for you.
[NOTE]
If you are using docker
and using minikube's registry add-on or any custom non-secure registry, make sure the link:https://docs.docker.com/registry/insecure/[Docker daemon is properly configured to use your registry].
=== Building the Container Image and deploying to a cluster
Assuming that:
CLUSTER_TYPE=local
environment variablethe following commands should deploy a development build of Kiali to the cluster:
cd $KIALI_SOURCES/kiali
make cluster-push
make operator-create
If you are using the CLUSTER_TYPE=local
environment variable, you will need to declare some additional environment variables to set the container registry where container images should be pushed and use make container-push*
targets instead of cluster-push*
targets. For example, if your container registry is localhost:5000
:
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
make container-build container-push
make operator-create
=== Reloading Kiali image
If you already have Kiali installed and you want to recreate the kiali server pod, you can run the following command:
This is to facilitate development. To quickly build a new Kiali container image and load it to the cluster, you can run:
cd $KIALI_SOURCES/kiali/frontend yarn && yarn build
[NOTE]
There is no equivalent reload command for the operator. You would need to manually reload the operator via kubectl
or oc
commands.
=== Cluster clean-up
cd $KIALI_SOURCES/kiali
make kiali-delete
kiali-create
and kiali-delete
targets will be ineffectiveoperator-create
target to re-deploy the Kiali operator again.=== Code formatting and linting
If you are changing the back-end code of Kiali, before submitting a pull request make sure your changes are properly formatted and no new linting issues are introduced by running:
cd $KIALI_SOURCES/kiali
make lint-install
=== Enable tracing
Kiali itself is instrumented with opentelemetry tracing to help provide insights and surface performance issues for the kiali server. To enable, set the server.observability.tracing.enabled
and server.observability.tracing.collector_url
configuration options.
=== Running Standalone
You may want to run Kiali outside of any cluster environment for debugging purposes. To do this, you
will want to use the link:./hack/run-kiali.sh[run-kiali.sh hack script] located in the
link:./hack[hack directory]. See the --help
output for the options you can set.
The default configuration it uses is found in the link:./hack/run-kiali-config-template.yaml[config template file]
also located in the hack
directory. Read the comments at the tops of both files for more details.
=== Running integration tests
There are two sets of integration tests. The first are backend tests that test the Kiali API directly. These can be found at link:./tests/integration/README.md[backend tests]. The second are frontend Cypress tests that test Kiali through the browser. These can be found at link:./frontend/cypress/README.md[frontend tests].
Both tests are run as part of the CI pipeline. If you'd like to run these same tests locally, you can use link:./hack/run-integration-tests.sh[this script] to setup your local environment and run the integration tests. Or these tests can be run against any live environment that meets the following requirements.
Requirements:
You can use link:./hack/istio/install-testing-demos.sh[this script] to install all the neccessary demo apps for testing. The script supports both openshift and non-openshift deployments.
<kiali-url>
is the URL to the base Kiali UI location such as http://localhost:20001/kiali
:make -e YARN_START_URL=http:// yarn-start
Note that make cypress-gui
runs the Cypress GUI that allows you to pick which individual tests to run. To run the entire test suite in headless mode, use the make target cypress-run
instead.
=== Debugging Server Backend
==== VisualStudio Code
If you are using VisualStudio Code, you can install the following launcher.json
that is then used to launch the Kiali Server in the debugger. Run the hack/run-kiali.sh
script first to ensure the proper services are up (such as the Prometheus port-forward proxy).
=== Debugging GUI Frontend
You can debug the Kiali GUI directly inside of Google Chrome using the Chrome Developer Tools or using VisualStudio Code.
In order to use either one, you first must perform some initial steps.
First, run the Kiali Server backend, either normally within a cluster or via run-kiali.sh
as explained earlier. Determine what the Kiali URL is before moving to the next step. For example, if you run Kiali in minikube, and you set up a port-forward that exposes it, the URL to remember will be http://localhost:20001/kiali
.
Second, run the GUI frontend using make: make -e YARN_START_URL=<kiali-url> yarn-start
where <kiali-url>
is the URL you determined from the previous step. You may need to also pass -e PORT=3001
to override the default port where the yarn server will listen to (the default is 3000
which will conflict with Grafana if you started the Kiali Server via run-kiali.sh
). Some examples:
make -e YARN_START_URL=http://localhost:20001/kiali yarn-start
.make -e YARN_START_URL=https://<Kiali-OpenShift-Route-IP>/ yarn-start
.run-kiali.sh
, then run make -e YARN_START_URL=http://localhost:20001/kiali -e PORT=3001 yarn-start
.The yarn-start
make command will start the Kiali GUI frontend on a local endpoint - when it is ready, look at the output for the "Local" URL you use to access it. The output will look something like this:
Compiled successfully!
You can now view @kiali/kiali-ui in the browser.
Local: http://localhost:3001
On Your Network: http://192.168.1.15:3001
...
At this point, you can begin to set up your debugger tool of choice - see the next sections.
==== Google Chrome Developer Tools
Start Google Chrome and point the browser to the local URL for the Kiali GUI frontend started by yarn-start (in the example above, that will be http://localhost:3001
).
In Google Chrome, open the Developer Tools. You can press F12
or Control-Shift-I
to do this.
Within the Developer Tools, navigate to the Sources
tab, then the Filesystem
sub-tab, and press the + Add folder to workspace
link. In the file selection dialog, select your Kiali frontend/src
folder. This will inform Developer Tools where your Kiali GUI frontend source code can be found.
At this point, you need to give Google Chrome permission to access your local source code folder. Towards the top of the browser window, you will see a prompt - press the "Allow" button to give Chrome the necessary permissions it needs.
You are now ready to debug the Kiali Server frontend. You can set breakpoints, inspect variables, examine stack traces, etc. just as you can do with any typical debugging tool.
==== VisualStudio Code
If you are using VisualStudio Code, you can install the following launcher.json
that is then used to launch Google Chrome to debug the Kiali Server GUI frontend in the debugger. The url
setting is the local URL of the yarn-start server - make sure you use the one appropriate for your environment.
== Configuration
Many configuration settings can optionally be set within the Kiali Operator custom resource (CR) file. See link:https://github.com/kiali/kiali-operator/blob/master/deploy/kiali/kiali_cr.yaml[this example Kiali CR file] that has all the configuration settings documented.
== Embedding Kiali
If you want to embed Kiali in other applications, Kiali offers a simple feature called Kiosk mode. In this mode, Kiali won't show the main header, nor the main navigation bar.
To enable Kiosk mode, you only need to add a kiosk=<platform_id>
URL parameter. You will need to use the full path of the page you want to embed. For example, assuming that you access Kiali through HTTPS:
https://_kiali_path_/overview?kiosk=console
.https://_kiali_path_/graph/namespaces?kiosk=console
.https://_kiali_path_/applications?kiosk=console
.If the page you want to embed uses other URL arguments, you can specify any of them to preset options. For example, if you want to embed the graph of the bookinfo namespace, use the following URL: http://_kiali_path_/graph/namespaces?namespaces=bookinfo&kiosk=console
.
<platform_id>
value in the kiosk
URL parameter will be used in future use cases to add conditional logic on embedded use cases, for now, any non empty value will enable the kiosk mode.
== Configure External Services
=== Grafana
If you have Grafana installed in a custom way that is not easily auto-detectable by Kiali, you need to change in the Kiali CR the value of the grafana > url
== Additional Notes
=== Frontend development guidelines
Frontend development guidelines (styles, i18n, etc.) can be found link:./frontend/README.adoc#developing[here]
=== Upgrading Go
The Kiali project will periodically upgrade to a newer version of Go. These are the steps that need to be performed in order for the Kiali build to use a different version of Go:
go mod edit -go=x.y
where "x" and "y" are the major/minor versions of the Go version being used.go mod tidy -v
make clean build build-ui test
to ensure everything builds correctly. If any problems occur, obviously you must fix them.The Makefile and some Github Actions will check the go version from the go.mod file.
=== Procedure to check and update patternfly versions
npx npm-check-updates -t latest -f '/^@patternfly/'
yarn install
to update the yarn.lock=== Running the UI outside the cluster
When developing the http://github.com/kiali/kiali/frontend[Kiali UI] you will find it useful to run it outside of the cluster to make it easier to update the UI code and see the changes without having to re-deploy. The preferred approach for this is to use the proxy feature of React. The process is described https://github.com/kiali/kiali/blob/master/frontend/README.adoc#developing[here]. Alternatively, you can use the make -e YARN_START_URL=<url> yarn-start
command where <url>
is to the Kiali backend.
=== Disabling SSL
In the provided OpenShift templates, SSL is turned on by default. If you want to turn it off, you should:
Remove the "tls: termination: reencrypt" option from the Kiali route
Remove the "identity" block, with certificate paths, from the Kiali Config Map.
Optionally you can also remove the annotation "service.beta.openshift.io/serving-cert-secret-name" in the Kiali Service, and the related kiali-cabundle
volume that is declared and mounted in Kiali Deployment (but if you don't, they will just be ignored).
== Exposing Kiali to External Clients Using Istio Gateway
The operator will create a Route or Ingress by default (see the Kiali CR setting "deployment.ingress_enabled"). If you want to expose Kiali via Istio itself, you can create Gateway, Virtual Service, and Destination Rule resources similar to below:
apiVersion: networking.istio.io/v1 kind: Gateway metadata: name: kiali-gateway namespace: istio-system spec: selector: istio: ingressgateway servers:
apiVersion: networking.istio.io/v1 kind: VirtualService metadata: name: kiali-virtualservice namespace: istio-system spec: gateways:
== Experimental
=== Observing a Remote Cluster
[NOTE] The "Central IstioD" setup is currently named "Primary-remote" multi-cluster setup.
[WARNING] When this support was incorporated into Kiali, the "Central IstioD" setup of Istio was in an early development phase. These instructions are probably now broken.
There are certain use cases where Kiali needs to be deployed in one cluster (Control Plane) and observe a different cluster (Data Plane). image:https://user-images.githubusercontent.com/6889074/87819080-ad099980-c839-11ea-834b-56eec038ce4d.png[Diagram]
Follow these steps:
1: You should have the link:https://istio.io/latest/docs/setup/install/external-controlplane[Istio with an External Control Plane] setup running
2: Create the link:https://github.com/istio/istio/blob/master/samples/addons/kiali.yaml[Kiali ClusterRole, ClusterRoleBinding, and ServiceAccount] in the Data Plane cluster
5: Kiali now needs the Istio metrics from the sidecars. You need to run Prometheus in the Control Plane and have it scrape the metrics from an link:https://istio.io/latest/docs/reference/config/istio.mesh.v1alpha1/#ProxyConfig[envoyMetricsService]. These link:https://kiali.io/docs/faq/general/#which-istio-metrics-and-attributes-are-required-by-kiali[metrics] are required.
6: Kiali in the Control Plane should now be fully functional with the Data Plane
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.