Running CLI commands Kubernetes environment

I’ve installed Consul on Kubernetes environment.

$ k get all -n consul
NAME                         READY   STATUS    RESTARTS   AGE
pod/consul-consul-4pcj4      1/1     Running   0          12h
pod/consul-consul-l6dfx      1/1     Running   0          12h
pod/consul-consul-server-0   1/1     Running   0          12h
pod/consul-consul-server-1   1/1     Running   0          12h

NAME                           TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)                                                                   AGE
service/consul-consul-dns      ClusterIP   <none>        53/TCP,53/UDP                                                             12h
service/consul-consul-server   ClusterIP   None             <none>        8500/TCP,8301/TCP,8301/UDP,8302/TCP,8302/UDP,8300/TCP,8600/TCP,8600/UDP   12h
service/consul-consul-ui       ClusterIP    <none>        80/TCP                                                                    12h

daemonset.apps/consul-consul   2         2         2       2            2           <none>          12h

NAME                                    READY   AGE
statefulset.apps/consul-consul-server   2/2     12h

Where/how/which interface can I use cli commands in this environment? Is there any Consul client cli or something like that to connect/administrate Consul?


consul server, agent, cli are all the same executable. It acts differently based on the parameters you pass to it. So inside of your 2 servers and 2 data nodes you have the consul cli already (it’s the same one that is running the service).

Any of them will accept a cli connection and respond. The only distinction you have make is when registering a service – I imagine there is an automated service registery with kubernetes that you have to configure.

Hello Aram,
Please take a look here

Hi @tirelibirefe,

I replied to your GitHub issue with more information on how you can run Consul CLI commands when the servers are on Kubernetes. See for more details.

You’re welcome to continue to discussion here, or on that issue. Whichever you prefer.