Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

@kubernetes-models/smi

Service Mesh Interface (SMI) models.

Installation

Install with npm.

npm install @kubernetes-models/smi

Usage

import { TrafficSplit } from "@kubernetes-models/smi/split.smi-spec.io/v1alpha4/TrafficSplit";

// Create a new TrafficSplit
const split = new TrafficSplit({
  metadata: { name: "example" },
  spec: {
    service: "example",
    backends: [
      { service: "example-v1", weight: 90 },
      { service: "example-v2", weight: 10 }
    ]
  }
});

// Validate against JSON schema
split.validate();

License

MIT