frontend: add liveness/readiness probes

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
This commit is contained in:
Ahmet Alp Balkan 2018-06-28 18:15:05 -07:00 committed by Simon Zeltser
parent 781cdaed9e
commit e3a9580c76
2 changed files with 11 additions and 1 deletions

View file

@ -13,6 +13,16 @@ spec:
image: frontend
ports:
- containerPort: 8080
readinessProbe:
initialDelaySeconds: 10
httpGet:
path: "/"
port: 8080
livenessProbe:
initialDelaySeconds: 10
httpGet:
path: "/"
port: 8080
env:
- name: PRODUCT_CATALOG_SERVICE_ADDR
value: "productcatalogservice:3550"

View file

@ -101,7 +101,7 @@ func main() {
r.HandleFunc("/cart/checkout", ensureSessionID(svc.placeOrderHandler)).Methods(http.MethodPost)
r.PathPrefix("/static/").Handler(http.StripPrefix("/static/", http.FileServer(http.Dir("./static/"))))
log.Printf("starting server on :" + srvPort)
log.Fatal(http.ListenAndServe("localhost:"+srvPort, r))
log.Fatal(http.ListenAndServe(":"+srvPort, r))
}
func mustMapEnv(target *string, envKey string) {