Skip to content

Commit

Permalink
Merge pull request GoogleContainerTools#3365 from dgageot/adoc-to-md
Browse files Browse the repository at this point in the history
Convert Asciidoc to simpler markdown
  • Loading branch information
nkubala authored Dec 13, 2019
2 parents 015aa1c + d527c40 commit e19fc19
Show file tree
Hide file tree
Showing 70 changed files with 474 additions and 988 deletions.
42 changes: 0 additions & 42 deletions examples/bazel/README.adoc

This file was deleted.

18 changes: 18 additions & 0 deletions examples/bazel/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
### Example: bazel

Bazel is one of the supported builders in Skaffold.

The way you configure it in `skaffold.yaml` is the following build stanza:

```yaml
build:
artifacts:
- image: gcr.io/k8s-skaffold/skaffold-example
context: .
bazel:
target: //:skaffold_example.tar
```
1. make sure the `context` contains the bazel files (`WORKSPACE`, `BUILD`)
2. add `bazel` section to each artifact
3. specify `target` - our builder will use this to load to the image to the Docker daemon
7 changes: 7 additions & 0 deletions examples/buildpacks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### Example: kaniko

This is an example demonstrating:

* **building** a single Go file app built with [Cloud Native Buildpacks](https://buildpacks.io/)
* **tagging** using the default tagPolicy (`gitCommit`)
* **deploying** a single container pod using `kubectl`
10 changes: 0 additions & 10 deletions examples/compose/README.adoc

This file was deleted.

15 changes: 15 additions & 0 deletions examples/compose/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
### Example: running Skaffold with docker-compose files

This example provides a simple application set up to run with
[Docker Compose](https://docs.docker.com/compose/).

Notice there is no `skaffold.yaml` configuration present.
To run this example, use:

```bash
skaffold init --compose-file docker-compose.yaml
```

1. This will invoke the [kompose](https://github.com/kubernetes/kompose) binary to generate
kubernetes manifests based off of the Docker Compose configuration.
2. This will generate the `skaffold.yaml` configuration.
51 changes: 17 additions & 34 deletions examples/custom/README.adoc → examples/custom/README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
=== Example: Getting started with buildpacks
:icons: font
### Example: use the custom builder with Cloud Native Buildpacks

This is a simple example based on
This example shows how the custom builder can be used to
build artifacts with Cloud Native Buildpacks.

* *building* a single go file app with buildpacks
* *tagging* using the default tagPolicy (`gitCommit`)
* *deploying* a single container pod using `kubectl`
* **building** a single Go file app with buildpacks
* **tagging** using the default tagPolicy (`gitCommit`)
* **deploying** a single container pod using `kubectl`

## Before you begin
#### Before you begin

For this tutorial to work, you will need to have Skaffold and a Kubernetes cluster set up.
To learn more about how to set up Skaffold and a Kubernetes cluster, see the https://skaffold.dev/docs/getting-started[getting started docs].
To learn more about how to set up Skaffold and a Kubernetes cluster, see the [getting started docs](https://skaffold.dev/docs/getting-started).

To use buildpacks with Skaffold, please install the following additional tools:

* https://buildpacks.io/docs/install-pack/[pack]
* https://docs.docker.com/install/[docker]
* [pack](https://buildpacks.io/docs/install-pack/)
* [docker](https://docs.docker.com/install/)

## Tutorial
#### Tutorial

This tutorial will demonstrate how Skaffold can build a simple Hello World Go application with buildpacks and deploy it to a Kubernetes cluster.

First, clone the Skaffold https://github.com/GoogleContainerTools/skaffold[repo] and navigate to the https://github.com/GoogleContainerTools/skaffold/tree/master/examples/buildpacks[buildpacks example] for sample code:
First, clone the Skaffold [repo](https://github.com/GoogleContainerTools/skaffold) and navigate to the [buildpacks example](https://github.com/GoogleContainerTools/skaffold/tree/master/examples/buildpacks) for sample code:

```shell
$ git clone https://github.com/GoogleContainerTools/skaffold
Expand Down Expand Up @@ -54,7 +54,8 @@ build:
custom:
buildCommand: ./build.sh
```
For more information about how this works, see the Skaffold custom builder https://skaffold.dev/docs/how-tos/builders/#custom-build-script-run-locally[documentation].
For more information about how this works, see the Skaffold custom builder [documentation](https://skaffold.dev/docs/how-tos/builders/#custom-build-script-run-locally).
Now, use Skaffold to deploy this application to your Kubernetes cluster:
Expand All @@ -63,30 +64,12 @@ $ skaffold run --tail --default-repo <your repo>
```

With this command, Skaffold will build the `skaffold-example` artifact with buildpacks and deploy the application to Kubernetes.
You should be able to see "Hello, World!" printed every second in the Skaffold logs.
You should be able to see *Hello, World!* printed every second in the Skaffold logs.

#### Cleanup

To clean up your Kubernetes cluster, run:

```shell
$ skaffold delete
```

ifndef::env-github[]
==== link:{github-repo-tree}/examples/buildpacks[Example files icon:github[]]

[source,yaml, indent=3, title=skaffold.yaml]
----
include::skaffold.yaml[]
----

[source,go, indent=3, title=main.go, syntax=go]
----
include::main.go[]
----

[source,yaml, indent=3, title=k8s-pod.yaml]
----
include::k8s-pod.yaml[]
----

endif::[]
33 changes: 0 additions & 33 deletions examples/gcb-kaniko/README.adoc

This file was deleted.

7 changes: 7 additions & 0 deletions examples/gcb-kaniko/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### Example: Getting started with a simple go app

This is a simple example based on:

* **building** a single Go file app and with a multistage `Dockerfile` using [kaniko](https://github.com/GoogleContainerTools/kaniko) in Google Cloud Build
* **tagging** using the default tagPolicy (`gitCommit`)
* **deploying** a single container pod using `kubectl`
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
=== Example: Getting started with skaffold and CI/CD using Tekton
:icons: font
### Example: Getting started with skaffold and CI/CD using Tekton

This is a simple example to show users how to run the generate-pipeline command

_Please keep in mind that the generate-pipeline command is still a WIP_

Prerequisites:

* Install tekton on your cluster (https://github.com/tektoncd/pipeline/blob/master/docs/install.md)
* Have kaniko secrets setup (https://github.com/GoogleContainerTools/kaniko)
* Install [tekton](https://github.com/tektoncd/pipeline/blob/master/docs/install.md) on your cluster
* Have [kaniko](https://github.com/GoogleContainerTools/kaniko) secrets setup
* Container registry must be public
* Give your default service account the cluster-admin role (necessary to have pipeline access secrets)
----

```shell
kubectl create clusterrolebinding serviceaccounts-cluster-admin \
--clusterrole=cluster-admin \
--user=system:serviceaccount:default:default
----
```

To generate and run a pipeline:

Expand Down
33 changes: 0 additions & 33 deletions examples/getting-started/README.adoc

This file was deleted.

7 changes: 7 additions & 0 deletions examples/getting-started/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### Example: Getting started with a simple go app

This is a simple example based on:

* **building** a single Go file app and with a multistage `Dockerfile` using local docker to build
* **tagging** using the default tagPolicy (`gitCommit`)
* **deploying** a single container pod using `kubectl`
33 changes: 0 additions & 33 deletions examples/google-cloud-build/README.adoc

This file was deleted.

7 changes: 7 additions & 0 deletions examples/google-cloud-build/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### Example: Getting started with a simple go app

This is a simple example based on:

* **building** a single Go file app and with a multistage `Dockerfile` using Google Cloud Build
* **tagging** using the default tagPolicy (`gitCommit`)
* **deploying** a single container pod using `kubectl`
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
=== Example: helm-dependencies
:icons: font
### Example: deploy helm charts with local dependencies

==== Deploy helm charts with local dependencies

This example follows the link:{github-repo-tree}/examples/helm-deployment-dependencies[helm] example, but with a local chart as a depenency.
This example follows the [helm](../helm-deployment) example, but with a local chart as a dependency.

The `skipBuildDependencies` option is used to skip the `helm dep build` command. This must be disabled for charts with local dependencies.

The image can be passed to the subchart using the standard Helm format of `subchart-name.value`.

```
```yaml
deploy:
helm:
releases:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,22 @@
=== Example: helm
:icons: font

ifndef::env-github[]
link:{github-repo-tree}/examples/helm-deployment[see on Github icon:github[]]
endif::[]

==== Deploy multiple releases with Helm
### Example: deploy multiple releases with Helm

You can deploy multiple releases with skaffold, each will need a chartPath, a values file, and namespace.
Skaffold can inject intermediate build tags in the the values map in the skaffold.yaml.

Let's walk through the skaffold yaml
Let's walk through the skaffold yaml:

We'll be building an image called `skaffold-helm`, and its a dockerfile, so we'll add it to the artifacts.
```

```yaml
build:
artifacts:
- image: skaffold-helm
```
Now, we want to deploy this image with helm.
We add a new release in the helm part of the deploy stanza.
```
```yaml
deploy:
helm:
releases:
Expand All @@ -35,7 +30,8 @@ deploy:
```
This part tells skaffold to set the `image` parameter of the values file to the built skaffold-helm image and tag.
```

```yaml
values:
image: skaffold-helm
```
Loading

0 comments on commit e19fc19

Please sign in to comment.