Skip to main content
Boost your DevOps efficiency! Dive into our latest white paper.Read Now

kapstan connect service

Open a connection to a service

Synopsis

Connect to a specified Kapstan service.

info

Prerequisite: This command depends on the Docker Engine to run, you can install Docker Engine here https://docs.docker.com/engine/install/.

The service flag can be used for SQL Databases (MySQL, PostgreSQL), NoSQL Databases (DocumentDB), as well as application services. It will open a proxy connection to the service.

kapstan connect service -s <my-service>
info

For AWS environments, when you connect to your service using the Kapstan CLI, an audit log entry is created in AWS CloudTrail. This log also records the name of the user who accessed the service, helping you track and monitor access to your services for compliance and security purposes.

The endpoint flag can be used to connect to a specific endpoint inside of your environment that is not registered as a Kapstan service. Eg:

kapstan connect service --endpoint=10.0.0.5:8080

If the Kubernetes flag is set, the endpoint flag will be treated as a Kubernetes service and the connection will be port-forwarded through the cluster. Eg:

kapstan connect service --endpoint=nginx.nginx:80 -K
kapstan connect service [flags]

Options

      --endpoint kapstan.io:443   Endpoint to connect to in <host>:<port> format (i.e. kapstan.io:443). Either service or endpoint must be provided
-e, --environment string Environment name, if unset will use environment set by configure
-h, --help help for service
-k, --keepalive Automatically polls the connection to keep it alive (default true)
-K, --kubernetes Determines whether to treat the endpoint flag as a Kubernetes service or not. If true, the endpoint flag should be in the format <service>.<namespace>:<port> or <service>.<namespace>.svc.cluster.local:<port>
-o, --organization string Organization name, if unset will use organization set by configure
-p, --port string Host port to open the connection on
-s, --service string Name of the service to connect to. Either service or endpoint must be provided

Options inherited from parent commands

      --config-path string   Path to file containing Kapstan CLI config (default "~/.kapstan/config.json")
--debug Enable debug mode
--token string Kapstan API token
--token-path string Path to file containing Kapstan API token (default "~/.kapstan/token.json")

SEE ALSO

Auto generated by spf13/cobra on 15-May-2025

Can't find what you need?