helm chart
This commit is contained in:
6
K8s/helm/Chart.yaml
Normal file
6
K8s/helm/Chart.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
apiVersion: v1
|
||||
name: robot-shop
|
||||
version: 1.0.0
|
||||
home: https://github.com/instana/robot-shop
|
||||
description: Sample micoservices application
|
||||
|
41
K8s/helm/README.md
Normal file
41
K8s/helm/README.md
Normal file
@@ -0,0 +1,41 @@
|
||||
# Stan's Robot Shop
|
||||
|
||||
Use this helm chart to customise your install of Stan's Robot Shop.
|
||||
|
||||
## Images
|
||||
|
||||
By default the images are pulled from Docker Hub. Setting `image.repo` this can be changed, for example:
|
||||
|
||||
```shell
|
||||
$ helm install --set image.repo=eu.gcr.io/acme ...
|
||||
```
|
||||
|
||||
Will pull images from the European Google registry project `acme`.
|
||||
|
||||
By default the latest version of the images is pulled. A specific version can be used:
|
||||
|
||||
```shell
|
||||
$ helm install --set image.version=0.1.2 ...
|
||||
```
|
||||
|
||||
It is recommened to always use the latest version.
|
||||
|
||||
## Payment Gateway
|
||||
|
||||
By default the `payment` service uses https://www.paypal.com as the pseudo payment provider. The code only does a HTTP GET against this url. You use a different url.
|
||||
|
||||
```shell
|
||||
$ helm install --set payment.gateway=https://foobar.com ...
|
||||
```
|
||||
|
||||
## End User Monitoring
|
||||
|
||||
Optionally End User Monitoring can be enabled for the web pages. Take a look at the [documentation](https://docs.instana.io/products/website_monitoring/) to see how to get a key and an endpoint url.
|
||||
|
||||
```shell
|
||||
$ helm install \
|
||||
--set eum.key=xxxxxxxxx \
|
||||
--set eum.url=https://eum-eu-west-1.instana.io \
|
||||
...
|
||||
```
|
||||
|
34
K8s/helm/templates/cart-deployment.yaml
Normal file
34
K8s/helm/templates/cart-deployment.yaml
Normal file
@@ -0,0 +1,34 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: cart
|
||||
labels:
|
||||
service: cart
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
service: cart
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
service: cart
|
||||
spec:
|
||||
containers:
|
||||
- name: cart
|
||||
image: {{ .Values.image.repo }}/rs-cart:{{ .Values.image.version }}
|
||||
# agent networking access
|
||||
env:
|
||||
- name: INSTANA_AGENT_HOST
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: status.hostIP
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
resources:
|
||||
limits:
|
||||
cpu: 200m
|
||||
memory: 100Mi
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 50Mi
|
11
K8s/helm/templates/cart-service.yaml
Normal file
11
K8s/helm/templates/cart-service.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: cart
|
||||
spec:
|
||||
ports:
|
||||
- name: http
|
||||
port: 8080
|
||||
targetPort: 8080
|
||||
selector:
|
||||
service: cart
|
34
K8s/helm/templates/catalogue-deployment.yaml
Normal file
34
K8s/helm/templates/catalogue-deployment.yaml
Normal file
@@ -0,0 +1,34 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: catalogue
|
||||
labels:
|
||||
service: catalogue
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
service: catalogue
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
service: catalogue
|
||||
spec:
|
||||
containers:
|
||||
- name: catalogue
|
||||
image: {{ .Values.image.repo }}/rs-catalogue:{{ .Values.image.version }}
|
||||
env:
|
||||
- name: INSTANA_AGENT_HOST
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: status.hostIP
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
resources:
|
||||
limits:
|
||||
cpu: 200m
|
||||
memory: 100Mi
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 50Mi
|
||||
restartPolicy: Always
|
13
K8s/helm/templates/catalogue-service.yaml
Normal file
13
K8s/helm/templates/catalogue-service.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
service: catalogue
|
||||
name: catalogue
|
||||
spec:
|
||||
ports:
|
||||
- name: http
|
||||
port: 8080
|
||||
targetPort: 8080
|
||||
selector:
|
||||
service: catalogue
|
33
K8s/helm/templates/dispatch-deployment.yaml
Normal file
33
K8s/helm/templates/dispatch-deployment.yaml
Normal file
@@ -0,0 +1,33 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: dispatch
|
||||
labels:
|
||||
service: dispatch
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
service: dispatch
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
service: dispatch
|
||||
spec:
|
||||
containers:
|
||||
- name: dispatch
|
||||
image: {{ .Values.image.repo }}/rs-dispatch:{{ .Values.image.version }}
|
||||
env:
|
||||
# agent networking access
|
||||
- name: INSTANA_AGENT_HOST
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: status.hostIP
|
||||
resources:
|
||||
limits:
|
||||
cpu: 200m
|
||||
memory: 100Mi
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 50Mi
|
||||
restartPolicy: Always
|
16
K8s/helm/templates/dispatch-service.yaml
Normal file
16
K8s/helm/templates/dispatch-service.yaml
Normal file
@@ -0,0 +1,16 @@
|
||||
# dispatch just listens to a message queue
|
||||
# it does not expose any ports
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: dispatch
|
||||
labels:
|
||||
service: dispatch
|
||||
spec:
|
||||
clusterIP: None
|
||||
ports:
|
||||
- name: headless
|
||||
port: 55555
|
||||
targetPort: 0
|
||||
selector:
|
||||
service: dispatch
|
29
K8s/helm/templates/mongodb-deployment.yaml
Normal file
29
K8s/helm/templates/mongodb-deployment.yaml
Normal file
@@ -0,0 +1,29 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: mongodb
|
||||
labels:
|
||||
service: mongodb
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
service: mongodb
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
service: mongodb
|
||||
spec:
|
||||
containers:
|
||||
- name: mongodb
|
||||
image: {{ .Values.image.repo }}/rs-mongodb:{{ .Values.image.version }}
|
||||
ports:
|
||||
- containerPort: 27017
|
||||
resources:
|
||||
limits:
|
||||
cpu: 200m
|
||||
memory: 200Mi
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 100Mi
|
||||
restartPolicy: Always
|
13
K8s/helm/templates/mongodb-service.yaml
Normal file
13
K8s/helm/templates/mongodb-service.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
service: mongodb
|
||||
name: mongodb
|
||||
spec:
|
||||
ports:
|
||||
- name: mongo
|
||||
port: 27017
|
||||
targetPort: 27017
|
||||
selector:
|
||||
service: mongodb
|
35
K8s/helm/templates/mysql-deployment.yaml
Normal file
35
K8s/helm/templates/mysql-deployment.yaml
Normal file
@@ -0,0 +1,35 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: mysql
|
||||
labels:
|
||||
service: mysql
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
service: mysql
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
service: mysql
|
||||
annotations:
|
||||
sidecar.istio.io/inject: "false"
|
||||
spec:
|
||||
containers:
|
||||
- name: mysql
|
||||
image: {{ .Values.image.repo }}/rs-mysql-db:{{ .Values.image.version }}
|
||||
# added for Istio
|
||||
securityContext:
|
||||
capabilities:
|
||||
add: ["NET_ADMIN"]
|
||||
ports:
|
||||
- containerPort: 3306
|
||||
resources:
|
||||
limits:
|
||||
cpu: 200m
|
||||
memory: 800Mi
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 400Mi
|
||||
restartPolicy: Always
|
13
K8s/helm/templates/mysql-service.yaml
Normal file
13
K8s/helm/templates/mysql-service.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
service: mysql
|
||||
name: mysql
|
||||
spec:
|
||||
ports:
|
||||
- name: mysql
|
||||
port: 3306
|
||||
targetPort: 3306
|
||||
selector:
|
||||
service: mysql
|
42
K8s/helm/templates/payment-deployment.yaml
Normal file
42
K8s/helm/templates/payment-deployment.yaml
Normal file
@@ -0,0 +1,42 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: payment
|
||||
labels:
|
||||
service: payment
|
||||
stage: prod
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
service: payment
|
||||
stage: prod
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
service: payment
|
||||
stage: prod
|
||||
spec:
|
||||
containers:
|
||||
- name: payment
|
||||
image: {{ .Values.image.repo }}/rs-payment:{{ .Values.image.version }}
|
||||
# agent networking access
|
||||
env:
|
||||
- name: INSTANA_AGENT_HOST
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: status.hostIP
|
||||
{{- if .Values.payment.gateway }}
|
||||
- name: PAYMENT_GATEWAY
|
||||
value: {{ .Values.payment.gateway }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
resources:
|
||||
limits:
|
||||
cpu: 200m
|
||||
memory: 100Mi
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 50Mi
|
||||
restartPolicy: Always
|
13
K8s/helm/templates/payment-service.yaml
Normal file
13
K8s/helm/templates/payment-service.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: payment
|
||||
labels:
|
||||
service: payment
|
||||
spec:
|
||||
ports:
|
||||
- name: http
|
||||
port: 8080
|
||||
targetPort: 8080
|
||||
selector:
|
||||
service: payment
|
30
K8s/helm/templates/rabbitmq-deployment.yaml
Normal file
30
K8s/helm/templates/rabbitmq-deployment.yaml
Normal file
@@ -0,0 +1,30 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: rabbitmq
|
||||
labels:
|
||||
service: rabbitmq
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
service: rabbitmq
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
service: rabbitmq
|
||||
spec:
|
||||
containers:
|
||||
- name: rabbitmq
|
||||
image: rabbitmq:3.7-management-alpine
|
||||
ports:
|
||||
- containerPort: 5672
|
||||
- containerPort: 15672
|
||||
resources:
|
||||
limits:
|
||||
cpu: 200m
|
||||
memory: 512Mi
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 256Mi
|
||||
restartPolicy: Always
|
19
K8s/helm/templates/rabbitmq-service.yaml
Normal file
19
K8s/helm/templates/rabbitmq-service.yaml
Normal file
@@ -0,0 +1,19 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: rabbitmq
|
||||
labels:
|
||||
service: rabbitmq
|
||||
spec:
|
||||
ports:
|
||||
- name: tcp-amqp
|
||||
port: 5672
|
||||
targetPort: 5672
|
||||
- name: http-management
|
||||
port: 15672
|
||||
targetPort: 15672
|
||||
- name: tcp-epmd
|
||||
port: 4369
|
||||
targetPort: 4369
|
||||
selector:
|
||||
service: rabbitmq
|
29
K8s/helm/templates/ratings-deployment.yaml
Normal file
29
K8s/helm/templates/ratings-deployment.yaml
Normal file
@@ -0,0 +1,29 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: ratings
|
||||
labels:
|
||||
service: ratings
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
service: ratings
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
service: ratings
|
||||
spec:
|
||||
containers:
|
||||
- name: ratings
|
||||
image: {{ .Values.image.repo }}/rs-ratings:{{ .Values.image.version }}
|
||||
ports:
|
||||
- containerPort: 80
|
||||
resources:
|
||||
limits:
|
||||
cpu: 200m
|
||||
memory: 100Mi
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 50Mi
|
||||
restartPolicy: Always
|
14
K8s/helm/templates/ratings-service.yaml
Normal file
14
K8s/helm/templates/ratings-service.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: ratings
|
||||
labels:
|
||||
service: ratings
|
||||
spec:
|
||||
ports:
|
||||
- name: http
|
||||
port: 80
|
||||
targetPort: 80
|
||||
selector:
|
||||
service: ratings
|
||||
|
29
K8s/helm/templates/redis-deployment.yaml
Normal file
29
K8s/helm/templates/redis-deployment.yaml
Normal file
@@ -0,0 +1,29 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
service: redis
|
||||
name: redis
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
service: redis
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
service: redis
|
||||
spec:
|
||||
containers:
|
||||
- name: redis
|
||||
image: redis:4.0.6
|
||||
ports:
|
||||
- containerPort: 6379
|
||||
resources:
|
||||
limits:
|
||||
cpu: 200m
|
||||
memory: 100Mi
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 50Mi
|
||||
restartPolicy: Always
|
13
K8s/helm/templates/redis-service.yaml
Normal file
13
K8s/helm/templates/redis-service.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
service: redis
|
||||
name: redis
|
||||
spec:
|
||||
ports:
|
||||
- name: redis
|
||||
port: 6379
|
||||
targetPort: 6379
|
||||
selector:
|
||||
service: redis
|
30
K8s/helm/templates/shipping-deployment.yaml
Normal file
30
K8s/helm/templates/shipping-deployment.yaml
Normal file
@@ -0,0 +1,30 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: shipping
|
||||
labels:
|
||||
service: shipping
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
service: shipping
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
service: shipping
|
||||
spec:
|
||||
containers:
|
||||
- name: shipping
|
||||
image: {{ .Values.image.repo }}/rs-shipping:{{ .Values.image.version }}
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
# it's Java it needs lots of memory
|
||||
resources:
|
||||
limits:
|
||||
cpu: 200m
|
||||
memory: 1000Mi
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 500Mi
|
||||
restartPolicy: Always
|
13
K8s/helm/templates/shipping-service.yaml
Normal file
13
K8s/helm/templates/shipping-service.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: shipping
|
||||
labels:
|
||||
service: shipping
|
||||
spec:
|
||||
ports:
|
||||
- name: http
|
||||
port: 8080
|
||||
targetPort: 8080
|
||||
selector:
|
||||
service: shipping
|
35
K8s/helm/templates/user-deployment.yaml
Normal file
35
K8s/helm/templates/user-deployment.yaml
Normal file
@@ -0,0 +1,35 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: user
|
||||
labels:
|
||||
service: user
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
service: user
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
service: user
|
||||
spec:
|
||||
containers:
|
||||
- name: user
|
||||
image: {{ .Values.image.repo }}/rs-user:{{ .Values.image.version }}
|
||||
env:
|
||||
# agent networking access
|
||||
- name: INSTANA_AGENT_HOST
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: status.hostIP
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
resources:
|
||||
limits:
|
||||
cpu: 200m
|
||||
memory: 100Mi
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 50Mi
|
||||
restartPolicy: Always
|
13
K8s/helm/templates/user-service.yaml
Normal file
13
K8s/helm/templates/user-service.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: user
|
||||
labels:
|
||||
service: user
|
||||
spec:
|
||||
ports:
|
||||
- name: http
|
||||
port: 8080
|
||||
targetPort: 8080
|
||||
selector:
|
||||
service: user
|
36
K8s/helm/templates/web-deployment.yaml
Normal file
36
K8s/helm/templates/web-deployment.yaml
Normal file
@@ -0,0 +1,36 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: web
|
||||
labels:
|
||||
service: web
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
service: web
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
service: web
|
||||
spec:
|
||||
containers:
|
||||
- name: web
|
||||
image: {{ .Values.image.repo }}/rs-web:{{ .Values.image.version }}
|
||||
{{- if .Values.eum.key }}
|
||||
env:
|
||||
- name: INSTANA_EUM_KEY
|
||||
value: {{ .Values.eum.key }}
|
||||
- name: INSTANA_EUM_REPORTING_URL
|
||||
value: {{ .Values.eum.url }}
|
||||
{{- end}}
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
resources:
|
||||
limits:
|
||||
cpu: 200m
|
||||
memory: 100Mi
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 50Mi
|
||||
restartPolicy: Always
|
14
K8s/helm/templates/web-service.yaml
Normal file
14
K8s/helm/templates/web-service.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: web
|
||||
labels:
|
||||
service: web
|
||||
spec:
|
||||
ports:
|
||||
- name: http
|
||||
port: 8080
|
||||
targetPort: 8080
|
||||
selector:
|
||||
service: web
|
||||
type: LoadBalancer
|
19
K8s/helm/values.yaml
Normal file
19
K8s/helm/values.yaml
Normal file
@@ -0,0 +1,19 @@
|
||||
# Registry and rpository for Docker images
|
||||
# Default is docker/robotshop/image:latest
|
||||
image:
|
||||
repo: robotshop
|
||||
version: latest
|
||||
|
||||
# Alternative payment gateway URL
|
||||
# Default is https://www.paypal.com
|
||||
payment:
|
||||
gateway: null
|
||||
#gateway: https://www.worldpay.com
|
||||
|
||||
# EUM configuration
|
||||
# Provide your key and set the endpoint
|
||||
eum:
|
||||
key: null
|
||||
url: https://eum-eu-west-1.instana.io
|
||||
#url: https://eum-us-west-2.instana.io
|
||||
|
Reference in New Issue
Block a user