Gefyra Logo
Quick Start

Command line tool (CLI)

Gefyra's CLI allows you to run containers on your local machine and connect them to Kubernetes-based resources.

Command line tool (CLI)

Syntax

Use the following syntax to run gefyra commands from your terminal:

gefyra [-h] [-d] [action] [arguments]

where action and arguments are:

  • action: specifies the operation that you want to perform, for example up or bridge
  • arguments: specifies the required and optional arguments for a specific action, for example -n or --namespace

Global flags are:

  • -h, --help: show help message and exit
  • -d, --debug: add debug output for each action

Commands Overview

CommandDescription
bridgeManage your GefyraBridges to redirect traffic from a GefyraBridgeMount target
clientsManage GefyraClients for a Gefyra installation
connectionsManage connections to Kubernetes clusters for a GefyraClient on this machine
downRemove Gefyra locally and on the cluster
installCreate and print the Kubernetes configs for Gefyra; usage: 'gefyra install...
listList running containers
mountManage GefyraBridgeMounts for a Gefyra installation
operatorManage operator installation
rmRemove a Gefyra container and its associated bridges
run
selfManage this Gefyra executable
statusGet Gefyra's status
uninstallRemoves the Gefyra installation from the cluster
upInstall Gefyra on a cluster and directly connect to it
version

bridge

Manage your GefyraBridges to redirect traffic from a GefyraBridgeMount target

Example:

gefyra bridge create
gefyra bridge list
gefyra bridge delete my-bridge

Subcommands:

▶ bridge create

Establish a GefyraBridge from a GefyraBridgeMount in the cluster to a local container

Example:

gefyra bridge create -t mycontainer -p 8080:8080 --mount my-mount

Arguments:

ArgumentDescription
-t, --local, --targetThe name of the local container running in Gefyra (required)
-N, --nameAssign a custom name to this GefyraBridge
-p, --portsAdd forward port mapping in form of <remote_container_port>:<local_container_port> (required)
--match-header-exactMatch header exactly to forward traffic to this client. E.g.: --match-header-exact x-gefyra:peer
--match-header-regexMatch header regex expression to forward traffic to this client. E.g.: --match-header-regex x-gefyra:(.*))
--match-header-prefixMatch header value prefix (and name exactly) to forward traffic to this client. E.g.: --match-header-prefix x-gefyra:peer1,
--match-path-prefixMatch path prefix to forward traffic to this client. E.g.: --match-path-prefix myroute/
--match-path-regexMatch patch regex to forward traffic to this client. E.g.: --match-path-regex myroute/(.*)/all
--match-path-exactMatch path exactly to forward traffic to this client. E.g.: --match-path-exact /only/this
-P, --no-probe-handlingMake Carrier to not handle probes during switch operation
--mountThe target GefyraBridgeMount to install this GefyraBridge on (required)
--connection-nameDefault: default
--nowaitDo not wait for the GefyraBridgeMount to be ready
--timeoutDefault: 60

▶ bridge delete

Aliases: rm, remove

Mark a GefyraBridge for deletion

Example:

gefyra bridge delete my-bridge
gefyra bridge rm my-bridge

Positional Arguments:

ArgumentDescription
name

Arguments:

ArgumentDescription
-A, --allUnbridge all GefyraBridges with local target containers
-m, --mountUnbridge all bridges for a specific mount
--nowaitDo not wait for the GefyraBridge to be deleted.
--connection-nameDefault: default
--timeoutDefault: 60

▶ bridge inspect

Aliases: describe, show, get

Describe a GefyraBridge

Example:

gefyra bridge inspect my-bridge

Positional Arguments:

ArgumentDescription
bridge_name(required)

Arguments:

ArgumentDescription
--output, -oDefault: text
--connection-name, -cDefault: default

▶ bridge list

Aliases: ls

List all GefyraBridges with local target containers

Example:

gefyra bridge list
gefyra bridge ls

Arguments:

ArgumentDescription
-A, --allList all GefyraBridges from all GefyraClients
--connection-nameDefault: default
-o, --outputDefault: text

clients

Manage GefyraClients for a Gefyra installation

Example:

gefyra clients create
gefyra clients list
gefyra clients delete my-client

Subcommands:

▶ clients config

Aliases: write

Get a Gefyra connection config for a client

Example:

gefyra clients config -h 1.1.1.1 my-client-id

Positional Arguments:

ArgumentDescription
client_id(required)

Arguments:

ArgumentDescription
-h, --hostThe connection host
-p, --portThe connection port (default: 31820)
-a, --kube-api, --kubernetes-apiThe Kubernetes API adress for the host cluster (default: API adresse of your kubeconfig)
-o, --outputThe output file to write the config to
--registryThe registry URL for the images
--mtuThe MTU for the Wireguard interface (default: auto-detected by WireGuard)
--localWhether the target cluster is a local k8s cluster

▶ clients create

Create a new GefyraClient

Example:

gefyra clients create -n 2 # creates 2 clients

Arguments:

