官方文档提供了比较全的环境安装说明
我使用的系统是mac,同时使用minikube 运行
安装kumactl
下载地址:
https://kong.bintray.com/kuma/kuma-0.1.1-darwin.tar.gz
安装包内容
配置环境变量(可选)
export PATH=$PATH:$PWD/kuma-0.1.1-darwin/bin
安装控制面板
kumactl install control-plane | kubectl apply -f -
查看安装的组件
kubectl get pod -n kuma-system
NAME READY STATUS RESTARTS AGE
kuma-control-plane-668d88f9cf-f885r 1/1 Running 0 119s
kuma-injector-6d95865-6bnxs 1/1 Running 0 119s
部署demo服务
kubectl apply -f https://raw.githubusercontent.com/Kong/kuma/master/examples/kubernetes/sample-service.yaml
应用策略
echo "apiVersion: kuma.io/v1alpha1
kind: Mesh
metadata:
namespace: kuma-system
name: default
spec:
mtls:
enabled: true
ca:
builtin: {}" | kubectl apply -f -
配置远程控制服务
因为使用的是集群ip,不是很方便,所以暴露了一个nodeport 的服务
- service json 定义文件
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "kuma-control-plane2"
},
"spec": {
"ports": [
{
"name": "grpc-sds",
"protocol": "TCP",
"port": 5677,
"targetPort": 5677
},
{
"name": "grpc-xds",
"protocol": "TCP",
"port": 5678,
"targetPort": 5678
},
{
"name": "http-xds",
"protocol": "TCP",
"port": 5679,
"targetPort": 5679
},
{
"name": "http-api-server",
"protocol": "TCP",
"port": 5681,
"targetPort": 5681
},
{
"name": "http-bootstrap-server",
"protocol": "TCP",
"port": 5682,
"targetPort": 5682
}
],
"selector": {
"app": "kuma-control-plane"
},
"type": "NodePort",
"sessionAffinity": "None"
}
}
- 添加控制面板管理
注意address 为minikube 的ip 以及服务5681 暴露的nodeport 端口
kumactl config control-planes add --name=dalong --address=http://192.168.99.103:30811
- 查看配置
- 查看暴露的mesh 服务
kuma 安装部署的k8s服务
说明
以上是一个简单的运行,对于服务之间的通信,详细的配置,后续会在学习