Skip to content

Instantly share code, notes, and snippets.

@Hecatoncheir
Last active January 7, 2019 17:03
Show Gist options
  • Select an option

  • Save Hecatoncheir/1180479de480d7e36d6d7aef08babe59 to your computer and use it in GitHub Desktop.

Select an option

Save Hecatoncheir/1180479de480d7e36d6d7aef08babe59 to your computer and use it in GitHub Desktop.
apiVersion: serving.knative.dev/v1alpha1
kind: Service
metadata:
name: test
namespace: default
spec:
runLatest:
configuration:
revisionTemplate:
metadata:
annotations:
# Target 10 in-flight-requests per pod.
autoscaling.knative.dev/target: "50"
spec:
container:
image: docker.io/test
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func handler(w http.ResponseWriter, r *http.Request) {
response, err := http.Get("https://httpbin.org/get")
if err != nil {
fmt.Println(err)
}
body, err := ioutil.ReadAll(response.Body)
_, err = w.Write(body)
if err != nil {
fmt.Println(err)
}
}
func main() {
http.HandleFunc("/", handler)
err := http.ListenAndServe(":8080", nil)
if err != nil {
fmt.Println(err)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment