Guides / Access and automation

Describe a network as a diagram

You can build a network by drawing it, on the console's canvas or in a YAML file. A Diagram is infrastructure drawn as blocks with typed ports. A controller creates the objects it describes, and when you delete a block it removes that object too.

Draw it in the console

  1. Open the Canvas (the second icon in the activity bar), choose New and name the diagram.
  2. Drag blocks from the palette onto the canvas. Categories collapse.
  3. Drag from an output dot to an input dot to connect them. Ports only connect when their types match; the editor says why when they do not.
  4. Select a block to set its name and values. The name becomes the name of the object it creates.
  5. Save. Switch to Monitor to watch status LEDs and live values.

Write it as a file

This diagram makes a VPC named lan and a DNS service named names on it, with the zone set from a string block.

apiVersion: flow.etorm.com/v1alpha1
kind: Diagram
metadata: {name: net}
spec:
  blocks:
    - {id: z, type: string, name: zone, x: 40,  y: 40,  params: {value: corp.test}}
    - {id: v, type: vpc,    name: lan,  x: 330, y: 120, params: {}}
    - {id: n, type: dns,    name: names,x: 640, y: 120, params: {}}
  links:
    - {from: {block: v, port: vpc},   to: {block: n, port: vpc}}
    - {from: {block: z, port: value}, to: {block: n, port: zone}}

Export on the canvas gives you a manifest like this one, and Import loads one back.

How ports are named

A block's inputs are the resource's spec fields (cidr, publicKey, leaseSeconds). Its outputs are its status fields (ipv6Prefix, ipv6Address, macAddress). The output that refers to the object itself is named after its kind (vpc, account). Services also report address, and every resource block has phase. The full block list is on the Canvas page.

Control what a diagram changes

Read the diagram's phase, and the list of issues when it is Invalid.

kubectl ... get diagram net -o jsonpath='{.status.phase}'   # Invalid | Progressing | Ready | Failed | Paused
kubectl ... get diagram net -o jsonpath='{.status.issues}'  # why it is Invalid

Clean up

kubectl ... delete diagram net

This deletes everything the diagram built. To keep the objects, set spec.deletePolicy: Orphan first. Delete things safely has the rest of the order.

Next

Canvas lists every block with its ports. When a block does not become Ready, see Find out why something stays Pending.