kubernetes-typescript-openapi

Implementation of TypeScript generated from Kubernetes OpenAPI

MIT License

Downloads
226
Stars
3
Committers
2

Bot releases are hidden (Show)

kubernetes-typescript-openapi - @himenon/[email protected]

Published by Himenon 9 months ago

kubernetes-typescript-openapi - @himenon/[email protected]

Published by Himenon about 2 years ago

kubernetes-typescript-openapi -

Published by Himenon over 2 years ago

kubernetes-typescript-openapi -

Published by Himenon over 2 years ago

kubernetes-typescript-openapi -

Published by Himenon almost 3 years ago

kubernetes-typescript-openapi -

Published by Himenon almost 3 years ago

Bug Fixes

  • #4
kubernetes-typescript-openapi -

Published by Himenon almost 3 years ago

Features

  • Add Comment #3
kubernetes-typescript-openapi -

Published by Himenon almost 3 years ago

Bug Fix

  • #2
kubernetes-typescript-openapi -

Published by Himenon almost 3 years ago

Try Code !

import * as fs from "fs";
import * as yaml from "js-yaml"; // yarn add js-yaml @types/js-yaml
import type { Schemas } from "@himenon/kubernetes-typescript-openapi/v1.22.3";

const podTemplateSpec: Schemas.io$k8s$api$core$v1$PodTemplateSpec = {
  metadata: {
    labels: {
      app: "nginx",
    },
  },
  spec: {
    containers: [
      {
        name: "nginx",
        image: "nginx:1.14.2",
        ports: [
          {
            containerPort: 80,
          },
        ],
      },
    ],
  },
};

const deployment: Schemas.io$k8s$api$apps$v1$Deployment = {
  apiVersion: "apps/v1",
  kind: "Deployment",
  metadata: {
    name: "nginx-deployment",
    labels: {
      app: "nginx",
    },
  },
  spec: {
    replicas: 3,
    selector: {
      matchLabels: {
        app: "nginx",
      },
    },
    template: podTemplateSpec,
  },
};

const text = yaml.dump(deployment, { noRefs: true, lineWidth: 144 });
fs.writeFileSync("deployment.yml", text, "utf-8");
Package Rankings
Top 13.38% on Npmjs.org
Related Projects