ArgumentDescription
--client-id, --nameThe client id/name of the GefyraClient
-nNumber of GefyraClient to be generated (not allowed with explicit --client-id/--name) (default: 1)
--registryThe registry URL for the images
--nowaitDo not wait for the GefyraClient to be ready
--timeoutTimeout in seconds for the GefyraClient to be ready (default: 60)

▶ clients delete

Aliases: rm, remove

Mark a GefyraClient for deletion

Example:

gefyra clients delete my-client-id
gefyra clients rm my-client-id
gefyra clients remove my-client-id

Positional Arguments:

ArgumentDescription
client_id(required)

Arguments:

ArgumentDescription
--nowaitDo not wait for the GefyraClient to be deleted
--timeoutTimeout in seconds for the GefyraClient to be deleted (default: 60)
--forceForce deletion of the GefyraClient

▶ clients disconnect

Aliases: deactivate, stop

Disconnect a GefyraClient

Example:

gefyra clients disconnect my-client-id

Positional Arguments:

ArgumentDescription
client_id(required)

▶ clients inspect

Aliases: describe, show, get

Describe a GefyraClient

Example:

gefyra clients inspect <client-id>
gefyra clients inspect my-client-id

Positional Arguments:

ArgumentDescription
client_id(required)

Arguments:

ArgumentDescription
-o, --outputOutput format (json, text) (default: text)

▶ clients list

Aliases: ls

List all GefyraClients

Example:

gefyra clients list
gefyra clients ls

Arguments:

ArgumentDescription
-o, --outputDefault: text

connections

Manage connections to Kubernetes clusters for a GefyraClient on this machine

Example:

gefyra connections connect -f con_file.json -n my-connection
gefyra connections list
gefyra connections disconnect my-connection

Subcommands:

▶ connections connect

Aliases: create

Connect this local machine to a Gefyra cluster

Example:

gefyra connections connect -f con_file.json -n my-connection

Arguments:

ArgumentDescription
-f, --client-config
-n, --connection-nameAssign a local name to this client connection (default: default)
--minikubeConnect Gefyra to a Minikube cluster (accepts minikube profile name, default is 'minikube'))
--mtuThe MTU (Maximum Transmission Unit) for the Wireguard interface (default: auto-detected by WireGuard)
--cargo-imageUse a custom Cargo container image
--forceForce re-connection of client, even if it is already active.
--timeoutTimeout for each connection step in seconds. (default: 60)

▶ connections disconnect

Aliases: stop, halt

Disconnect this local machine from a Gefyra cluster

Example:

gefyra connections disconnect my-connection

Positional Arguments:

ArgumentDescription
connection_name

Arguments:

ArgumentDescription
--yesNon-interactive mode, do not ask for confirmation
--nowaitDo not wait for the GefyraClient to be in state 'WAITING'
--timeoutTimeout for disconnect in seconds. (default: 60)

▶ connections inspect

Inspect a Gefyra connection

Example:

gefyra connections inspect my-connection

Positional Arguments:

ArgumentDescription
connection_name

Arguments:

ArgumentDescription
--output, -oOutput format for the connection details (default: text)

▶ connections list

Aliases: ls

List all Gefyra connections

Example:

gefyra connections list

Arguments:

ArgumentDescription
--output, -oOutput format for the connection list (default: text)

▶ connections remove

Aliases: rm

Remove a Gefyra connection

Example:

gefyra connections rm my-connection

Positional Arguments:

ArgumentDescription
connection_name

Arguments:

ArgumentDescription
--yesNon-interactive mode, do not ask for confirmation

down

Remove Gefyra locally and on the cluster

Example:

gefyra down

install

Create and print the Kubernetes configs for Gefyra; usage: 'gefyra install options | kubectl apply -f -

Example:

gefyra install

Arguments:

ArgumentDescription
--component, --compLimit config creation to this component (available: namespace,rbac,webhook,deployment,service)
--presetSet configs from a preset (available: aws,gke)
--apply
--wait
-ns, --namespaceThe namespace to install Gefyra into (default: gefyra)
--versionSet the Operator version; components are created according to this Gefyra version (default: 2.4.0)
--service-typeThe Kubernetes service for Stowaway to expose the Wireguard endpoint (default: NodePort)
--service-portThe port for Stowaway to expose the Wireguard endpoint (default: 31820)
--service-labelsAdditional Kubernetes labels for the Stowaway service (default: )
--service-annotationsKubernetes annotations for the Stowaway service (default: )
--registryThe registry URL for the images (default: quay.io/gefyra)
--mtuThe MTU for the Wireguard interface (default: auto-detected by WireGuard)
--stowaway-storageThe storage size for the Stowaway PVC in Mi (default: 64)
--max-client-connection-ageThe maximum age of a Stowaway connection in seconds (default: None)
--disable-client-sa-managementWhether to create/manage client service accounts for Gefyra (default: False)
--bridge-debugEnable debug logging for GefyraBridgeMounts/GefyraBridges (default: False)

list

List running containers

Example:

gefyra list

Arguments:

ArgumentDescription
-n, --connection-nameOnly list from this client connection name.

mount

Manage GefyraBridgeMounts for a Gefyra installation

