In a consul-connect-service-mesh (using k8) how do you get to the consul-api itself? For example to access the consul-kv.
I'm working through this tutorial, and I'm wondering how you can bind the consul (http) api in a service to localhost.
Do you have to configure the Helm Chart further? I would have expected the consul-agent to always be an upstream service.
The only way i found to access the api is via the k8-service consul-server.
Environment:
- k8 (1.22.5, docker-desktop)
- helm consul (0.42)
- consul (1.11.3)
- used helm-yaml
global:
name: consul
datacenter: dc1
server:
replicas: 1
securityContext:
runAsNonRoot: false
runAsGroup: 0
runAsUser: 0
fsGroup: 0
ui:
enabled: true
service:
type: 'NodePort'
connectInject:
enabled: true
controller:
enabled: true
My current final solution is a (connect)service based on reverse proxy (nginx) that targets consul.
A downstream service (called static-client) now can be declared like this
Assume we have a key-value in consul called "test". From a pod of the static-client we can now access the consul-web-api with:
This solution still lacks fine-tuning (i have not try https, or ACL).