Naftis is a web-based dashboard for Istio. It helps user manage their Istio tasks more easily. Using Naftis we can custom our own task templates, then build task from them and execute it.
- Naftis
.
├── bin # directory store binary
├── config # directory store configuration files
│  ├── in-cluster.toml # in Kubernetes cluster configuration file
│  ├── in-local.toml # in local machine configuration file
├── install # Helm Charts
│  └── helm
│  ├── mysql
│  └── naftis
├── src # source code
│  ├── api # backend server source code
│  │  ├── bootstrap # store start arguments
│  │  ├── executor # execute tasks from task queue
│  │  ├── handler # HTTP handlers
│  │  ├── log # log package wraps zap
│  │  ├── middleware # HTTP middlewares
│  │  ├── model # common models
│  │  ├── router # HTTP routers
│  │  ├── service # some wraped services
│  │  ├── storer # db storer
│  │  ├── util # utilities
│  │  ├── version # provides build-in version message
│  │  ├── worker # task worker
│  │  └── main.go # index of backend server
│  └── ui # frontend source code
│  ├── build # webpack scripts
│  ├── src # truly frontend source code
│  ├── package.json
│  ├── package-lock.json
│  ├── postcss.config.js
│  ├── README-CN.md
│  └── README.md
├── tool # some shell and migrate scripts
│  ├── img
│  ├── apppkg.sh
│  ├── build.sh
│  ├── cleanup.sh # clean up Naftis
│  ├── conn.sh
│  ├── genmanifest.sh # generate manifest for Naftis deployment in Kubernetes
│  ├── gentmpl.go
│  ├── naftis.sql # Naftis migrate sql scripts
│  ├── naftis.conf # Naftis Nginx configuration file
│  └── version.sh
├── vendor # go dependencies
├── Dockerfile.api # backend image dockerfile
├── Dockerfile.ui # frontend image dockerfile
├── Gopkg.lock # dep depencies version lock file
├── Gopkg.toml # dep depencies version primarily hand-edited file
├── LICENSE
├── Makefile # project's makefile
├── mysql.yaml # Kubernetes Naftis API and UI manifest, generate by Helm
├── naftis.yaml # Kubernetes Naftis MySQL manifest, generate by Helm
├── README-CN.md
├── README.md
└── run # shortcut script for local running- Integrates with some real-time dashboards
- Customizable task template
- Support Rollback specific task
- Optimized Istio service graph with supporting of specifying particular root service node
- With diagnose data of Istio services and pods
- Out of the box, easy deployment with
kubectlcommands - Istio 1.0 supported
- Istio > 1.0
- Kubernetes >= 1.9.0
- HIUI >= 1.0.0
Naftis dashboard use powerful HIUI (A React based UI components which released by Xiaomi FE Team) to built responsive UI, more reference:
https://github.com/XiaoMi/hiui
# download latest Naftis release files and manifest
wget -O - https://raw.githubusercontent.com/XiaoMi/naftis/master/tool/getlatest.sh | bash
# deploy Naftis under bare metal Kubernetes
kubectl create namespace naftis && kubectl apply -n naftis -f mysql.yaml && kubectl apply -n naftis -f naftis.yaml
# deploy Naftis under cloud Kubernetes cluster, such as GKE, Amazon EKS, Alibaba Cloud Kubernetes
kubectl create namespace naftis && kubectl apply -n naftis -f mysql-cloud.yaml && kubectl apply -n naftis -f naftis.yaml
# port forward Naftis
kubectl -n naftis port-forward $(kubectl -n naftis get pod -l app=naftis-ui -o jsonpath='{.items[0].metadata.name}') 8080:80 &
# explorer http://localhost:8080/ with your browser, default user name and password is "admin".# download latest Naftis files and manifest
wget -O - https://raw.githubusercontent.com/XiaoMi/naftis/master/tool/getlatest.sh | bash
# create Naftis namespace
$ kubectl create namespace naftis
# ensure Naftis namespace is created
$ kubectl get namespace naftis
NAME STATUS AGE
naftis Active 18m
# deploy Naftis MySQL service under bare metal Kubernetes
$ kubectl apply -n naftis -f mysql.yaml
# deploy Naftis MySQL service under cloud Kubernetes cluster, such as GKE, Amazon EKS, Alibaba Cloud Kubernetes
$ kubectl apply -n naftis -f mysql-cloud.yaml
# ensure MySQL service is deployed
$ kubectl get svc -n naftis
NAME READY STATUS RESTARTS AGE
naftis-mysql-c78f99d6c-kblbq 1/1 Running 0 9s
naftis-mysql-test 1/1 Running 0 10s
# deploy Naftis API and UI service
$ kubectl apply -n naftis -f naftis.yaml
# ensure Naftis all services is correctly defined and running
$ kubectl get svc -n naftis
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
naftis-api ClusterIP 10.233.3.144 <none> 50000/TCP 7s
naftis-mysql ClusterIP 10.233.57.230 <none> 3306/TCP 55s
naftis-ui LoadBalancer 10.233.18.125 <pending> 80:31286/TCP 6s
$ kubectl get pod -n naftis
NAME READY STATUS RESTARTS AGE
naftis-api-0 1/2 Running 0 19s
naftis-mysql-c78f99d6c-kblbq 1/1 Running 0 1m
naftis-mysql-test 1/1 Running 0 1m
naftis-ui-69f7d75f47-4jzwz 1/1 Running 0 19s
# browse Naftis via port-forward
$ kubectl -n naftis port-forward $(kubectl -n naftis get pod -l app=naftis-ui -o jsonpath='{.items[0].metadata.name}') 8080:80 &Explorer http://localhost:8080/ with your browser, default user name and password is "admin".
# run migrate sql script
mysql> source ./tool/naftis.sql;
# modify in-local.toml and replace with your own MySQL DSN.- Linux
make build && ./bin/naftis-api start -c config/in-local.toml -i=false # building and starting naftis-apior
./run- Mac OS
GOOS=darwin GOARCH=amd64 make build && ./bin/naftis-api start -c config/in-local.toml -i=false # building and starting naftis-apior
GOOS=darwin GOARCH=amd64 ./runcp tool/naftis.conf <your-nginx-conf-directory>/naftis.conf
# modify naftis.conf and then reload Nginxcd src/ui
npm install
npm run dev # start node proxy
# Explorer http://localhost:5200/ with your browser.Naftis api and ui image has been published on Docker Hub in api and ui.
go get github.com/xiaomi/naftisAdd the follow exports to your ~/.profile. autoenv is also strongly recommended.
# Change GOOS and GOARCH with your environment.
export GOOS="linux" # or replace with "darwin", etc.
export GOARCH="amd64" # or replace with "386", etc.
# Change USER with your Docker Hub account for pulling and pushing custom docker container builds.
export USER="sevennt"
export HUB="docker.io/$USER"If you choose autoenv to export environment variables, type cd . to make it work.
We use dep to manage our go dependencies.
# install dep
go get -u github.com/golang/dep
dep ensure -v # install dependciesmake # make all targets
make build # build api binaries, frontend assets, and Kubernetes manifest
make build.api # build backend binaries
make build.ui # build frontend assets
make build.manifest # build Kubernetes manifest
make fmt # go fmt codes
make lint # lint codes
make vet # vet codes
make test # run tests
make tar # compress directories
make docker # build docker images
make docker.api # build backend docker images
make docker.ui # build frontend docker images
make push # push images to docker.io
./bin/naftis-api -h # show help messages
./bin/naftis-api version # show binary build version messages
./tool/cleanup.sh # clean up Naftis- Add testcases
- Supporting query Istio resource
- Add Links of Grafana, Jaeger, Prometheus