Knative models.
Install with npm.
npm install @kubernetes-models/knative
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();
MIT