Fix ordering in github-events function deploy (#361)

* Fix ordering in github-events function deploy

In this sample app we ask the user to deploy the application
(function.yaml) before creating the githubsecret. This causes the deploy
to fail with a configerror because it references a secret which doesnt
exist.

* remove typo
This commit is contained in:
Gregory Haynes 2018-09-06 16:24:35 -07:00 committed by RichieEscarez
parent 7fd1c98a74
commit 0a3db66e16
1 changed files with 37 additions and 36 deletions

View File

@ -57,42 +57,6 @@ kubectl apply -f auth.yaml
## Building and deploying the sample ## Building and deploying the sample
1. Use Docker to build the sample code into a container. To build and push with
Docker Hub, run the following commands, replacing `{username}` with your
Docker Hub username:
```shell
# Build the container on your local machine
# Note: The relative path points to the _root_ of the `knative/docs` repo
docker build -t {username}/github-events --file=Dockerfile ../../../
# Push the container to docker registry
docker push {username}/github-events
```
1. After the build has completed and the container is pushed to Docker Hub, you
can deploy the function into your cluster. **Ensure that the container image
value in `function.yaml` matches the container you built in the previous
step.** Apply the configuration using `kubectl`:
```shell
kubectl apply -f function.yaml
```
1. Check that your service is running using:
```shell
kubectl get ksvc -o "custom-columns=NAME:.metadata.name,READY:.status.conditions[2].status,REASON:.status.conditions[2].message"
NAME READY REASON
legit True <none>
```
> Note: `ksvc` is an alias for `services.serving.knative.dev`. If you have
an older version (version 0.1.0) of Knative installed, you'll need to use
the long name until you upgrade to version 0.1.1 or higher. See
[Checking Knative Installation Version](../../../install/check-install-version.md)
to learn how to see what version you have installed.
1. Create a [personal access token](https://github.com/settings/tokens) to 1. Create a [personal access token](https://github.com/settings/tokens) to
GitHub repo that the GitHub source can use to register webhooks with the GitHub repo that the GitHub source can use to register webhooks with the
GitHub API. Also decide on a token that your code will use to authenticate GitHub API. Also decide on a token that your code will use to authenticate
@ -140,6 +104,43 @@ kubectl apply -f auth.yaml
kubectl apply -f githubsecret.yaml kubectl apply -f githubsecret.yaml
``` ```
1. Use Docker to build the sample code into a container. To build and push with
Docker Hub, run the following commands, replacing `{username}` with your
Docker Hub username. Run the following commands from the _root_ directory of
the `knative/docs` repo:
```shell
# Build the container on your local machine
# Note: The relative path points to the _root_ of the `knative/docs` repo
docker build -t {username}/github-events --file=Dockerfile ../../../
# Push the container to docker registry
docker push {username}/github-events
```
1. After the build has completed and the container is pushed to Docker Hub, you
can deploy the function into your cluster. **Ensure that the container image
value in `function.yaml` matches the container you built in the previous
step.** Apply the configuration using `kubectl`:
```shell
kubectl apply -f function.yaml
```
1. Check that your service is running using:
```shell
kubectl get ksvc -o "custom-columns=NAME:.metadata.name,READY:.status.conditions[2].status,REASON:.status.conditions[2].message"
NAME READY REASON
legit True <none>
```
> Note: `ksvc` is an alias for `services.serving.knative.dev`. If you have
an older version (version 0.1.0) of Knative installed, you'll need to use
the long name until you upgrade to version 0.1.1 or higher. See
[Checking Knative Installation Version](../../../install/check-install-version.md)
to learn how to see what version you have installed.
1. Update the resource inside `flow.yaml` to the 1. Update the resource inside `flow.yaml` to the
org/repo of your choosing. Note that the personal access token must be valid org/repo of your choosing. Note that the personal access token must be valid
for the chosen org/repo. for the chosen org/repo.