Kubernetes
The Kubernetes lexicon provides typed constructors for Kubernetes resource manifests. It covers Deployments, Services, ConfigMaps, StatefulSets, Jobs, Ingress, RBAC, and 147 resources and 50 property types.
New? Start with the Getting Started guide.
Install it with:
npm install --save-dev @intentius/chant-lexicon-k8sQuick Start
Section titled “Quick Start”import { Deployment, Service, Container, Probe } from "@intentius/chant-lexicon-k8s";
export const deployment = new Deployment({ metadata: { name: "my-app", labels: { "app.kubernetes.io/name": "my-app" } }, spec: { replicas: 2, selector: { matchLabels: { "app.kubernetes.io/name": "my-app" } }, template: { metadata: { labels: { "app.kubernetes.io/name": "my-app" } }, spec: { containers: [ new Container({ name: "app", image: "my-app:1.0", ports: [{ containerPort: 8080, name: "http" }], livenessProbe: new Probe({ httpGet: { path: "/healthz", port: 8080 } }), readinessProbe: new Probe({ httpGet: { path: "/readyz", port: 8080 } }), }), ], }, }, },});
export const service = new Service({ metadata: { name: "my-app" }, spec: { selector: { "app.kubernetes.io/name": "my-app" }, ports: [{ port: 80, targetPort: 8080, name: "http" }], },});The lexicon provides 147 resource types (Deployment, Service, ConfigMap, StatefulSet, and more), 50 property types (Container, Probe, Volume, SecurityContext, etc.), and composites (WebApp, StatefulApp, CronWorkload, AutoscaledService, WorkerPool, NamespaceEnv, NodeAgent) for common patterns.
At a Glance
Section titled “At a Glance”| Metric | Count |
|---|---|
| Resources | 147 |
| Property types | 50 |
| Services | 21 |
| Intrinsic functions | 0 |
| Pseudo-parameters | 0 |
| Lint rules | 26 |
Lexicon version: 0.0.22
Namespace: K8s