Skip to main content

Overview

The Network custom resource defines network infrastructure for your workloads. Networks provide isolated layer-3 connectivity for resources within a project.
Network resources are part of the Milo networking API group (networking.miloapis.com/v1alpha1).

Resource Definition

apiVersion: networking.miloapis.com/v1alpha1
kind: Network
metadata:
  name: my-network
  namespace: project-<project-name>
spec:
  # Network specification fields

API Group

apiVersion
string
required
networking.miloapis.com/v1alpha1
kind
string
required
Network

Metadata

metadata.name
string
required
The name of the network. Must be unique within the namespace.
metadata.namespace
string
required
The project namespace where this network is created. Format: project-<project-name>
metadata.labels
object
Optional labels to organize and select networks.Common labels:
  • app.kubernetes.io/name: Application name
  • app.kubernetes.io/component: Component type
  • environment: Environment (dev, staging, prod)
metadata.annotations
object
Optional annotations for additional metadata.Standard annotations:
  • kubernetes.io/description: Human-readable description
  • kubernetes.io/display-name: Display name for UIs

Spec Fields

The Network spec defines the desired network configuration:
spec.ipv4Cidr
string
The IPv4 CIDR block for this network.Example: 10.0.0.0/16
spec.ipv6Cidr
string
The IPv6 CIDR block for this network (optional).Example: fd00::/64
spec.provider
object
Provider-specific configuration for the network backend.

Status Fields

The Network status reflects the current state of the network:
status.phase
string
The current phase of the network.Values:
  • Pending: Network creation is pending
  • Provisioning: Network is being created
  • Ready: Network is ready for use
  • Failed: Network creation failed
  • Deleting: Network is being deleted
status.conditions
array
Detailed conditions about the network state.Each condition includes:
  • type: Condition type (e.g., “Ready”)
  • status: True, False, or Unknown
  • reason: Machine-readable reason code
  • message: Human-readable message
  • lastTransitionTime: When the condition last changed
status.providerStatus
object
Provider-specific status information (e.g., VPC ID, subnet IDs).

Examples

Basic Network

apiVersion: networking.miloapis.com/v1alpha1
kind: Network
metadata:
  name: dev-network
  namespace: project-myproject
  annotations:
    kubernetes.io/description: "Development environment network"
spec:
  ipv4Cidr: 10.0.0.0/16

GCP VPC Network

apiVersion: networking.miloapis.com/v1alpha1
kind: Network
metadata:
  name: prod-network
  namespace: project-production
  labels:
    environment: production
    app.kubernetes.io/name: datum-app
spec:
  ipv4Cidr: 10.1.0.0/16
  provider:
    gcp:
      projectId: my-gcp-project
      region: us-central1
      autoCreateSubnetworks: false

Dual-stack Network

apiVersion: networking.miloapis.com/v1alpha1
kind: Network
metadata:
  name: dual-stack-network
  namespace: project-myproject
spec:
  ipv4Cidr: 10.2.0.0/16
  ipv6Cidr: fd00::/64

kubectl Commands

Create a Network

kubectl apply -f network.yaml

List Networks

# List all networks in a project
kubectl get networks -n project-myproject

# List networks across all projects
kubectl get networks --all-namespaces

# List with custom columns
kubectl get networks -n project-myproject \
  -o custom-columns=NAME:.metadata.name,CIDR:.spec.ipv4Cidr,PHASE:.status.phase

Get Network Details

# Get full network specification
kubectl get network my-network -n project-myproject -o yaml

# Get network status
kubectl get network my-network -n project-myproject -o jsonpath='{.status}'

Update a Network

# Edit network in your editor
kubectl edit network my-network -n project-myproject

# Apply changes from file
kubectl apply -f network.yaml

Delete a Network

kubectl delete network my-network -n project-myproject

Watch Network Status

kubectl get network my-network -n project-myproject --watch
  • Workload - Deploy workloads to networks
  • Gateway - Expose services via gateways
  • Project - Networks are scoped to projects

Troubleshooting

Check:
  1. View network status: kubectl describe network <name> -n <namespace>
  2. Check for error conditions in status.conditions
  3. Verify provider credentials are configured
  4. Check quota limits in your cloud provider
Check:
  1. Verify network is in Ready phase
  2. Ensure workload namespace matches network namespace
  3. Check network RBAC permissions

Build docs developers (and LLMs) love