Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create documentation for bundles docs #3804

Merged
merged 5 commits into from
Apr 29, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 40 additions & 13 deletions docs/helm-broker/docs/03-01-create-bundles.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,24 @@ Bundles which the Helm Broker uses must have a specific structure. These are all

```
sample-bundle/
├── meta.yaml # [REQUIRED] A file which contains metadata information about this bundle
├── chart/ # [REQUIRED] A directory which contains a Helm chart that installs your Kubernetes resources
│ └── {chart-name}/ # [REQUIRED] A Helm chart directory
│ └── .... # [REQUIRED] Helm chart files
└── plans/ # [REQUIRED] A directory which contains the possible plans for an installed chart
├── example-enterprise # [REQUIRED] A directory which contains files for a specific plan
│ ├── meta.yaml # [REQUIRED] A file which contains metadata information about this plan
│ ├── bind.yaml # A file which contains information required to bind this plan
│ ├── create-instance-schema.json # JSON schema definitions for creating a ServiceInstance
│ ├── bind-instance-schema.json # JSON schema definitions for binding a ServiceInstance
│ ├── update-instance-schema.json # JSON schema definitions for updating a ServiceInstance
│ └── values.yaml # Default configuration values in this plan for a chart defined in the `chart` directory
└── ....
├── meta.yaml # [REQUIRED] A file which contains metadata information about this bundle
├── chart/ # [REQUIRED] A directory which contains a Helm chart that installs your Kubernetes resources
│ └── {chart-name}/ # [REQUIRED] A Helm chart directory
│ └── .... # [REQUIRED] Helm chart files
├── plans/ # [REQUIRED] A directory which contains the possible plans for an installed chart
│ ├── example-enterprise # [REQUIRED] A directory which contains files for a specific plan
│ │ ├── meta.yaml # [REQUIRED] A file which contains metadata information about this plan
│ │ ├── bind.yaml # A file which contains information required to bind this plan
│ │ ├── create-instance-schema.json # JSON schema definitions for creating a ServiceInstance
│ │ ├── bind-instance-schema.json # JSON schema definitions for binding a ServiceInstance
│ │ ├── update-instance-schema.json # JSON schema definitions for updating a ServiceInstance
│ │ └── values.yaml # Default configuration values in this plan for a chart defined in the `chart` directory
│ └── ....
└── docs/ # A directory which contains a documentation for this bundle
polskikiel marked this conversation as resolved.
Show resolved Hide resolved
├── meta.yaml # A file which contains metadata information about documentation for this bundle
├── {assets} # Files with documentation and assets
└── ....
```

> **NOTE:** All file names in a bundle repository are case-sensitive.
Expand Down Expand Up @@ -85,6 +90,28 @@ The `plans` directory must contain at least one plan. Each plan must contain the

