[root@ ~]# kubectl get pods -n test |grep test-app
test-app-6f57f6fffb-gfblz 1/1 Running 0 6d23h
[root@ ~]# kubectl get endpoints -n test test-app
NAME ENDPOINTS AGE
test-app 10.223.216.201:8080 1d
[root@ ~]# kubectl describe endpoints -n test test-app
Name: test-app
Namespace: test
Labels: app=test-app
Annotations: endpoints.kubernetes.io/last-change-trigger-time: 2022-06-02T19:07:21+08:00
Subsets:
Addresses: 10.223.216.201
NotReadyAddresses: <none>
Ports:
Name Port Protocol
---- ---- --------
8080tcp 8080 TCP #Note the port name here
Events: <none>
curl http://127.0.0.1:80/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f8sdfcx7ad84b625c8f1sdfagw32' -X PUT -i -d '
{
"uri": "/*", # location path
"name": "test-test-app-for-kubernetes", #Name a free reason
"priority": 100,
"host": "test.xxxx.cn", #Fill in according to your own domain name
"methods": ["PUT", "GET", "POST", "DELETE", "PATCH", "HEAD", "OPTIONS","CONNECT", "TRACE"],
"upstream": {
"timeout": {
"connect": 6,
"send": 6,
"read": 6
},
"service_name": "test/test-app:tcp8080", #Configuration format: namespace/deploy_name:port_name
"type": "roundrobin",
"discovery_type": "kubernetes" #type use kubernetes
}
}'
Current State
Desired State
Since the dashboard does not support routes of kubernetes type, it is created by calling API