Reputation: 65
I deployed kong ingress controller for our kubernetes, and we are using it for routing our micro services.
Now I want to expose my admin API to use other features and get monitoring stats. Please someone could help me on this.
None of the documention helps me with this.
Upvotes: 1
Views: 3447
Reputation: 9877
Assuming that we are focusing on:
Admin API
This is the port where Kong exposes its management API. Hence in production this port should be firewalled to protect it from unauthorized access.
8001
provides Kong’s Admin API that you can use to operate Kong with HTTP. See admin_listen.8444
provides the same Kong Admin API but using HTTPS. See admin_listen and the ssl suffix.
From Kubernetes/GKE perspective you can access this ports with either:
$ kubectl port-forward deployment/ingress-kong -n kong 8444:8444
:
https://localhost:8444
from your hostService
:
Service
of Kong IngressDeployment
of Kong IngressA side note!
You could also expose it with
Ingress
resource but you would need to create aService
that is pointing to theAdmin API
, modify theDeployment
and apply theIngress
resource that would point to thisService
Focusing on exposing this API with Service
:
Service
: kong-proxy
and add: - name: api
protocol: TCP
port: 8444
targetPort: 8444
Deployment
: kong-ingress
- name: KONG_ADMIN_LISTEN
value: 0.0.0.0:8444 ssl # <-- from 127.0.0.1
IMPORTANT!
Above edits will expose your API to the external sources (assuming no connection with the last question of yours with internal lb of GKE). Please refer to the documentation of Kong for support on that matter:
Additional resources:
Upvotes: 4