>**NOTE:** For more information about schemas, see [this](https://github.com/openservicebrokerapi/servicebroker/blob/master/spec.md#schemas-object) specification.

## docs directory

In the `docs` directory we specify documentation for the bundle and for the wrapped Helm Chart. You can define a `meta.yaml` file inside the `docs` folder which holds the information on how documentation for a bundle should be uploaded.
polskikiel marked this conversation as resolved.
Show resolved Hide resolved
Currently we provide the documentation for bundle using the ClusterDocsTopics because in Kyma the Helm Broker is installed as a ClusterServiceBroker.
polskikiel marked this conversation as resolved.
Show resolved Hide resolved
If the `docs/meta.yaml` is specified the Helm Broker tries to create the ClusterDocsTopic for this bundle. Below you can see the example structure of the `meta.yaml` file.
polskikiel marked this conversation as resolved.
Show resolved Hide resolved
```
docs:
- template: # template describes the ClusterDocsTopic that will be created.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we provided an example, but where I can learn more information about which fields I can provide?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a sentence about this below the example

polskikiel marked this conversation as resolved.
Show resolved Hide resolved
displayName: "Doc for redis bundle"
polskikiel marked this conversation as resolved.
Show resolved Hide resolved
description: "Overall documentation"
sources: # list of files to upload as a Asset
polskikiel marked this conversation as resolved.
Show resolved Hide resolved
- type: markdown
name: markdown-files # must be unique within sources
polskikiel marked this conversation as resolved.
Show resolved Hide resolved
mode: package # defines that file under below
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed xD

url: abc.pl # if not provided then Helm broker will inject the full repository URL for this bundle
polskikiel marked this conversation as resolved.
Show resolved Hide resolved
filter: /docs/bundles
```
For more information about the fields you can provide and ClusterDocsTopics see the following [file](https://kyma-project.io/docs/components/headless-cms/#custom-resource-clusterdocstopic).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this sentence and provide the link to the CLuterDocsTopics in a place when you mention it for the first time.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

For now, we support only one entry in the `docs` array.
polskikiel marked this conversation as resolved.
Show resolved Hide resolved

The Helm Broker can provision a broker which provides its own ServiceClasses. You can see how to provide a documentation for them in the following [document](./03-04-bundles-docs.md).
polskikiel marked this conversation as resolved.
Show resolved Hide resolved

## Troubleshooting

Use the dry run mode to check the generated manifests of the chart without installing it.
Expand Down
39 changes: 39 additions & 0 deletions docs/helm-broker/docs/03-04-bundles-docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: Bundles docs
polskikiel marked this conversation as resolved.
Show resolved Hide resolved
type: Details
---

## Documentation for ServiceClasses provided by bundle
polskikiel marked this conversation as resolved.
Show resolved Hide resolved

The Helm Broker in the provisioning process pushes the `addonRepositoryURL` variable into installed chart. With this feature a bundle which provides its own ServiceClasses e.g. `Azure Broker` can also install a documentation for them.
polskikiel marked this conversation as resolved.
Show resolved Hide resolved

If the bundle provides ServiceClasses and you want to have a documentation for it, you should create a `docs.yaml` inside the bundle's chart with the following structure:
polskikiel marked this conversation as resolved.
Show resolved Hide resolved
```
apiVersion: cms.kyma-project.io/v1alpha1
kind: ClusterDocsTopic
metadata:
labels:
cms.kyma-project.io/view-context: service-catalog
name: {ServiceClass ID}
spec:
displayName: "Slack Connector Add-on"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use placeholder rather than examples?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@klaudiagrz What do you think?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, I'd go with placeholders as well. @polskikiel please apply this suggestion.

description: "Overall documentation, OpenAPI and AsyncAPI for Slack Connector Add-on"
sources:
- type: {type}
name: {name} # must be unique within sources
polskikiel marked this conversation as resolved.
Show resolved Hide resolved
mode: {mode}
url: {.Values.addonsRepositoryURL}
filter: docs/{class_name}/ # provide filter only if you use the package mode
polskikiel marked this conversation as resolved.
Show resolved Hide resolved
___
apiVersion: cms.kyma-project.io/v1alpha1
kind: ClusterDocsTopic
metadata ...
```

polskikiel marked this conversation as resolved.
Show resolved Hide resolved
One ClusterDocsTopic object corresponds to a single ServiceClass with the same ID as the name of specified ClusterDocsTopic.
polskikiel marked this conversation as resolved.
Show resolved Hide resolved

You should hold the ClusterDocsTopics definitions for a given broker in one file.
polskikiel marked this conversation as resolved.
Show resolved Hide resolved

If you want to provide documentation for every class provided by the broker you must also provide the ClusterDocsTopics for all of them.
polskikiel marked this conversation as resolved.
Show resolved Hide resolved

The documentation for the ServiceClasses provided by a bundle should be stored in the `docs/{class_name}` folder.
polskikiel marked this conversation as resolved.
Show resolved Hide resolved