Giter Club home page Giter Club logo

k8s-api-docgen's Introduction

Kubernetes API documentation generator

k8s-api-docgen is a tool that reads Go source files to extract metadata about Kubernetes API custom resources defined by the developer in Godoc and to produce different kinds of output - such as JSON or Markdown.

Its main use case is to automatically generate documentation in Markdown format to be used within a CI/CD pipeline of a software written in Go for Kubernetes, such as an operator.

Requirements

To compile this software you need:

  • a working Go compiler;

  • a make installation (the one in MacOSX and the GNU ones are known to be working correctly).

The code has been tested on MacOS X and Linux, but should resonably work in other platforms too.

How to compile the code

Just use the Makefile:

$ make
[...]

Usage instructions

The tool needs to have access to the Go source files for your Kubernetes API. These are the files that will also be used by controller-gen to generate the CRD.

Supposing these files are reachable at ../operator/api/v1 you can extract the documentation in JSON format via:

$ ./bin/k8s-api-docgen ../operator/api/v1/*types.go

The JSON stream will be written to standard output. Should you desire to create a file, you can use the -o option as follows:

$ ./bin/k8s-api-docgen -o documentation.json ../operator/api/v1/*types.go

Using the -t option with md value, you can also extract the documentation in Markdown format via:

$ ./bin/k8s-api-docgen -t md -o documentation.md ../operator/api/v1/*types.go

If you provide a -c option, you could specify your custom configuration file in YAML format via

$ ./bin/k8s-api-docgen -t md -c md-configuration.yaml -o documentation.md ../operator/api/v1/*types.go

This option is useful for linking K8s documentation to types and customizing table headers.

Copyright

k8s-api-docgen is distributed under Apache License 2.0. Copyright (C) 2021 EnterpriseDB Corporation. Some portions Copyright 2016 The prometheus-operator Authors.

k8s-api-docgen's People

Contributors

gabriele-wolfox avatar gbartolini avatar leonardoce avatar litaocdl avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

k8s-api-docgen's Issues

Open API 3 JSON

On the EDB docs, we have a proof of concept that takes an Open API 2 spec and generates a doc page. We're looking at consuming Open API 3 spec for the actual implementation (PEM has Open API 3 specs availible). The current JSON output doesn't conform to either spec. Would it be reasonable to generate an Open API 3 JSON file in addition to the current output?

OpenAPI 3 Spec

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.