Skip to content

Commit

Permalink
Also generate option tables.
Browse files Browse the repository at this point in the history
Signed-off-by: David Gageot <[email protected]>
  • Loading branch information
dgageot committed Feb 20, 2019
1 parent 100bb53 commit 73157ee
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 67 deletions.
44 changes: 10 additions & 34 deletions docs/content/en/docs/how-tos/builders/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,7 @@ of `skaffold.yaml`.

The `local` type offers the following options:

| Option | Description | Default |
|---------------|-------------|---------|
| `push` | Should images be pushed to a registry | `false` for local clusters, `true` for remote clusters. |
| `useDockerCLI`| Uses `docker` command-line interface instead of Docker Engine APIs | `false` |
| `useBuildkit` | Uses BuildKit to build Docker images | `false` |
{{< schema root="LocalBuild" >}}

The following `build` section, for example, instructs Skaffold to build a
Docker image `gcr.io/k8s-skaffold/example` with the local Docker daemon:
Expand All @@ -70,15 +66,7 @@ section of `skaffold.yaml`.

The `googleCloudBuild` type offers the following options:

| Option | Description | Default |
|---------------|-------------|---------|
| `projectId` | **Required** The ID of your Google Cloud Platform Project | |
| `diskSizeGb` | The disk size of the VM that runs the build. See [Cloud Build API Reference: Build Options](https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.builds#buildoptions) for more information | |
| `machineType` | The type of the VM that runs the build. See [Cloud Build API Reference: Build Options](https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.builds#buildoptions) for more information | |
| `timeOut` | The amount of time (in seconds) that this build should be allowed to run. See [Cloud Build API Reference: Resource/Build](https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.builds#resource-build) for more information. | |
| `dockerImage` | The name of the image that will run a docker build. See [Cloud builders](https://cloud.google.com/cloud-build/docs/cloud-builders) for more information | `gcr.io/cloud-builders/docker` |
| `gradleImage` | The name of the image that will run a gradle build. See [Cloud builders](https://cloud.google.com/cloud-build/docs/cloud-builders) for more information | `gcr.io/cloud-builders/gradle` |
| `mavenImage` | The name of the image that will run a maven build. See [Cloud builders](https://cloud.google.com/cloud-build/docs/cloud-builders) for more information | `gcr.io/cloud-builders/mvn` |
{{< schema root="GoogleCloudBuild" >}}

The following `build` section, for example, instructs Skaffold to build a
Docker image `gcr.io/k8s-skaffold/example` with Google Cloud Build:
Expand All @@ -99,13 +87,11 @@ To use Kaniko, add build type `kaniko` to the `build` section of

The `kaniko` type offers the following options:

| Option | Description | Default |
|-----------------|-------------|---------|
| `buildContext` | The Kaniko build context: `gcsBucket` or `localDir` | `localDir` |
| `pullSecret` | The path to the secret key file. See [Kaniko Documentation: Running Kaniko in a Kubernetes cluster](https://github.com/GoogleContainerTools/kaniko#running-kaniko-in-a-kubernetes-cluster) for more information | |
| `pullSecretName`| The name of the Kubernetes secret for pulling the files from the build context and pushing the final image | `kaniko-secret` |
| `namespace` | The Kubernetes namespace | Current namespace in Kubernetes configuration |
| `timeout` | The amount of time (in seconds) that this build should be allowed to run | 20 minutes (`20m`) |
{{< schema root="KanikoBuild" >}}

The `buildContext` can be either:

{{< schema root="KanikoBuildContext" >}}

The following `build` section, for example, instructs Skaffold to build a
Docker image `gcr.io/k8s-skaffold/example` with Kaniko:
Expand All @@ -129,18 +115,11 @@ to use Jib already.

The `jibMaven` type offers the following options:

| Option | Description | Default |
|-----------------|-------------|---------|
| `args` | Additional command-line arguments for Maven | |
| `profile` | The Maven build profile to use | |
| `module` | The module to be built for a multi-module project; see below | |
{{< schema root="JibMavenArtifact" >}}

The `jibGradle` type offers the following options:

| Option | Description | Default |
|-----------------|-------------|---------|
| `args` | Additional command-line arguments for Gradle | |
| `project` | The sub-project to be built for a multi-module project; see below | |
{{< schema root="JibGradleArtifact" >}}

See the [Skaffold-Jib demo project](https://github.com/GoogleContainerTools/skaffold/blob/master/examples/jib/)
for an example.
Expand Down Expand Up @@ -188,10 +167,7 @@ Bazel, `bazel` field to each artifact you specify in the

The `bazel` type offers the following options:

| Option | Description |
|-----------|-------------|
| `target` | **Required** The `bazel build` target to run |
| `args` | Additional args to pass to `bazel build` |
{{< schema root="BazelArtifact" >}}

The following `build` section, for example, instructs Skaffold to build a
Docker image `gcr.io/k8s-skaffold/example` with Bazel:
Expand Down
55 changes: 22 additions & 33 deletions docs/content/en/docs/how-tos/deployers/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ To use `kubectl`, add deploy type `kubectl` to the `deploy` section of

The `kubectl` type offers the following options:

| Option | Description | Default |
|--------|-------------|---------|
|`manifests`| A list of paths to Kubernetes Manifests | `k8s/*.yaml` |
|`remoteManifests`| A list of paths to Kubernetes Manifests in remote clusters | |
|`flags`| Additional flags to pass to `kubectl`. You can specify three types of flags: <ul> <li>`global`: flags that apply to every command.</li> <li>`apply`: flags that apply to creation commands.</li> <li>`delete`: flags that apply to deletion commands.</li><ul>| |
{{< schema root="KubectlDeploy" >}}

`flags` section offers the following options:

{{< schema root="KubectlFlags" >}}

The following `deploy` section, for example, instructs Skaffold to deploy
artifacts using `kubectl`:
Expand All @@ -60,29 +60,15 @@ artifacts using `kubectl`:
manage Kubernetes applications. Skaffold can work with Helm by calling its
command-line interface.

To use Helm with Skaffold, add deploy type `helm` to the `deploy` section
of `skaffold.yaml`. The `helm` type offers the following options:

| Option | Description |
|--------|-------------|
| `releases` | **Required** A list of Helm releases. See the table below for the schema of `releases`. |

Each release includes the following fields:

| Option | Description |
|--------|-------------|
|`name`| **Required** The name of the Helm release.|
|`chartPath`| **Required** The path to the Helm chart.|
|`valuesFilePath`| The path to the Helm `values` file.|
|`values`| A list of key-value pairs supplementing the Helm `values` file.|
|`namespace`| The Kubernetes namespace.|
|`version`| The version of the chart.|
|`setValues`| A list of key-value pairs; if present, Skaffold will sent `--set` flag to Helm CLI and append all pairs after the flag.|
|`setValueTemplates`| A list of key-value pairs; if present, Skaffold will try to parse the value part of each key-value pair using environment variables in the system, then send `--set` flag to Helm CLI and append all parsed pairs after the flag.|
|`wait`| A boolean value; if `true`, Skaffold will send `--wait` flag to Helm CLI.|
|`recreatePods`| A boolean value; if `true`, Skaffold will send `--recreate-pods` flag to Helm CLI.|
|`overrides`| A list of key-value pairs; if present, Skaffold will build a Helm `values` file that overrides the original and use it to call Helm CLI (`--f` flag).|
|`packaged`|Packages the chart (`helm package`) Includes two fields: <ul> <li>`version`: Version of the chart.</li> <li>`appVersion`: Version of the app.</li> </ul>| |`imageStrategy`|Add image configurations to the Helm `values` file. Includes one of the two following fields: <ul> <li> `fqn`: The image configuration uses the syntax `IMAGE-NAME=IMAGE-REPOSITORY:IMAGE-TAG`. </li> <li>`helm`: The image configuration uses the syntax `IMAGE-NAME.repository=IMAGE-REPOSITORY, IMAGE-NAME.tag=IMAGE-TAG`.</li> </ul> |
To use Helm with Skaffold, add deploy type `helm` to the `deploy` section of `skaffold.yaml`.

The `helm` type offers the following options:

{{< schema root="HelmDeploy" >}}

Each `release` includes the following fields:

{{< schema root="HelmRelease" >}}

The following `deploy` section, for example, instructs Skaffold to deploy
artifacts using `helm`:
Expand All @@ -96,12 +82,15 @@ developers to customize raw, template-free YAML files for multiple purposes.
Skaffold can work with `kustomize` by calling its command-line interface.

To use kustomize with Skaffold, add deploy type `kustomize` to the `deploy`
section of `skaffold.yaml`. The `kustomize` type offers the following options:
section of `skaffold.yaml`.

The `kustomize` type offers the following options:

{{< schema root="KustomizeDeploy" >}}

`flags` section offers the following options:

| Option | Description | Default |
|--------|-------------|---------|
|`path`| Path to Kustomization files | `.` (current directory) |
|`flags`| Additional flags to pass to `kubectl`. You can specify three types of flags: <ul> <li>`global`: flags that apply to every command.</li> <li>`apply`: flags that apply to creation commands.</li> <li>`delete`: flags that apply to deletion commands.</li> <ul> | |
{{< schema root="KubectlFlags" >}}

The following `deploy` section, for example, instructs Skaffold to deploy
artifacts using kustomize:
Expand Down
38 changes: 38 additions & 0 deletions docs/layouts/shortcodes/schema.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{{ $root := .Get "root" }}
{{ if not $root}}
{{ errorf "missing value for param 'root': %s" .Position }}
{{ end }}

{{ $schema := readFile "schemas/v1beta5.json" | transform.Unmarshal }}
{{ if not $schema}}
{{ errorf "missing json schema: %s" .Position }}
{{ end }}

{{ $definition := index $schema.definitions $root }}

{{ $showDefaults := false }}
{{ range $definition.properties }}
{{ if .default }}
{{ $showDefaults = true }}
{{ end }}
{{ end }}

<table>
<thead>
<tr>
<th>Option</th>
<th>Description</th>
{{ if $showDefaults }}<th>Default</th>{{ end }}
</tr>
</thead>
<tbody>
{{range $k, $v := $definition.properties}}
<tr>
<td><code>{{$k}}</code></td>
<td style="width: 100%;">{{if .required}}<strong>Required</strong> {{end}}{{.description | markdownify}}</td>
{{ if $showDefaults }}<td><code>{{ .default }}</code></td>{{ end }}
</tr>
{{end}}
</tbody>
</table>

0 comments on commit 73157ee

Please sign in to comment.