@appthrust/kubernetes-models-appthrust
v0.4.0
Published
kubernetes models for appthrust
Downloads
48
Readme
@appthrust/appthrust
appthrust models.
Installation
Install with npm.
npm install @appthrust/[email protected]
Usage
import { Project, IProject } from "@appthrust/appthrust/projects.appthrust.io/v1alpha1";
// Create a new Project
const project = new Project({
metadata: {
name: "my-project",
},
spec: {
displayName: "My Project",
description: "This is my first project",
template: "nodejs",
},
});
// Validate against JSON schema
project.validate();
// Get the raw JSON representation
const json = project.toJSON();
// Create a new instance from JSON
const anotherProject = new Project(json);
Getting CRDs from appthrust repository
If you encounter issues with the token expiring when getting CRDs, you can clone the appthrust repository and specify the relative path to the CRD files instead.
- Clone the appthrust repository:
git clone https://github.com/appthrust/appthrust.git
- In your
package.json
, update thecrd-generate.input
field to point to the cloned CRD files. For example:
"crd-generate": {
"input": [
"../../appthrust/apps/project/crds/projects.appthrust.io.yaml"
],
"output": "./gen"
}
This way, the CRDs will be read from the cloned repository instead of the token URL.
License
MIT