一个 Kubernetes 原生 API 管理解决方案
Kanali is an extremely efficient Kubernetes ingress controller with robust API management capabilities. Built using native Kubernetes constructs, Kanali gives you all the capabilities you need when exposing services in production without the need for multiple tools to accomplish them. Here are some notable features:
$ git clone [email protected]:northwesternmutual/kanali.git && cd kanali
$ minikube start --kubernetes-version v1.7.5
$ ./scripts/install.sh # wait until all pods are in running state
$ kubectl apply -f ./examples/exampleOne.yaml
$ curl $(minikube service kanali --url --format="https://{{.IP}}:{{.Port}}")/api/v1/example-one
$ open $(minikube service kanali-grafana --url)/dashboard/file/kanali.json
$ open $(minikube service jaeger-all-in-one --url)A complete guide showcasing all of Kanali's features is provided to ease the learning curve! The guided tutorial can be found here.
Looking for documentation for the custom Kubernetes resources that Kanali creates and uses? Find it here.
While Kanali has its own built in plugins, it boasts a decoupled plugin framework that makes it easy for anyone to write and integrate their own custom and version controlled plugin! The guided tutorial can be found here.
Kanali is lightweight and does not require the deployment of a sidecar container in each application pod. Because of this, there is the potential for internal service to service traffic to occur unauthenticated. Hence, this must be mitigated. Kubernetes provides a resource for this called a NetworkPolicy. This allows you to require the source of any ingress traffic to a pod be from Kanali. In order to use a NetworkPolicy, your Kubernetes cluster must use an overlay network that implements the controller for this resource. Such overlay networks include Calico and WeaveNet.
Kanali leverages Grafana and InfluxDB for analytics and monitoring. It also uses Jaeger for tracing. If you are using Helm to deploy Kanali, these tools are deployed and configured for you.
| Jaeger | Grafana |
|---|
|
|
There are multiple ways to deploy Kanali. For each, a Kubernetes cluster is required. For local testing and development, use Minikube to bootstrap a cluster locally.
Each option below requires cloning this project locally. You can do so with the following command:
$ git clone https://github.com/northwesternmutual/kanali.git
# $ git clone [email protected]:northwesternmutual/kanali.git
$ cd kanaliHelm is a tool for managing Kubernetes charts. Charts are packages of pre-configured Kubernetes resources. Install Kanali along with Grafana, Influxdb, and Jaeger by using the following commands:
$ which helm || curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get > get_helm.sh | bash
$ helm init
$ ./scripts/helm-permissions.sh
$ kubectl get pods # wait until all pods are up and running
$ helm install ./helm --name kanaliThis installation process only installs Kanali. The deployment of Grafana, Influxdb, and Jaeger as left to the user.
$ which kubectl || curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/darwin/amd64/kubectl && chmod +x kubectl && mv kubectl /usr/bin/kubectl
$ kubectl apply -f kubernetes.yamlBelow are the steps to follow if you want to build/run/test locally. Glide is a dependency.
$ mkdir -p $GOPATH/src/github.com/northwesternmutual
$ cd $GOPATH/src/github.com/northwesternmutual
$ git clone https://github.com/northwesternmutual/kanali
$ cd kanali
$ make install_ci
$ make kanali
$ ./kanali --helpKanali can be configured in three different ways. These are highlighted below. Each item takes precedence over the item below it. All possible configuration items are shown in the first example with the later examples demonstrating the conversion factor from the first.
$ kanali [command] [flags]…For each flag above, transform to upper case and append the result to KANALI_. As an example, the cli flag --analytics.influx_addr would be overwritten with the KANALI_ANALYTICS.INFLUX_ADDR environment variable.
Kanali accepts configuration files in JSON, YAML, TOML, or HCL formats. Each location below takes precedence over the one below it:
/etc/kanali/config.ext$HOME/conifig.ext./conifig.extReference config.toml for a complete example.
暂无开放 Issues,或尚未同步最近议题。