This repository build a simple Hello container based on this repository but without the HTML template. It's used in this Medium article
The purpose is to return a simple string with all the important information. It's easier to handle with curl
The hello.yaml
file allow to deploy the container on any Knative compliant cluster.
The container is publicly accessible: gcr.io/cloudrun-hello-go/hello
Build the container with the tool that you prefer
# Docker
docker build . -t <tag>
# Cloud Build
gcloud builds submit --tag <tag>
On K8S cluster, perform this command
kubectl apply -f hello.yaml
Perform the test of the Knative service on your cluster with this command
curl -H "Host: $(kubectl get route.serving.knative.dev hello-yaml \
-o jsonpath='{.status.url}' | sed 's/http:\/\///g')" \
$(kubectl get svc istio-ingressgateway --namespace istio-system \
-o jsonpath='{.status.loadBalancer.ingress[0].ip}')
Be careful, ingress definition can change from cluster to another one. Try to change ip
by hostname
. This is the case for AWS EKS cluster
This library is licensed under Apache 2.0. Full license text is available in LICENSE.