fbpixel

Networks

HakunaCloud Containers can run isolated from the internet, can expose specific ports, and can connect to each other. It is possible to configure this behaviour with HakunaCloud Networks.

Isolated containers

If no network is specified, containers run in isolated networks, the default network. Alice and Bob, two containers, can access the public internet but are not reachable from the internet and can not connect to each other

The following command create this topology:

beekube run --name alice alice 
beekube run --name alice bob 

Containers in the same network

Containers run inside a HakunaCloud network if they’re created with the --network <name> option. In this case, containers can see each other using their name.

An account can create unlimited networks, but a container can be connected to only 1 network at a time. Containers within the same network can connect to each other by specifying their names: Bob can consume aservice using alice name and service port as a connection string: alice:3722 and vice versa. Services are not exposed to the internet

The following command create this topology:

beekube network create simple-net
beekube run --name alice --network simple-net alice 
beekube run --name alice --network simple-net bob 

Publish container ports to the internet

A container can expose one or more ports over the internet using the option -p <published_port>:<container_port> when running a container. When this flag is present, HakunaCloud attaches a public IPv4 address to the container, and creates a FQDN DNS record that points to it.

With this topology, Alice and Bob can connect each other using the container name, and the web_server running on Bob is exposed to the internet on the port 8080.

The following command create this topology:

beekube network create simple-net
beekube run --name alice --network simple-net alice 
beekube run --name alice --network simple-net -p 8080:80 bob

The containers dns name is listed in

beekube ps

Create And Manage Networks

Create a network

A network is identified by its name, and must be unique

beekube network create <name>

List netowrks

beekube network ls

Delete a network

beekube network rm <name>