Skip to content

Latest commit

 

History

History

knative

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

@kubernetes-models/knative

Knative models.

Installation

Install with npm.

npm install @kubernetes-models/knative

Usage

import { Service } from "@kubernetes-models/knative/serving.knative.dev/v1/Service";

// Create a service
const service = new Service({
  metadata: { name: "hello" },
  spec: {
    template: {
      metadata: { name: "hello-world" },
      spec: {
        containers: [
          {
            image: "gcr.io/knative-samples/helloworld-go",
            ports: [{ containerPort: 8080 }]
          }
        ]
      }
    }
  }
});

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

License

MIT