Project: Fabric8 Kubernetes Client (App Definition and Development / Application Definition & Image Build)
File: README.md

kubernetes-model-core: ](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.fabric8%20a%3Akubernetes-model-core) ](https://javadoc.io/doc/io.fabric8/kubernetes-model-core) kubernetes-model-admissionregistration: ](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.fabric8%20a%3Akubernetes-model-admissionregistration) ](https://javadoc.io/doc/io.fabric8/kubernetes-model-admissionregistration) kubernetes-model-apiextensions: ](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.fabric8%20a%3Akubernetes-model-apiextensions) ](https://javadoc.io/doc/io.fabric8/kubernetes-model-apiextensions) kubernetes-model-apps: ](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.fabric8%20a%3Akubernetes-model-apps) ](https://javadoc.io/doc/io.fabric8/kubernetes-model-apps) kubernetes-model-autoscaling: ](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.fabric8%20a%3Akubernetes-model-autoscaling) ](https://javadoc.io/doc/io.fabric8/kubernetes-model-autoscaling) kubernetes-model-batch: ](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.fabric8%20a%3Akubernetes-model-batch) ](https://javadoc.io/doc/io.fabric8/kubernetes-model-batch) kubernetes-model-certificates: ](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.fabric8%20a%3Akubernetes-model-certificates) ](https://javadoc.io/doc/io.fabric8/kubernetes-model-certificates) kubernetes-model-coordination: ](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.fabric8%20a%3Akubernetes-model-coordination) ](https://javadoc.io/doc/io.fabric8/kubernetes-model-coordination) kubernetes-model-discovery: ](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.fabric8%20a%3Akubernetes-model-discovery) ](https://javadoc.io/doc/io.fabric8/kubernetes-model-discovery) kubernetes-model-events: ](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.fabric8%20a%3Akubernetes-model-events) ](https://javadoc.io/doc/io.fabric8/kubernetes-model-events) kubernetes-model-extensions: ](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.fabric8%20a%3Akubernetes-model-extensions) ](https://javadoc.io/doc/io.fabric8/kubernetes-model-extensions) kubernetes-model-gatewayapi: ](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.fabric8%20a%3Akubernetes-model-gatewayapi) ](https://javadoc.io/doc/io.fabric8/kubernetes-model-gatewayapi) kubernetes-model-metrics: ](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.fabric8%20a%3Akubernetes-model-metrics) ](https://javadoc.io/doc/io.fabric8/kubernetes-model-metrics) kubernetes-model-networking: ](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.fabric8%20a%3Akubernetes-model-networking) ](https://javadoc.io/doc/io.fabric8/kubernetes-model-networking) kubernetes-model-policy: ](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.fabric8%20a%3Akubernetes-model-policy) ](https://javadoc.io/doc/io.fabric8/kubernetes-model-policy) kubernetes-model-rbac: ](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.fabric8%20a%3Akubernetes-model-rbac) ](https://javadoc.io/doc/io.fabric8/kubernetes-model-rbac) kubernetes-model-resource: ](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.fabric8%20a%3Akubernetes-model-resource) ](https://javadoc.io/doc/io.fabric8/kubernetes-model-resource) kubernetes-model-scheduling: ](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.fabric8%20a%3Akubernetes-model-scheduling) ](https://javadoc.io/doc/io.fabric8/kubernetes-model-scheduling) kubernetes-model-storageclass: ](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.fabric8%20a%3Akubernetes-model-storageclass) ](https://javadoc.io/doc/io.fabric8/kubernetes-model-storageclass) kubernetes-model-node: ](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.fabric8%20a%3Akubernetes-model-node) ](https://javadoc.io/doc/io.fabric8/kubernetes-model-node) openshift-model: ](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.fabric8%20a%3Aopenshift-model) ](https://javadoc.io/doc/io.fabric8/openshift-model) openshift-model-console: ](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.fabric8%20a%3Aopenshift-model-console) ](https://javadoc.io/doc/io.fabric8/openshift-model-console) openshift-model-config: ](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.fabric8%20a%3Aopenshift-model-config) ](https://javadoc.io/doc/io.fabric8/openshift-model-config) openshift-model-monitoring: ](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.fabric8%20a%3Aopenshift-model-monitoring) ](https://javadoc.io/doc/io.fabric8/openshift-model-monitoring) openshift-model-operator: ](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.fabric8%20a%3Aopenshift-model-operator) ](https://javadoc.io/doc/io.fabric8/openshift-model-operator) openshift-model-operatorhub: ](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.fabric8%20a%3Aopenshift-model-operatorhub) ](https://javadoc.io/doc/io.fabric8/openshift-model-operatorhub) openshift-model-machineconfig: ](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.fabric8%20a%3Aopenshift-model-machineconfig) ](https://javadoc.io/doc/io.fabric8/openshift-model-machineconfig) openshift-model-clusterautoscaling: ](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.fabric8%20a%3Aopenshift-model-clusterautoscaling) ](https://javadoc.io/doc/io.fabric8/openshift-model-clusterautoscaling) openshift-model-machine: ](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.fabric8%20a%3Aopenshift-model-machine) ](https://javadoc.io/doc/io.fabric8/openshift-model-machine) openshift-model-tuned: ](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.fabric8%20a%3Aopenshift-model-tuned) ](https://javadoc.io/doc/io.fabric8/openshift-model-tuned) openshift-model-whereabouts: ](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.fabric8%20a%3Aopenshift-model-whereabouts) ](https://javadoc.io/doc/io.fabric8/openshift-model-whereabouts) openshift-model-storageversionmigrator: ](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.fabric8%20a%3Aopenshift-model-storageversionmigrator) ](https://javadoc.io/doc/io.fabric8/openshift-model-storageversionmigrator) openshift-model-miscellaneous: ](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.fabric8%20a%3Aopenshift-model-miscellaneous) openshift-model-hive: ](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.fabric8%20a%3Aopenshift-model-hive) openshift-model-installer: ](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.fabric8%20a%3Aopenshift-model-installer) ](https://javadoc.io/doc/io.fabric8/openshift-model-miscellaneous) Uses to generate a JSON schema that describes one or more API resources in Kubernetes and OpenShift. Install ``` git clone https://github.com/fabric8io/kubernetes-client $GOPATH/src/github.com/fabric8io/kubernetes-client ``` Navigate into the cloned repo: ```bash $ cd $GOPATH/src/github.com/fabric8io/kubernetes-client/kubernetes-model-generator ``` Run: If you already have . You can use this script to generate model for all the modules: ```bash $ generateModel.sh ``` If you want to generate model for a single module, let's say `kubernetes-model-apps/`. You would need to go to that module and issue a `make`: ```bash $ cd kubernetes-model-apps/ $ make ``` If you don't have GoLang setup on your system. You can run this whole Go Build process in a docker container using this script: Building a Single Module(e.g. `kubernetes-model-apps` ```bash $ ./generateModelDocker.sh kubernetes-model-apps ``` Building all modules ```shell $ ./generateModelDocker.sh ``` You should now be able to view the generated schema in `kube-schema.json` You need to modify `go.mod` files. We fetch go sources from Kubernetes Github repos and make a JSON schema from it, which is then fed to jsonschema2pojo maven plugin. In order to upgrade you need to update tags/references from these repos: After modifying just run: ```bash $ ./generateModel.sh ``` If everything works well, you would have model upgraded to specified Kubernetes/Openshift models. The project contains the following "modules": This is the module that must be run first to generate the schema files that will be consumed by Java (jsonschema2pojo and after sundr.io). `cmd/generate/generate.go` contains the main entry point and the descriptor of the schema. Add new entries to the `Schema` struct and `schemagen.PackageDescriptor` to generate an entry for any additional Go structs. `pkg/schemagen` package contains the source files with the logic to generate the schema. Module that declares classes and tools to customize jsonschema2pojo generated output. Defines a `KubernetesTypeAnnotator` with the sundr.io configuration. jsonschema2pojo annotates all of the generated classes with this custom annotator that is consumed by sundr.io. This is the main project, its generated artifacts will be consumed by the rest of the kubernetes-client modules. The pom.xml file contains the necessary configuration to process the Go generated schema and build the model with jsonschema2pojo and sundr.io.