Skip to content
......@@ -49,9 +49,12 @@ spec:
- name: HIPSTER_SICK # Used for GCP demo
value: "false"
- name: JAEGER_HOST
value: "jaeger-collector.observability.svc.cluster.local"
- name: JAEGER_PORT
value: "4317"
# value: "jaeger-collector.observability.svc.cluster.local"
valueFrom:
fieldRef:
fieldPath: status.hostIP
# - name: JAEGER_PORT
# value: "6831"
- name: POD_IP
valueFrom:
fieldRef:
......@@ -64,8 +67,6 @@ spec:
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: TINGYUN_LICENSE_KEY
value: "aJvUQ0IMBRBEotyK"
resources:
requests:
cpu: 400m
......
......@@ -40,6 +40,20 @@ spec:
env:
- name: PORT
value: "3550"
# - name: MYSQL_ADDR
# value: "223.193.36.125:3306"
# - name: ConnMaxLifeTime
# value: "100"
# - name: mySQLmaxIdleConns
# value: "10"
# - name: SQL_USER
# value: "elastic"
# - name: SQL_PASSWORD
# value: "elastic"
# - name: DISABLE_STATS
# value: "1"
# - name: DISABLE_TRACING
# value: "1"
- name: DISABLE_PROFILER
value: "1"
- name: JAEGER_SERVICE_ADDR
......
10.0.80.205:5000/hipster/hipster_adservice
10.0.80.205:5000/hipster/hipster_frontend
10.0.80.205:5000/hipster/hipster_cartservice
10.0.80.205:5000/hipster/hipster_currencyservice
10.0.80.205:5000/hipster/hipster_paymentservice
10.0.80.205:5000/hipster/hipster_checkoutservice
10.0.80.205:5000/hipster/hipster_shippingservice
10.0.80.205:5000/hipster/hipster_recommendationservice
10.0.80.205:5000/hipster/hipster_productcatalogservice
10.0.80.205:5000/hipster/hipster_emailservice
# Copyright 2018 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: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: frontend-gateway
spec:
selector:
istio: ingressgateway # use Istio default gateway implementation
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- "*"
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: frontend-ingress
spec:
hosts:
- "*"
gateways:
- frontend-gateway
http:
- route:
- destination:
host: frontend
port:
number: 80
# Copyright 2018 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: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: frontend
spec:
hosts:
- "frontend.default.svc.cluster.local"
http:
- route:
- destination:
host: frontend
port:
number: 80
# Copyright 2018 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: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
name: whitelist-egress-googleapis
spec:
hosts:
- "accounts.google.com" # Used to get token
- "*.googleapis.com"
ports:
- number: 80
protocol: HTTP
name: http
- number: 443
protocol: HTTPS
name: https
---
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
name: whitelist-egress-google-metadata
spec:
hosts:
- metadata.google.internal
addresses:
- 169.254.169.254 # GCE metadata server
ports:
- number: 80
name: http
protocol: HTTP
- number: 443
name: https
protocol: HTTPS
#!/bin/bash
istioctl kube-inject -f adservice.yaml | kubectl -n ts apply -f -
istioctl kube-inject -f checkoutservice.yaml | kubectl -n ts apply -f -
istioctl kube-inject -f emailservice.yaml | kubectl -n ts apply -f -
istioctl kube-inject -f paymentservice.yaml | kubectl -n ts apply -f -
istioctl kube-inject -f recommendationservice.yaml | kubectl -n ts apply -f -
istioctl kube-inject -f shippingservice.yaml | kubectl -n ts apply -f -
istioctl kube-inject -f cartservice.yaml | kubectl -n ts apply -f -
istioctl kube-inject -f currencyservice.yaml | kubectl -n ts apply -f -
istioctl kube-inject -f frontend.yaml | kubectl -n ts apply -f -
istioctl kube-inject -f productcatalogservice.yaml | kubectl -n ts apply -f -
istioctl kube-inject -f redis.yaml | kubectl -n ts apply -f -
# Copyright 2018 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: StatefulSet
metadata:
name: adservice2
spec:
serviceName: adservice2
selector:
matchLabels:
app: adservice
version: "2"
template:
metadata:
labels:
app: adservice
version: "2"
spec:
terminationGracePeriodSeconds: 5
containers:
- name: server
image: hipster/adservice2
ports:
- containerPort: 9555
env:
- name: PORT
value: "9555"
#- name: DISABLE_STATS
# value: "1"
# - name: DISABLE_TRACING
# value: "1"
- name: JAEGER_HOST
value: "jaeger-collector"
- name: ZIPKIN_PORT
value: "9411"
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: SERVICE_NAME
value: "adservice2"
- name: MYSQL_ADDR
value: "basic-tidb.tidb-cluster:4000"
- name: SQL_USER
value: "root"
- name: SQL_PASSWORD
value: ""
resources:
requests:
cpu: 200m
memory: 180Mi
limits:
cpu: 300m
memory: 300Mi
#readinessProbe:
# initialDelaySeconds: 20
# periodSeconds: 15
# exec:
# command: ["/bin/grpc_health_probe", "-addr=:9555"]
#livenessProbe:
# initialDelaySeconds: 20
# periodSeconds: 15
# exec:
# command: ["/bin/grpc_health_probe", "-addr=:9555"]
---
apiVersion: v1
kind: Service
metadata:
name: adservice2
spec:
type: ClusterIP
selector:
app: adservice
version: "2"
ports:
- name: grpc
port: 9555
targetPort: 9555
- port: 8088
protocol: TCP
name: jmx-metrics
# Copyright 2018 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: StatefulSet
metadata:
name: cartservice2
spec:
serviceName: cartservice2
selector:
matchLabels:
app: cartservice
version: "2"
template:
metadata:
labels:
app: cartservice
version: "2"
spec:
terminationGracePeriodSeconds: 5
containers:
- name: server
image: hipster/cartservice2
imagePullPolicy: Always
ports:
- containerPort: 7070
env:
- name: SERVICE_NAME
value: "cartservice2"
- name: REDIS_ADDR
value: "redis-cart2:6379"
- name: PORT
value: "7070"
- name: LISTEN_ADDR
value: "0.0.0.0"
- name: HIPSTER_SICK # Used for GCP demo
value: "false"
- name: JAEGER_HOST
#value: "jaeger"
valueFrom:
fieldRef:
fieldPath: status.hostIP
- name: JAEGER_PORT
value: "6831"
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
resources:
requests:
cpu: 200m
memory: 64Mi
limits:
cpu: 300m
memory: 128Mi
#readinessProbe:
# initialDelaySeconds: 15
# exec:
# command: ["/bin/grpc_health_probe", "-addr=:7070", "-rpc-timeout=5s"]
#livenessProbe:
# initialDelaySeconds: 15
# periodSeconds: 10
# exec:
# command: ["/bin/grpc_health_probe", "-addr=:7070", "-rpc-timeout=5s"]
---
apiVersion: v1
kind: Service
metadata:
name: cartservice2
spec:
type: ClusterIP
selector:
app: cartservice
version: "2"
ports:
- name: grpc
port: 7070
targetPort: 7070
# Copyright 2018 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: StatefulSet
metadata:
name: checkoutservice2
spec:
serviceName: checkoutservice2
selector:
matchLabels:
app: checkoutservice
version: "2"
template:
metadata:
labels:
app: checkoutservice
version: "2"
spec:
containers:
- name: server
image: hipster/checkoutservice2
imagePullPolicy: Always
ports:
- containerPort: 5050
#readinessProbe:
# exec:
# command: ["/bin/grpc_health_probe", "-addr=:5050"]
#livenessProbe:
# exec:
# command: ["/bin/grpc_health_probe", "-addr=:5050"]
env:
- name: PORT
value: "5050"
- name: PRODUCT_CATALOG_SERVICE_ADDR
value: "productcatalogservice2:3550"
- name: SHIPPING_SERVICE_ADDR
value: "shippingservice2:50051"
- name: PAYMENT_SERVICE_ADDR
value: "paymentservice2:50051"
- name: EMAIL_SERVICE_ADDR
value: "emailservice2:5000"
- name: CURRENCY_SERVICE_ADDR
value: "currencyservice2:7000"
- name: CART_SERVICE_ADDR
value: "cartservice2:7070"
#- name: DISABLE_STATS
# value: "1"
#- name: DISABLE_TRACING
# value: "1"
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: DISABLE_PROFILER
value: "1"
- name: JAEGER_SERVICE_ADDR
value: "jaeger-collector:14268/api/traces"
- name: SERVICE_NAME
value: "checkoutservice2"
resources:
requests:
cpu: 100m
memory: 64Mi
limits:
cpu: 200m
memory: 128Mi
---
apiVersion: v1
kind: Service
metadata:
name: checkoutservice2
spec:
type: ClusterIP
selector:
app: checkoutservice
version: "2"
ports:
- name: grpc
port: 5050
targetPort: 5050
# Copyright 2018 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: StatefulSet
metadata:
name: currencyservice2
spec:
serviceName: currencyservice2
selector:
matchLabels:
app: currencyservice
version: "2"
template:
metadata:
labels:
app: currencyservice
version: "2"
spec:
terminationGracePeriodSeconds: 5
containers:
- name: server
image: hipster/currencyservice2
imagePullPolicy: Always
ports:
- name: grpc
containerPort: 7000
env:
- name: PORT
value: "7000"
- name: JAEGER_HOST
#value: "jaeger"
valueFrom:
fieldRef:
fieldPath: status.hostIP
- name: JAEGER_PORT
value: "6832"
#- name: ZIPKIN_COLLECTOR_URL
# value: "http://jaeger-collector:9411/api/v2/spans"
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: SERVICE_NAME
value: "currencyservice2"
#readinessProbe:
# exec:
# command: ["/bin/grpc_health_probe", "-addr=:7000"]
#livenessProbe:
# exec:
# command: ["/bin/grpc_health_probe", "-addr=:7000"]
resources:
requests:
cpu: 100m
memory: 64Mi
limits:
cpu: 200m
memory: 128Mi
---
apiVersion: v1
kind: Service
metadata:
name: currencyservice2
spec:
type: ClusterIP
selector:
app: currencyservice
version: "2"
ports:
- name: grpc
port: 7000
targetPort: 7000
# Copyright 2018 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: StatefulSet
metadata:
name: emailservice2
spec:
serviceName: emailservice2
selector:
matchLabels:
app: emailservice
version: "2"
template:
metadata:
labels:
app: emailservice
version: "2"
spec:
terminationGracePeriodSeconds: 5
containers:
- name: server
image: hipster/emailservice2
ports:
- containerPort: 8080
env:
- name: PORT
value: "8080"
# - name: DISABLE_TRACING
# value: "1"
- name: DISABLE_PROFILER
value: "1"
- name: JAEGER_HOST
value: "jaeger-collector"
- name: SERVICE_NAME
value: "emailservice2"
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
#readinessProbe:
# periodSeconds: 5
# exec:
# command: ["/bin/grpc_health_probe", "-addr=:8080"]
#livenessProbe:
# periodSeconds: 5
# exec:
# command: ["/bin/grpc_health_probe", "-addr=:8080"]
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
cpu: 200m
memory: 512Mi
---
apiVersion: v1
kind: Service
metadata:
name: emailservice2
spec:
type: ClusterIP
selector:
app: emailservice
version: "2"
ports:
- name: grpc
port: 5000
targetPort: 8080
# Copyright 2018 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: StatefulSet
metadata:
name: frontend2
spec:
serviceName: frontend2
selector:
matchLabels:
app: frontend
version: "2"
template:
metadata:
labels:
app: frontend
version: "2"
annotations:
sidecar.istio.io/rewriteAppHTTPProbers: "true"
spec:
containers:
- name: server
image: hipster/frontend2
ports:
- containerPort: 8080
#readinessProbe:
# initialDelaySeconds: 10
# httpGet:
# path: "/_healthz"
# port: 8080
# httpHeaders:
# - name: "Cookie"
# value: "shop_session-id=x-readiness-probe"
#livenessProbe:
# initialDelaySeconds: 10
# httpGet:
# path: "/_healthz"
# port: 8080
# httpHeaders:
# - name: "Cookie"
# value: "shop_session-id=x-liveness-probe"
env:
- name: PORT
value: "8080"
- name: PRODUCT_CATALOG_SERVICE_ADDR
value: "productcatalogservice2:3550"
- name: CURRENCY_SERVICE_ADDR
value: "currencyservice2:7000"
- name: CART_SERVICE_ADDR
value: "cartservice2:7070"
- name: RECOMMENDATION_SERVICE_ADDR
value: "recommendationservice2:8080"
- name: SHIPPING_SERVICE_ADDR
value: "shippingservice2:50051"
- name: CHECKOUT_SERVICE_ADDR
value: "checkoutservice2:5050"
- name: AD_SERVICE_ADDR
value: "adservice2:9555"
- name: ENV_PLATFORM
value: "gcp"
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
# - name: DISABLE_TRACING
# value: "1"
- name: DISABLE_PROFILER
value: "1"
- name: JAEGER_SERVICE_ADDR
value: "jaeger-collector:14268/api/traces"
- name: SERVICE_NAME
value: "frontend2"
resources:
requests:
cpu: 100m
memory: 64Mi
limits:
cpu: 200m
memory: 128Mi
# Copyright 2018 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: StatefulSet
metadata:
name: paymentservice2
spec:
serviceName: paymentservice2
selector:
matchLabels:
app: paymentservice
version: "2"
template:
metadata:
labels:
version: "2"
app: paymentservice
spec:
terminationGracePeriodSeconds: 5
containers:
- name: server
image: hipster/paymentservice2
ports:
- containerPort: 50051
env:
- name: SERVICE_NAME
value: "paymentservice2"
- name: PORT
value: "50051"
- name: JAEGER_HOST
# value: "jaeger"
valueFrom:
fieldRef:
fieldPath: status.hostIP
- name: JAEGER_PORT
value: "6832"
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
#readinessProbe:
# exec:
# command: ["/bin/grpc_health_probe", "-addr=:50051"]
#livenessProbe:
# exec:
# command: ["/bin/grpc_health_probe", "-addr=:50051"]
resources:
requests:
cpu: 100m
memory: 64Mi
limits:
cpu: 200m
memory: 128Mi
---
apiVersion: v1
kind: Service
metadata:
name: paymentservice2
spec:
type: ClusterIP
selector:
app: paymentservice
version: "2"
ports:
- name: grpc
port: 50051
targetPort: 50051
# Copyright 2018 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: StatefulSet
metadata:
name: productcatalogservice2
spec:
serviceName: productcatalogservice2
selector:
matchLabels:
app: productcatalogservice
version: "2"
template:
metadata:
labels:
app: productcatalogservice
version: "2"
spec:
terminationGracePeriodSeconds: 5
containers:
- name: server
image: hipster/productcatalogservice2
ports:
- containerPort: 3550
env:
- name: PORT
value: "3550"
# - name: DISABLE_STATS
# value: "1"
# - name: DISABLE_TRACING
# value: "1"
- name: DISABLE_PROFILER
value: "1"
- name: JAEGER_SERVICE_ADDR
value: "jaeger-collector:14268/api/traces"
- name: SERVICE_NAME
value: "productcatalogservice2"
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: MYSQL_ADDR
value: "basic-tidb-external.tidb-cluster:4000"
- name: SQL_USER
value: "root"
- name: SQL_PASSWORD
value: ""
- name: ConnMaxLifeTime
value: "100"
- name: mySQLmaxIdleConns
value: "10"
#readinessProbe:
# exec:
# command: ["/bin/grpc_health_probe", "-addr=:3550"]
#livenessProbe:
# exec:
# command: ["/bin/grpc_health_probe", "-addr=:3550"]
resources:
requests:
cpu: 100m
memory: 64Mi
limits:
cpu: 200m
memory: 128Mi
---
apiVersion: v1
kind: Service
metadata:
name: productcatalogservice2
spec:
type: ClusterIP
selector:
app: productcatalogservice
version: "2"
ports:
- name: grpc
port: 3550
targetPort: 3550
# Copyright 2018 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: StatefulSet
metadata:
name: recommendationservice2
spec:
serviceName: recommendationservice2
selector:
matchLabels:
app: recommendationservice
version: "2"
template:
metadata:
labels:
app: recommendationservice
version: "2"
spec:
terminationGracePeriodSeconds: 5
containers:
- name: server
image: hipster/recommendationservice2
ports:
- containerPort: 8080
#readinessProbe:
# periodSeconds: 5
# exec:
# command: ["/bin/grpc_health_probe", "-addr=:8080"]
#livenessProbe:
# periodSeconds: 5
# exec:
# command: ["/bin/grpc_health_probe", "-addr=:8080"]
env:
- name: PORT
value: "8080"
- name: PRODUCT_CATALOG_SERVICE_ADDR
value: "productcatalogservice:3550"
- name: JAEGER_HOST
value: "jaeger-collector"
- name: SERVICE_NAME
value: "recommendationservice2"
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
resources:
requests:
cpu: 100m
memory: 220Mi
limits:
cpu: 200m
memory: 450Mi
---
apiVersion: v1
kind: Service
metadata:
name: recommendationservice2
spec:
type: ClusterIP
selector:
app: recommendationservice
version: "2"
ports:
- name: grpc
port: 8080
targetPort: 8080
# Copyright 2018 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: StatefulSet
metadata:
name: redis-cart2
spec:
serviceName: redis-cart2
selector:
matchLabels:
app: redis-cart
version: "2"
template:
metadata:
labels:
app: redis-cart
version: "2"
spec:
containers:
- name: redis
image: redis:alpine
ports:
- containerPort: 6379
readinessProbe:
periodSeconds: 5
tcpSocket:
port: 6379
livenessProbe:
periodSeconds: 5
tcpSocket:
port: 6379
volumeMounts:
- mountPath: /data
name: redis-data
resources:
limits:
memory: 256Mi
cpu: 125m
requests:
cpu: 70m
memory: 200Mi
volumes:
- name: redis-data
emptyDir: {}
---
apiVersion: v1
kind: Service
metadata:
name: redis-cart2
spec:
type: ClusterIP
selector:
app: redis-cart
version: "2"
ports:
- name: redis
port: 6379
targetPort: 6379
# Copyright 2018 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: StatefulSet
metadata:
name: shippingservice2
spec:
serviceName: shippingservice2
selector:
matchLabels:
app: shippingservice
version: "2"
template:
metadata:
labels:
app: shippingservice
version: "2"
spec:
containers:
- name: server
image: hipster/shippingservice2
ports:
- containerPort: 50051
env:
- name: PORT
value: "50051"
#- name: DISABLE_STATS
# value: "1"
# - name: DISABLE_TRACING
# value: "1"
- name: DISABLE_PROFILER
value: "1"
- name: JAEGER_SERVICE_ADDR
value: "jaeger-collector:14268/api/traces"
- name: SERVICE_NAME
value: "shippingservice2"
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
#readinessProbe:
# periodSeconds: 5
# exec:
# command: ["/bin/grpc_health_probe", "-addr=:50051"]
#livenessProbe:
# exec:
# command: ["/bin/grpc_health_probe", "-addr=:50051"]
resources:
requests:
cpu: 100m
memory: 64Mi
limits:
cpu: 200m
memory: 128Mi
---
apiVersion: v1
kind: Service
metadata:
name: shippingservice2
spec:
type: ClusterIP
selector:
app: shippingservice
version: "2"
ports:
- name: grpc
port: 50051
targetPort: 50051
# ./kubernetes-manifests
:warning: Kubernetes manifests provided in this directory are not directly
deployable to a cluster. They are meant to be used with `skaffold` command to
insert the correct `image:` tags.
Use the manifests in [/release](/release) directory which are configured with
pre-built public images.
# Copyright 2018 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.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: StatefulSet
metadata:
name: adservice
spec:
serviceName: adservice
selector:
matchLabels:
app: adservice
version: "1"
replicas: 3
template:
metadata:
labels:
app: adservice
version: "1"
spec:
terminationGracePeriodSeconds: 5
containers:
- name: server
image: hipster/adservice
ports:
- containerPort: 9555
env:
- name: PORT
value: "9555"
#- name: DISABLE_STATS
# value: "1"
# - name: DISABLE_TRACING
# value: "1"
- name: JAEGER_HOST
value: "jaeger-collector"
- name: ZIPKIN_PORT
value: "9411"
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: SERVICE_NAME
value: "adservice"
- name: MYSQL_ADDR
value: "basic-tidb.tidb-cluster:4000"
- name: SQL_USER
value: "root"
- name: SQL_PASSWORD
value: ""
resources:
requests:
cpu: 400m
memory: 360Mi
limits:
cpu: 600m
memory: 600Mi
#readinessProbe:
# initialDelaySeconds: 20
# periodSeconds: 15
# exec:
# command: ["/bin/grpc_health_probe", "-addr=:9555"]
#livenessProbe:
# initialDelaySeconds: 20
# periodSeconds: 15
# exec:
# command: ["/bin/grpc_health_probe", "-addr=:9555"]
---
apiVersion: v1
kind: Service
metadata:
name: adservice
spec:
type: ClusterIP
selector:
app: adservice
version: "1"
ports:
- name: grpc
port: 9555
targetPort: 9555
- port: 8088
protocol: TCP
name: jmx-metrics