Example:

gefyra mount create --target deploy/my-deploy/my-container
gefyra mount list
gefyra mount delete my-mount

Subcommands:

▶ mount create

Create a new GefyraBridgeMount in the cluster

Example:

gefyra mount create --target deploy/my-deploy/my-container -n default

Arguments:

ArgumentDescription
--namespaceThe GefyraBridgeMount's target namespace (default: default)
--nameAssign a custom name to this GefyraBridgeMount
--targetInstall a GefyraBridgeMount to workloads following the notion 'resource/name/container'. Resource can be one of 'deployment', 'statefulset' or 'pod'. E.g.: --target deployment/hello-nginx/nginx (required)
--tls-keyPath to key file for tls traffic (within the target container).
--tls-certificatePath to certificate file for tls traffic (within the target container).
--tls-sniSNI for tls traffic (within the target container).
--connection-name, -cDefault: default
--nowaitDo not wait for the GefyraBridgeMount to be ready
--timeoutDefault: 60

▶ mount delete

Aliases: rm, remove

Mark a GefyraBridgeMount for deletion

Example:

gefyra mount delete my-mount
gefyra mount rm my-mount

Positional Arguments:

ArgumentDescription
mount_name(required)

Arguments:

ArgumentDescription
--nowaitDo not wait for the GefyraBridgeMount to be deleted.
--connection-name, -cDefault: default
--timeoutDefault: 60

▶ mount inspect

Aliases: describe, show, get

Describe a GefyraBridgeMount

Example:

gefyra mount inspect my-mount

Positional Arguments:

ArgumentDescription
mount_name(required)

Arguments:

ArgumentDescription
-o, --outputDefault: text
--connection-nameDefault: default

▶ mount list

Aliases: ls

List all GefyraBridgeMounts

Example:

gefyra mount list
gefyra mount ls

Arguments:

ArgumentDescription
--output, -oDefault: text
--connection-nameDefault: default

operator

Manage operator installation

Example:

gefyra operator update

Subcommands:

▶ operator update

Update operator to latest or specific version.

Example:

gefyra operator update

Arguments:

ArgumentDescription
--versionSet specific version to update operator to.

rm

Remove a Gefyra container and its associated bridges

Example:

gefyra rm mycontainer

Positional Arguments:

ArgumentDescription
name

Arguments:

ArgumentDescription
-A, --allRemove all Gefyra containers and their bridges
-f, --forceForce remove containers (even if running)
--nowaitDo not wait for containers and bridges to be fully removed
--connection-nameDefault: default

run

Example:

gefyra run -i pyserver -N mypyserver -n default

Arguments:

ArgumentDescription
-d, --detachRun container in background and print container ID
--rmAutomatically remove the container when it exits
-p, --exposeAdd port mapping in form of <container_port>:<host_port>
--env-fromCopy the environment from the container in the notation 'Pod/Container'
--cpu-fromInherit CPU limit from a workload, e.g. 'pod/<name>', 'deployment/<name>' or 'statefulset/<name>'
--memory-fromInherit memory limit from a workload, e.g. 'pod/<name>', 'deployment/<name>' or 'statefulset/<name>'
--cpuCPU limit for the container (e.g. '500m' or '2')
--memoryMemory limit for the container (e.g. '512Mi', '1Gi', or '1g')
--userUsername or UID (format: `<name
-v, --volumeBind mount a volume into the container in notation src:dest, allowed multiple times
--envSet or override environment variables in the form ENV=value, allowed multiple times
-n, --namespaceThe namespace for this container to run in
-c, --commandThe command for this container to in Gefyra
-N, --nameThe name of the container running in Gefyra (required)
-i, --imageThe docker image to run in Gefyra (required)
--pullDefine whether image should always be pulled (default: missing)
--platformDefine platform for image pull. Default: linux/amd64 (default: linux/amd64)
--security-optSecurity Options (default: [])
--connection-name
--privilegedGive extended privileges to this container

self

Manage this Gefyra executable

Example:

gefyra self update
gefyra self restore

Subcommands:

  • self restore — Restore the local Gefyra client installation
  • self update — Update the local Gefyra client installation

▶ self restore

Restore the local Gefyra client installation

Example:

gefyra self restore

▶ self update

Update the local Gefyra client installation

Example:

gefyra self update

status

Get Gefyra's status

Example:

gefyra status

uninstall

Removes the Gefyra installation from the cluster

Example:

gefyra uninstall

Arguments:

ArgumentDescription
--force, -fDelete without promt

up

Install Gefyra on a cluster and directly connect to it

Example:

gefyra up

Arguments:

ArgumentDescription
--minikubeConnect Gefyra to a Minikube cluster (accepts minikube profile name, default is 'minikube'))
--presetSet configs from a preset (available: aws,gke)
--registrySet the registry to use for the Gefyra components
--mtuSet the MTU for the Gefyra network (default: auto-detected by WireGuard)

version

Example:

gefyra version

Arguments:

ArgumentDescription
-n, --no-checkDo not check whether there is a new version
Copyright © 2026