-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Buildpack sample edits #222
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
5046c70
First edits to dotnet buildpack
samodell 6483e1b
Updates to buildpack nodejs sample
samodell 7226997
More edits to dotnet sample
samodell ee8a706
Update README.md
samodell 70da8a8
Update README.md
samodell adfab22
Update README.md
samodell bedba96
Update README.md
samodell 20ab356
Making Ryan's suggested changes - dotnet
samodell d75d28a
Making Ryan's suggested changes - nodejs
samodell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
# Buildpack Sample Function | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think my comments above apply here too, so I won't repeat them. |
||
|
||
A sample function that demonstrates usage of Cloud Foundry buildpacks on | ||
Knative Serving, using the [packs Docker images](https://github.com/sclevine/packs). | ||
A sample function that demonstrates using [Cloud Foundry](https://www.cloudfoundry.org/) | ||
buildpacks on Knative Serving, using the [packs Docker images](https://github.com/sclevine/packs). | ||
|
||
This deploys the [riff square](https://github.com/scothis/riff-square-buildpack) | ||
sample function for riff. | ||
|
||
## Prerequisites | ||
|
||
[Install Knative Serving](https://github.com/knative/docs/blob/master/install/README.md) | ||
* [Install Knative Serving](../../../install/README.md) | ||
|
||
## Running | ||
|
||
This sample uses the [Buildpack build | ||
template](https://github.com/knative/build-templates/blob/master/buildpack/buildpack.yaml) | ||
in the [build-templates](https://github.com/knative/build-templates/) repo. | ||
from the [build-templates](https://github.com/knative/build-templates/) repo. | ||
|
||
First, install the Buildpack build template from that repo: | ||
Save a copy of `buildpack.yaml`, then install it: | ||
|
||
```shell | ||
kubectl apply -f buildpack.yaml | ||
|
@@ -25,11 +25,12 @@ kubectl apply -f buildpack.yaml | |
Then you can deploy this to Knative Serving from the root directory via: | ||
|
||
```shell | ||
# Replace the token string with a suitable registry | ||
REPO="gcr.io/<your-project-here>" | ||
perl -pi -e "s@DOCKER_REPO_OVERRIDE@$REPO@g" serving/samples/buildpack-function-nodejs/sample.yaml | ||
# Replace <your-project-here> with your own registry | ||
export REPO="gcr.io/<your-project-here>" | ||
|
||
kubectl apply -f serving/samples/buildpack-function-nodejs/sample.yaml | ||
perl -pi -e "s@DOCKER_REPO_OVERRIDE@$REPO@g" sample.yaml | ||
|
||
kubectl apply -f sample.yaml | ||
``` | ||
|
||
Once deployed, you will see that it first builds: | ||
|
@@ -49,27 +50,30 @@ items: | |
... | ||
``` | ||
|
||
Once the `BuildComplete` status becomes `True` the resources will start getting created. | ||
|
||
Once the `BuildComplete` status is `True`, resource creation begins. | ||
|
||
To access this service via `curl`, we first need to determine its ingress address: | ||
To access this service using `curl`, we first need to determine its ingress address: | ||
```shell | ||
watch kubectl get svc knative-ingressgateway -n istio-system | ||
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE | ||
knative-ingressgateway LoadBalancer 10.23.247.74 35.203.155.229 80:32380/TCP,443:32390/TCP,32400:32400/TCP 2d | ||
``` | ||
|
||
Once the `EXTERNAL-IP` gets assigned to the cluster, you can run: | ||
Once the `EXTERNAL-IP` gets assigned to the cluster, enter the follow commands to capture | ||
the host URL and the IP of the ingress endpoint in environment variables: | ||
|
||
```shell | ||
# Put the Host name into an environment variable. | ||
$ export SERVICE_HOST=`kubectl get route buildpack-function -o jsonpath="{.status.domain}"` | ||
|
||
# Put the ingress IP into an environment variable. | ||
$ export SERVICE_IP=`kubectl get svc knative-ingressgateway -n istio-system -o jsonpath="{.status.loadBalancer.ingress[*].ip}"` | ||
``` | ||
|
||
Now curl the service IP to make sure the deployment succeeded: | ||
|
||
# Curl the ingress IP "as-if" DNS were properly configured. | ||
```shell | ||
# Curl the ingress IP as if DNS were properly configured | ||
$ curl http://${SERVICE_IP}/ -H "Host: $SERVICE_HOST" -H "Content-Type: application/json" -d "33" | ||
[response] | ||
``` | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where do I get this file from? Maybe call out to save it from the [Buildpack build template] link?