frontend: add liveness/readiness probes
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
This commit is contained in:
parent
ecba29655a
commit
1ae5e7737a
2 changed files with 11 additions and 1 deletions
|
@ -13,6 +13,16 @@ spec:
|
||||||
image: frontend
|
image: frontend
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 8080
|
- containerPort: 8080
|
||||||
|
readinessProbe:
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
httpGet:
|
||||||
|
path: "/"
|
||||||
|
port: 8080
|
||||||
|
livenessProbe:
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
httpGet:
|
||||||
|
path: "/"
|
||||||
|
port: 8080
|
||||||
env:
|
env:
|
||||||
- name: PRODUCT_CATALOG_SERVICE_ADDR
|
- name: PRODUCT_CATALOG_SERVICE_ADDR
|
||||||
value: "productcatalogservice:3550"
|
value: "productcatalogservice:3550"
|
||||||
|
|
|
@ -101,7 +101,7 @@ func main() {
|
||||||
r.HandleFunc("/cart/checkout", ensureSessionID(svc.placeOrderHandler)).Methods(http.MethodPost)
|
r.HandleFunc("/cart/checkout", ensureSessionID(svc.placeOrderHandler)).Methods(http.MethodPost)
|
||||||
r.PathPrefix("/static/").Handler(http.StripPrefix("/static/", http.FileServer(http.Dir("./static/"))))
|
r.PathPrefix("/static/").Handler(http.StripPrefix("/static/", http.FileServer(http.Dir("./static/"))))
|
||||||
log.Printf("starting server on :" + srvPort)
|
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) {
|
func mustMapEnv(target *string, envKey string) {
|
||||||
|
|
Loading…
Reference in a new issue