add knative manifests
Signed-off-by: Tony Pujals <tonypujals@google.com>
This commit is contained in:
parent
b548af52dd
commit
58660ff45e
5 changed files with 346 additions and 241 deletions
15
knative/cluster.sh
Executable file
15
knative/cluster.sh
Executable file
|
@ -0,0 +1,15 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
# Sample script for creating a cluster for the app to test with Cloud Run for Anthos
|
||||||
|
|
||||||
|
CLUSTER="${CLUSTER:-cluster-1}"
|
||||||
|
ZONE="${ZONE:-us-central1-c}"
|
||||||
|
NODES="${NODES:-3}"
|
||||||
|
MACHINE="${MACHINE:-n1-standard-2}"
|
||||||
|
CHANNEL="${CHANNEL:-regular}"
|
||||||
|
|
||||||
|
gcloud beta container clusters create "${CLUSTER}" \
|
||||||
|
--addons CloudRun,HttpLoadBalancing \
|
||||||
|
--zone "${ZONE}" --num-nodes "${NODES}" --machine-type "${MACHINE}" \
|
||||||
|
--release-channel "${CHANNEL}" \
|
||||||
|
--enable-ip-alias \
|
||||||
|
--enable-stackdriver-kubernetes
|
8
knative/config-domain.yaml
Normal file
8
knative/config-domain.yaml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: config-domain
|
||||||
|
namespace: knative-serving
|
||||||
|
data:
|
||||||
|
tonypujals.com: ""
|
||||||
|
|
7
knative/config-scaling.yaml
Normal file
7
knative/config-scaling.yaml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: config-autoscaler
|
||||||
|
namespace: knative-serving
|
||||||
|
data:
|
||||||
|
enable-scale-to-zero: "false"
|
|
@ -1,42 +1,56 @@
|
||||||
apiVersion: extensions/v1beta1
|
# Copyright 2020 Google LLC
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: redis-cart
|
name: redis-cart
|
||||||
spec:
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: redis-cart
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
|
||||||
sidecar.istio.io/inject: "true"
|
|
||||||
labels:
|
labels:
|
||||||
app: redis-cart
|
app: redis-cart
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: redis
|
- name: redis
|
||||||
image: redis:alpine
|
image: redis:alpine
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 6379
|
- containerPort: 6379
|
||||||
name: redis
|
readinessProbe:
|
||||||
readinessProbe:
|
periodSeconds: 5
|
||||||
periodSeconds: 5
|
tcpSocket:
|
||||||
tcpSocket:
|
port: 6379
|
||||||
port: 6379
|
livenessProbe:
|
||||||
livenessProbe:
|
periodSeconds: 5
|
||||||
periodSeconds: 5
|
tcpSocket:
|
||||||
tcpSocket:
|
port: 6379
|
||||||
port: 6379
|
volumeMounts:
|
||||||
volumeMounts:
|
- mountPath: /data
|
||||||
- mountPath: /data
|
name: redis-data
|
||||||
name: redis-data
|
resources:
|
||||||
resources:
|
limits:
|
||||||
limits:
|
memory: 256Mi
|
||||||
memory: 256Mi
|
cpu: 125m
|
||||||
cpu: 125m
|
requests:
|
||||||
requests:
|
cpu: 70m
|
||||||
cpu: 70m
|
memory: 200Mi
|
||||||
memory: 200Mi
|
|
||||||
volumes:
|
volumes:
|
||||||
- name: redis-data
|
- name: redis-data
|
||||||
emptyDir: {}
|
emptyDir: {}
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
|
@ -47,6 +61,6 @@ spec:
|
||||||
selector:
|
selector:
|
||||||
app: redis-cart
|
app: redis-cart
|
||||||
ports:
|
ports:
|
||||||
- name: redis
|
- name: redis
|
||||||
port: 6379
|
port: 6379
|
||||||
targetPort: 6379
|
targetPort: 6379
|
||||||
|
|
|
@ -1,36 +1,104 @@
|
||||||
|
# Copyright 2020 Google LLC
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
---
|
||||||
apiVersion: serving.knative.dev/v1
|
apiVersion: serving.knative.dev/v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: emailservice
|
name: adservice
|
||||||
labels:
|
labels:
|
||||||
serving.knative.dev/visibility: cluster-local
|
serving.knative.dev/visibility: cluster-local
|
||||||
spec:
|
spec:
|
||||||
template:
|
template:
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
autoscaling.knative.dev/minScale: "1"
|
||||||
|
autoscaling.knative.dev/maxScale: "5"
|
||||||
|
autoscaling.knative.dev/target: "2"
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- image: gcr.io/google-samples/microservices-demo/emailservice:v0.2.0
|
- image: gcr.io/google-samples/microservices-demo/adservice:v0.2.0
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 8080
|
- containerPort: 8080
|
||||||
name: h2c
|
name: h2c
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 200m
|
||||||
|
memory: 180Mi
|
||||||
|
limits:
|
||||||
|
cpu: 300m
|
||||||
|
memory: 300Mi
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
failureThreshold: 1
|
failureThreshold: 3
|
||||||
periodSeconds: 5
|
periodSeconds: 5
|
||||||
timeoutSeconds: 1
|
timeoutSeconds: 2
|
||||||
|
initialDelaySeconds: 10
|
||||||
exec:
|
exec:
|
||||||
command: ["/bin/grpc_health_probe", "-addr=:$(PORT)"]
|
command: ["/bin/grpc_health_probe", "-addr=:$(PORT)"]
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
failureThreshold: 1
|
failureThreshold: 3
|
||||||
periodSeconds: 5
|
periodSeconds: 5
|
||||||
timeoutSeconds: 1
|
timeoutSeconds: 2
|
||||||
|
initialDelaySeconds: 10
|
||||||
exec:
|
exec:
|
||||||
command: ["/bin/grpc_health_probe", "-addr=:$(PORT)"]
|
command: ["/bin/grpc_health_probe", "-addr=:$(PORT)"]
|
||||||
|
---
|
||||||
|
apiVersion: serving.knative.dev/v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: cartservice
|
||||||
|
labels:
|
||||||
|
serving.knative.dev/visibility: cluster-local
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
autoscaling.knative.dev/minScale: "1"
|
||||||
|
autoscaling.knative.dev/maxScale: "5"
|
||||||
|
autoscaling.knative.dev/target: "2"
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: gcr.io/google-samples/microservices-demo/cartservice:v0.2.0
|
||||||
|
args: ["-p", "$(PORT)"]
|
||||||
|
ports:
|
||||||
|
- containerPort: 8080
|
||||||
|
name: h2c
|
||||||
|
env:
|
||||||
|
- name: REDIS_ADDR
|
||||||
|
value: "redis-cart:6379"
|
||||||
|
- name: LISTEN_ADDR
|
||||||
|
value: "0.0.0.0"
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: 100m
|
cpu: 200m
|
||||||
memory: 64Mi
|
memory: 64Mi
|
||||||
limits:
|
limits:
|
||||||
cpu: 200m
|
cpu: 300m
|
||||||
memory: 128Mi
|
memory: 128Mi
|
||||||
|
readinessProbe:
|
||||||
|
failureThreshold: 3
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 2
|
||||||
|
initialDelaySeconds: 15
|
||||||
|
exec:
|
||||||
|
command: ["/bin/grpc_health_probe", "-addr=:$(PORT)"]
|
||||||
|
livenessProbe:
|
||||||
|
failureThreshold: 3
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 2
|
||||||
|
initialDelaySeconds: 15
|
||||||
|
exec:
|
||||||
|
command: ["/bin/grpc_health_probe", "-addr=:$(PORT)"]
|
||||||
---
|
---
|
||||||
apiVersion: serving.knative.dev/v1
|
apiVersion: serving.knative.dev/v1
|
||||||
kind: Service
|
kind: Service
|
||||||
|
@ -40,24 +108,17 @@ metadata:
|
||||||
serving.knative.dev/visibility: cluster-local
|
serving.knative.dev/visibility: cluster-local
|
||||||
spec:
|
spec:
|
||||||
template:
|
template:
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
autoscaling.knative.dev/minScale: "1"
|
||||||
|
autoscaling.knative.dev/maxScale: "5"
|
||||||
|
autoscaling.knative.dev/target: "2"
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- image: gcr.io/google-samples/microservices-demo/checkoutservice:v0.2.0
|
- image: gcr.io/google-samples/microservices-demo/checkoutservice:v0.2.0
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 8080
|
- containerPort: 8080
|
||||||
name: h2c
|
name: h2c
|
||||||
readinessProbe:
|
|
||||||
failureThreshold: 1
|
|
||||||
periodSeconds: 5
|
|
||||||
timeoutSeconds: 1
|
|
||||||
exec:
|
|
||||||
command: ["/bin/grpc_health_probe", "-addr=:$(PORT)"]
|
|
||||||
livenessProbe:
|
|
||||||
failureThreshold: 1
|
|
||||||
periodSeconds: 5
|
|
||||||
timeoutSeconds: 1
|
|
||||||
exec:
|
|
||||||
command: ["/bin/grpc_health_probe", "-addr=:$(PORT)"]
|
|
||||||
env:
|
env:
|
||||||
- name: PRODUCT_CATALOG_SERVICE_ADDR
|
- name: PRODUCT_CATALOG_SERVICE_ADDR
|
||||||
value: "productcatalogservice.default:80"
|
value: "productcatalogservice.default:80"
|
||||||
|
@ -82,84 +143,36 @@ spec:
|
||||||
apiVersion: serving.knative.dev/v1
|
apiVersion: serving.knative.dev/v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: recommendationservice
|
name: currencyservice
|
||||||
labels:
|
labels:
|
||||||
serving.knative.dev/visibility: cluster-local
|
serving.knative.dev/visibility: cluster-local
|
||||||
spec:
|
spec:
|
||||||
template:
|
template:
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
autoscaling.knative.dev/minScale: "1"
|
||||||
|
autoscaling.knative.dev/maxScale: "5"
|
||||||
|
autoscaling.knative.dev/target: "2"
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- image: gcr.io/google-samples/microservices-demo/recommendationservice:v0.2.0
|
- image: gcr.io/google-samples/microservices-demo/currencyservice:v0.2.0
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 8080
|
- containerPort: 7000
|
||||||
name: h2c
|
name: h2c
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
failureThreshold: 1
|
failureThreshold: 3
|
||||||
periodSeconds: 5
|
periodSeconds: 5
|
||||||
timeoutSeconds: 1
|
timeoutSeconds: 2
|
||||||
|
initialDelaySeconds: 10
|
||||||
exec:
|
exec:
|
||||||
command: ["/bin/grpc_health_probe", "-addr=:$(PORT)"]
|
command: ["/bin/grpc_health_probe", "-addr=:$(PORT)"]
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
failureThreshold: 1
|
failureThreshold: 3
|
||||||
periodSeconds: 5
|
periodSeconds: 5
|
||||||
timeoutSeconds: 1
|
timeoutSeconds: 2
|
||||||
|
initialDelaySeconds: 10
|
||||||
exec:
|
exec:
|
||||||
command: ["/bin/grpc_health_probe", "-addr=:$(PORT)"]
|
command: ["/bin/grpc_health_probe", "-addr=:$(PORT)"]
|
||||||
env:
|
|
||||||
- name: PRODUCT_CATALOG_SERVICE_ADDR
|
|
||||||
value: "productcatalogservice.default:80"
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
cpu: 100m
|
|
||||||
memory: 220Mi
|
|
||||||
limits:
|
|
||||||
cpu: 200m
|
|
||||||
memory: 450Mi
|
|
||||||
---
|
|
||||||
apiVersion: serving.knative.dev/v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: frontend
|
|
||||||
spec:
|
|
||||||
template:
|
|
||||||
spec:
|
|
||||||
containers:
|
|
||||||
- image: gcr.io/google-samples/microservices-demo/frontend:v0.2.0
|
|
||||||
readinessProbe:
|
|
||||||
failureThreshold: 1
|
|
||||||
periodSeconds: 5
|
|
||||||
timeoutSeconds: 1
|
|
||||||
initialDelaySeconds: 10
|
|
||||||
httpGet:
|
|
||||||
path: "/_healthz"
|
|
||||||
httpHeaders:
|
|
||||||
- name: "Cookie"
|
|
||||||
value: "shop_session-id=x-readiness-probe"
|
|
||||||
livenessProbe:
|
|
||||||
failureThreshold: 1
|
|
||||||
periodSeconds: 5
|
|
||||||
timeoutSeconds: 1
|
|
||||||
initialDelaySeconds: 10
|
|
||||||
httpGet:
|
|
||||||
path: "/_healthz"
|
|
||||||
httpHeaders:
|
|
||||||
- name: "Cookie"
|
|
||||||
value: "shop_session-id=x-liveness-probe"
|
|
||||||
env:
|
|
||||||
- name: PRODUCT_CATALOG_SERVICE_ADDR
|
|
||||||
value: "productcatalogservice.default:80"
|
|
||||||
- name: CURRENCY_SERVICE_ADDR
|
|
||||||
value: "currencyservice.default:80"
|
|
||||||
- name: CART_SERVICE_ADDR
|
|
||||||
value: "cartservice.default:80"
|
|
||||||
- name: RECOMMENDATION_SERVICE_ADDR
|
|
||||||
value: "recommendationservice.default:80"
|
|
||||||
- name: SHIPPING_SERVICE_ADDR
|
|
||||||
value: "shippingservice.default:80"
|
|
||||||
- name: CHECKOUT_SERVICE_ADDR
|
|
||||||
value: "checkoutservice.default:80"
|
|
||||||
- name: AD_SERVICE_ADDR
|
|
||||||
value: "adservice.default:80"
|
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
|
@ -170,12 +183,115 @@ spec:
|
||||||
---
|
---
|
||||||
apiVersion: serving.knative.dev/v1
|
apiVersion: serving.knative.dev/v1
|
||||||
kind: Service
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: emailservice
|
||||||
|
labels:
|
||||||
|
serving.knative.dev/visibility: cluster-local
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
autoscaling.knative.dev/minScale: "1"
|
||||||
|
autoscaling.knative.dev/maxScale: "5"
|
||||||
|
autoscaling.knative.dev/target: "2"
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: gcr.io/google-samples/microservices-demo/emailservice:v0.2.0
|
||||||
|
ports:
|
||||||
|
- containerPort: 8080
|
||||||
|
name: h2c
|
||||||
|
readinessProbe:
|
||||||
|
failureThreshold: 3
|
||||||
|
periodSeconds: 5
|
||||||
|
timeoutSeconds: 2
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
exec:
|
||||||
|
command: ["/bin/grpc_health_probe", "-addr=:$(PORT)"]
|
||||||
|
livenessProbe:
|
||||||
|
failureThreshold: 3
|
||||||
|
periodSeconds: 5
|
||||||
|
timeoutSeconds: 2
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
exec:
|
||||||
|
command: ["/bin/grpc_health_probe", "-addr=:$(PORT)"]
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 64Mi
|
||||||
|
limits:
|
||||||
|
cpu: 200m
|
||||||
|
memory: 128Mi
|
||||||
|
---
|
||||||
|
apiVersion: serving.knative.dev/v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: frontend
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
autoscaling.knative.dev/minScale: "1"
|
||||||
|
autoscaling.knative.dev/maxScale: "5"
|
||||||
|
autoscaling.knative.dev/target: "2"
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: gcr.io/google-samples/microservices-demo/frontend:v0.2.0
|
||||||
|
readinessProbe:
|
||||||
|
failureThreshold: 3
|
||||||
|
periodSeconds: 5
|
||||||
|
timeoutSeconds: 2
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
httpGet:
|
||||||
|
path: "/_healthz"
|
||||||
|
httpHeaders:
|
||||||
|
- name: "Cookie"
|
||||||
|
value: "shop_session-id=x-readiness-probe"
|
||||||
|
livenessProbe:
|
||||||
|
failureThreshold: 3
|
||||||
|
periodSeconds: 5
|
||||||
|
timeoutSeconds: 2
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
httpGet:
|
||||||
|
path: "/_healthz"
|
||||||
|
httpHeaders:
|
||||||
|
- name: "Cookie"
|
||||||
|
value: "shop_session-id=x-liveness-probe"
|
||||||
|
env:
|
||||||
|
- name: PRODUCT_CATALOG_SERVICE_ADDR
|
||||||
|
value: "productcatalogservice.default:80"
|
||||||
|
- name: CURRENCY_SERVICE_ADDR
|
||||||
|
value: "currencyservice.default:80"
|
||||||
|
- name: CART_SERVICE_ADDR
|
||||||
|
value: "cartservice.default:80"
|
||||||
|
- name: RECOMMENDATION_SERVICE_ADDR
|
||||||
|
value: "recommendationservice.default:80"
|
||||||
|
- name: SHIPPING_SERVICE_ADDR
|
||||||
|
value: "shippingservice.default:80"
|
||||||
|
- name: CHECKOUT_SERVICE_ADDR
|
||||||
|
value: "checkoutservice.default:80"
|
||||||
|
- name: AD_SERVICE_ADDR
|
||||||
|
value: "adservice.default:80"
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 64Mi
|
||||||
|
limits:
|
||||||
|
cpu: 200m
|
||||||
|
memory: 128Mi
|
||||||
|
---
|
||||||
|
apiVersion: serving.knative.dev/v1
|
||||||
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: paymentservice
|
name: paymentservice
|
||||||
labels:
|
labels:
|
||||||
serving.knative.dev/visibility: cluster-local
|
serving.knative.dev/visibility: cluster-local
|
||||||
spec:
|
spec:
|
||||||
template:
|
template:
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
autoscaling.knative.dev/minScale: "1"
|
||||||
|
autoscaling.knative.dev/maxScale: "5"
|
||||||
|
autoscaling.knative.dev/target: "2"
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- image: gcr.io/google-samples/microservices-demo/paymentservice:v0.2.0
|
- image: gcr.io/google-samples/microservices-demo/paymentservice:v0.2.0
|
||||||
|
@ -183,15 +299,17 @@ spec:
|
||||||
- containerPort: 8080
|
- containerPort: 8080
|
||||||
name: h2c
|
name: h2c
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
failureThreshold: 1
|
failureThreshold: 3
|
||||||
periodSeconds: 5
|
periodSeconds: 5
|
||||||
timeoutSeconds: 1
|
timeoutSeconds: 2
|
||||||
|
initialDelaySeconds: 10
|
||||||
exec:
|
exec:
|
||||||
command: ["/bin/grpc_health_probe", "-addr=:$(PORT)"]
|
command: ["/bin/grpc_health_probe", "-addr=:$(PORT)"]
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
failureThreshold: 1
|
failureThreshold: 3
|
||||||
periodSeconds: 5
|
periodSeconds: 5
|
||||||
timeoutSeconds: 1
|
timeoutSeconds: 2
|
||||||
|
initialDelaySeconds: 10
|
||||||
exec:
|
exec:
|
||||||
command: ["/bin/grpc_health_probe", "-addr=:$(PORT)"]
|
command: ["/bin/grpc_health_probe", "-addr=:$(PORT)"]
|
||||||
resources:
|
resources:
|
||||||
|
@ -210,108 +328,82 @@ metadata:
|
||||||
serving.knative.dev/visibility: cluster-local
|
serving.knative.dev/visibility: cluster-local
|
||||||
spec:
|
spec:
|
||||||
template:
|
template:
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
autoscaling.knative.dev/minScale: "1"
|
||||||
|
autoscaling.knative.dev/maxScale: "5"
|
||||||
|
autoscaling.knative.dev/target: "2"
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- image: gcr.io/google-samples/microservices-demo/productcatalogservice:v0.2.0
|
- image: gcr.io/google-samples/microservices-demo/productcatalogservice:v0.2.0
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 3550
|
- containerPort: 3550
|
||||||
name: h2c
|
name: h2c
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
failureThreshold: 1
|
failureThreshold: 3
|
||||||
periodSeconds: 5
|
periodSeconds: 5
|
||||||
timeoutSeconds: 1
|
timeoutSeconds: 2
|
||||||
exec:
|
initialDelaySeconds: 10
|
||||||
command: ["/bin/grpc_health_probe", "-addr=:$(PORT)"]
|
exec:
|
||||||
livenessProbe:
|
command: ["/bin/grpc_health_probe", "-addr=:$(PORT)"]
|
||||||
failureThreshold: 1
|
livenessProbe:
|
||||||
periodSeconds: 5
|
failureThreshold: 3
|
||||||
timeoutSeconds: 1
|
periodSeconds: 5
|
||||||
exec:
|
timeoutSeconds: 2
|
||||||
command: ["/bin/grpc_health_probe", "-addr=:$(PORT)"]
|
initialDelaySeconds: 10
|
||||||
resources:
|
exec:
|
||||||
requests:
|
command: ["/bin/grpc_health_probe", "-addr=:$(PORT)"]
|
||||||
cpu: 100m
|
resources:
|
||||||
memory: 64Mi
|
requests:
|
||||||
limits:
|
cpu: 100m
|
||||||
cpu: 200m
|
memory: 64Mi
|
||||||
memory: 128Mi
|
limits:
|
||||||
|
cpu: 200m
|
||||||
|
memory: 128Mi
|
||||||
---
|
---
|
||||||
apiVersion: serving.knative.dev/v1
|
apiVersion: serving.knative.dev/v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: cartservice
|
name: recommendationservice
|
||||||
labels:
|
labels:
|
||||||
serving.knative.dev/visibility: cluster-local
|
serving.knative.dev/visibility: cluster-local
|
||||||
spec:
|
spec:
|
||||||
template:
|
template:
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
autoscaling.knative.dev/minScale: "1"
|
||||||
|
autoscaling.knative.dev/maxScale: "5"
|
||||||
|
autoscaling.knative.dev/target: "2"
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- image: gcr.io/google-samples/microservices-demo/cartservice:v0.2.0
|
- image: gcr.io/google-samples/microservices-demo/recommendationservice:v0.2.0
|
||||||
args: ["-p", "$(PORT)"]
|
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 8080
|
- containerPort: 8080
|
||||||
name: h2c
|
name: h2c
|
||||||
|
readinessProbe:
|
||||||
|
failureThreshold: 3
|
||||||
|
periodSeconds: 5
|
||||||
|
timeoutSeconds: 2
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
exec:
|
||||||
|
command: ["/bin/grpc_health_probe", "-addr=:$(PORT)"]
|
||||||
|
livenessProbe:
|
||||||
|
failureThreshold: 3
|
||||||
|
periodSeconds: 5
|
||||||
|
timeoutSeconds: 2
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
exec:
|
||||||
|
command: ["/bin/grpc_health_probe", "-addr=:$(PORT)"]
|
||||||
env:
|
env:
|
||||||
- name: REDIS_ADDR
|
- name: PRODUCT_CATALOG_SERVICE_ADDR
|
||||||
value: "redis-cart:6379"
|
value: "productcatalogservice.default:80"
|
||||||
- name: LISTEN_ADDR
|
|
||||||
value: "0.0.0.0"
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
cpu: 200m
|
|
||||||
memory: 64Mi
|
|
||||||
limits:
|
|
||||||
cpu: 300m
|
|
||||||
memory: 128Mi
|
|
||||||
readinessProbe:
|
|
||||||
failureThreshold: 1
|
|
||||||
periodSeconds: 5
|
|
||||||
timeoutSeconds: 1
|
|
||||||
initialDelaySeconds: 15
|
|
||||||
exec:
|
|
||||||
command: ["/bin/grpc_health_probe", "-addr=:$(PORT)"]
|
|
||||||
livenessProbe:
|
|
||||||
failureThreshold: 1
|
|
||||||
periodSeconds: 5
|
|
||||||
timeoutSeconds: 1
|
|
||||||
initialDelaySeconds: 15
|
|
||||||
periodSeconds: 10
|
|
||||||
exec:
|
|
||||||
command: ["/bin/grpc_health_probe", "-addr=:$(PORT)"]
|
|
||||||
---
|
|
||||||
apiVersion: serving.knative.dev/v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: currencyservice
|
|
||||||
labels:
|
|
||||||
serving.knative.dev/visibility: cluster-local
|
|
||||||
spec:
|
|
||||||
template:
|
|
||||||
spec:
|
|
||||||
containers:
|
|
||||||
- image: gcr.io/google-samples/microservices-demo/currencyservice:v0.2.0
|
|
||||||
ports:
|
|
||||||
- containerPort: 7000
|
|
||||||
name: h2c
|
|
||||||
readinessProbe:
|
|
||||||
failureThreshold: 1
|
|
||||||
periodSeconds: 5
|
|
||||||
timeoutSeconds: 1
|
|
||||||
exec:
|
|
||||||
command: ["/bin/grpc_health_probe", "-addr=:$(PORT)"]
|
|
||||||
livenessProbe:
|
|
||||||
failureThreshold: 1
|
|
||||||
periodSeconds: 5
|
|
||||||
timeoutSeconds: 1
|
|
||||||
exec:
|
|
||||||
command: ["/bin/grpc_health_probe", "-addr=:$(PORT)"]
|
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
memory: 64Mi
|
memory: 220Mi
|
||||||
limits:
|
limits:
|
||||||
cpu: 200m
|
cpu: 200m
|
||||||
memory: 128Mi
|
memory: 450Mi
|
||||||
---
|
---
|
||||||
apiVersion: serving.knative.dev/v1
|
apiVersion: serving.knative.dev/v1
|
||||||
kind: Service
|
kind: Service
|
||||||
|
@ -321,6 +413,11 @@ metadata:
|
||||||
serving.knative.dev/visibility: cluster-local
|
serving.knative.dev/visibility: cluster-local
|
||||||
spec:
|
spec:
|
||||||
template:
|
template:
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
autoscaling.knative.dev/minScale: "1"
|
||||||
|
autoscaling.knative.dev/maxScale: "5"
|
||||||
|
autoscaling.knative.dev/target: "2"
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- image: gcr.io/google-samples/microservices-demo/shippingservice:v0.2.0
|
- image: gcr.io/google-samples/microservices-demo/shippingservice:v0.2.0
|
||||||
|
@ -328,15 +425,17 @@ spec:
|
||||||
- containerPort: 50051
|
- containerPort: 50051
|
||||||
name: h2c
|
name: h2c
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
failureThreshold: 1
|
failureThreshold: 3
|
||||||
periodSeconds: 5
|
periodSeconds: 5
|
||||||
timeoutSeconds: 1
|
timeoutSeconds: 2
|
||||||
|
initialDelaySeconds: 10
|
||||||
exec:
|
exec:
|
||||||
command: ["/bin/grpc_health_probe", "-addr=:$(PORT)"]
|
command: ["/bin/grpc_health_probe", "-addr=:$(PORT)"]
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
failureThreshold: 1
|
failureThreshold: 3
|
||||||
periodSeconds: 5
|
periodSeconds: 5
|
||||||
timeoutSeconds: 1
|
timeoutSeconds: 2
|
||||||
|
initialDelaySeconds: 10
|
||||||
exec:
|
exec:
|
||||||
command: ["/bin/grpc_health_probe", "-addr=:$(PORT)"]
|
command: ["/bin/grpc_health_probe", "-addr=:$(PORT)"]
|
||||||
resources:
|
resources:
|
||||||
|
@ -346,41 +445,3 @@ spec:
|
||||||
limits:
|
limits:
|
||||||
cpu: 200m
|
cpu: 200m
|
||||||
memory: 128Mi
|
memory: 128Mi
|
||||||
---
|
|
||||||
apiVersion: serving.knative.dev/v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: adservice
|
|
||||||
labels:
|
|
||||||
serving.knative.dev/visibility: cluster-local
|
|
||||||
spec:
|
|
||||||
template:
|
|
||||||
spec:
|
|
||||||
containers:
|
|
||||||
- image: gcr.io/google-samples/microservices-demo/adservice:v0.2.0
|
|
||||||
ports:
|
|
||||||
- containerPort: 8080
|
|
||||||
name: h2c
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
cpu: 200m
|
|
||||||
memory: 180Mi
|
|
||||||
limits:
|
|
||||||
cpu: 300m
|
|
||||||
memory: 300Mi
|
|
||||||
readinessProbe:
|
|
||||||
failureThreshold: 1
|
|
||||||
periodSeconds: 5
|
|
||||||
timeoutSeconds: 1
|
|
||||||
initialDelaySeconds: 20
|
|
||||||
periodSeconds: 15
|
|
||||||
exec:
|
|
||||||
command: ["/bin/grpc_health_probe", "-addr=:$(PORT)"]
|
|
||||||
livenessProbe:
|
|
||||||
failureThreshold: 1
|
|
||||||
periodSeconds: 5
|
|
||||||
timeoutSeconds: 1
|
|
||||||
initialDelaySeconds: 20
|
|
||||||
periodSeconds: 15
|
|
||||||
exec:
|
|
||||||
command: ["/bin/grpc_health_probe", "-addr=:$(PORT)"]
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue