tommy351 / kubernetes-models-ts

Kubernetes models in TypeScript.
https://www.npmjs.com/package/kubernetes-models
MIT License
133 stars 34 forks source link

Organization #9

Open mtiller opened 4 years ago

mtiller commented 4 years ago

This is a very cool idea. Converting all the open API stuff into TypeScript definitions is very cool. But I'm wondering how this is meant to be organized. I can see, for example, that Deployment can be imported from kubernetes-models/apps/v1 and Service can be imported from kubernetes-models/v1. But what about Ingress? It seems you have to import that from kubernetes-models/_definitions/IoK8sApiExtensionsV1beta1Ingress. That's not so easy to find. Was there a reason that Ingress wasn't included in an easier to access package?

tommy351 commented 4 years ago

You can access all official resources using kubernetes-models/<apiVersion>/<kind>. Here's the example of importing Ingress class.

import { Ingress } from 'kubernetes-models/networking.k8s.io/v1beta1';
import { Ingress } from 'kubernetes-models/networking.k8s.io/v1beta1/Ingress';
jerolimov commented 9 months ago

This ticket can be closed or do you think we should document these two patterns in the README after the Pod example?

What do you think about creating a package @kubernetes-models/core?