https://github.com/konfjs/k8skonf
Kubernetes in Typescript. Like CDK8s / Helm but simpler.
https://github.com/konfjs/k8skonf
cdk cdk8s helm kubernetes
Last synced: about 2 months ago
JSON representation
Kubernetes in Typescript. Like CDK8s / Helm but simpler.
- Host: GitHub
- URL: https://github.com/konfjs/k8skonf
- Owner: konfjs
- License: mpl-2.0
- Created: 2024-11-29T06:34:50.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-12-19T05:26:37.000Z (10 months ago)
- Last Synced: 2024-12-19T06:26:41.913Z (10 months ago)
- Topics: cdk, cdk8s, helm, kubernetes
- Language: TypeScript
- Homepage:
- Size: 1.2 MB
- Stars: 14
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# k8skonf
Kubernetes in Typescript. Like CDK8s / Helm but simpler.
## Usage
Source
```ts
import { K8sApp } from '@k8skonf/core';
import { Deploymentv1 } from '@k8skonf/core/Deploymentv1';const app = new K8sApp('my-k8s-app');
new Deploymentv1(app, 'my-nginx-deployment', {
spec: {
selector: {
matchLabels: {
app: 'nginx',
},
},
template: {
metadata: {
labels: {
app: 'nginx',
},
},
spec: {
containers: [
{
name: 'nginx',
image: 'nginx:alpine',
ports: [
{
containerPort: 80,
name: 'http',
},
],
},
],
},
},
},
});app.save();
```Output
```yaml
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-nginx-deployment
spec:
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:alpine
ports:
- containerPort: 80
name: http
```## CRDs
Usage:
```sh
npx @k8skonf/cli "https://raw.githubusercontent.com/argoproj/argo-cd/refs/tags/v2.13.2/manifests/crds/appproject-crd.yaml"
```