norwoodj / helm-docs

A tool for automatically generating markdown documentation for helm charts
GNU General Public License v3.0
1.38k stars 184 forks source link

[Feature Request] Support pulling details directly from kubernetes specs #129

Open cornfeedhobo opened 2 years ago

cornfeedhobo commented 2 years ago

I'm finding myself doing stuff like

# -- NodeSelector is a selector which must be true for the pod to fit on a node.
# Selector which must match a node's labels for the pod to be scheduled on that node.
# More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
nodeSelector: {}

This is a direct copy from the StatefulSet API docs, and I have a number of other fields that are the same.

I think it would be neat to have references that get resolved at generation time.

norwoodj commented 2 years ago

I'm not sure what you mean by this exactly. Are you proposing this information gets pulled from the page you've linked? Sounds hard

cornfeedhobo commented 2 years ago

@norwoodj yeah, that's essentially what I'm suggesting - a way to say "copy the text from the official spec", which I would hope is available somewhere as markdown that is structured and can be parsed.

Nepo26 commented 1 year ago

I think a way to better handle this would be creating a way to add code in the process. Maybe a plugin interface or similar. We need to discuss this feature more to make it more straightforward.

cornfeedhobo commented 9 months ago

In case this ever gets done, I propose a simple interface:

statefulset:
  # -- ``statefulset.spec.podManagementPolicy``
  podManagementPolicy: ""

Then the documentation generator could pull the description from somewhere like the k8s documentation website, and link to it.

Edit: there is probably a git repo with these descriptions in a structured format, which might make it so this entire thing could be done offline.