Skip to content

Commit

Permalink
Merge pull request #3 from Killpit/master
Browse files Browse the repository at this point in the history
Add GKE files to demo
  • Loading branch information
iam-veeramalla authored Mar 25, 2024
2 parents 04ce807 + 9030cce commit 687a876
Show file tree
Hide file tree
Showing 32 changed files with 957 additions and 0 deletions.
5 changes: 5 additions & 0 deletions GKE/helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
name: robot-shop
version: 1.1.0
home: https://github.com/instana/robot-shop
description: Sample micoservices application
12 changes: 12 additions & 0 deletions GKE/helm/gclb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: robot-shop-gclb
annotations:
kubernetes.io/ingress.backend: "robot-shop"
kubernetes.io/ingress.class: gce
spec:
backend:
serviceName: "robot-shop"
servicePort: 8080

17 changes: 17 additions & 0 deletions GKE/helm/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
namespace: robot-shop
name: robot-shop
spec:
ingressClassName: gce
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: web
port:
number: 8080
50 changes: 50 additions & 0 deletions GKE/helm/templates/cart-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: cart
labels:
service: cart
spec:
replicas: 1
selector:
matchLabels:
service: cart
template:
metadata:
labels:
service: cart
spec:
{{ if .Values.psp.enabled }}
serviceAccountName: robot-shop
{{ end }}
containers:
- name: cart
image: {{ .Values.image.repo }}/rs-cart:{{ .Values.image.version }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
# 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
{{- with .Values.cart.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.cart.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.cart.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
11 changes: 11 additions & 0 deletions GKE/helm/templates/cart-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: cart
spec:
ports:
- name: http
port: 8080
targetPort: 8080
selector:
service: cart
50 changes: 50 additions & 0 deletions GKE/helm/templates/catalogue-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: catalogue
labels:
service: catalogue
spec:
replicas: 1
selector:
matchLabels:
service: catalogue
template:
metadata:
labels:
service: catalogue
spec:
{{ if .Values.psp.enabled }}
serviceAccountName: robot-shop
{{ end }}
containers:
- name: catalogue
image: {{ .Values.image.repo }}/rs-catalogue:{{ .Values.image.version }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
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
{{- with .Values.catalogue.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.catalogue.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.catalogue.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
13 changes: 13 additions & 0 deletions GKE/helm/templates/catalogue-service.yaml
Original file line number Diff line number Diff line change
@@ -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
15 changes: 15 additions & 0 deletions GKE/helm/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{ if .Values.psp.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: robot-shop
rules:
- apiGroups:
- policy
resourceNames:
- robot-shop
resources:
- podsecuritypolicies
verbs:
- use
{{ end }}
14 changes: 14 additions & 0 deletions GKE/helm/templates/clusterrolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{ if .Values.psp.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: robot-shop
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: robot-shop
subjects:
- kind: ServiceAccount
name: robot-shop
namespace: robot-shop
{{ end }}
49 changes: 49 additions & 0 deletions GKE/helm/templates/dispatch-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: dispatch
labels:
service: dispatch
spec:
replicas: 1
selector:
matchLabels:
service: dispatch
template:
metadata:
labels:
service: dispatch
spec:
{{ if .Values.psp.enabled }}
serviceAccountName: robot-shop
{{ end }}
containers:
- name: dispatch
image: {{ .Values.image.repo }}/rs-dispatch:{{ .Values.image.version }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
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
{{- with .Values.dispatch.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.dispatch.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.dispatch.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
16 changes: 16 additions & 0 deletions GKE/helm/templates/dispatch-service.yaml
Original file line number Diff line number Diff line change
@@ -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
45 changes: 45 additions & 0 deletions GKE/helm/templates/mongodb-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: mongodb
labels:
service: mongodb
spec:
replicas: 1
selector:
matchLabels:
service: mongodb
template:
metadata:
labels:
service: mongodb
spec:
{{ if .Values.psp.enabled }}
serviceAccountName: robot-shop
{{ end }}
containers:
- name: mongodb
image: {{ .Values.image.repo }}/rs-mongodb:{{ .Values.image.version }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- containerPort: 27017
resources:
limits:
cpu: 200m
memory: 200Mi
requests:
cpu: 100m
memory: 100Mi
restartPolicy: Always
{{- with .Values.mongodb.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.mongodb.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.mongodb.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
13 changes: 13 additions & 0 deletions GKE/helm/templates/mongodb-service.yaml
Original file line number Diff line number Diff line change
@@ -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
49 changes: 49 additions & 0 deletions GKE/helm/templates/mysql-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: mysql
labels:
service: mysql
spec:
replicas: 1
selector:
matchLabels:
service: mysql
template:
metadata:
labels:
service: mysql
spec:
{{ if .Values.psp.enabled }}
serviceAccountName: robot-shop
{{ end }}
containers:
- name: mysql
image: {{ .Values.image.repo }}/rs-mysql-db:{{ .Values.image.version }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
# added for Istio
securityContext:
capabilities:
add: ["NET_ADMIN"]
ports:
- containerPort: 3306
resources:
limits:
cpu: 200m
memory: 1024Mi
requests:
cpu: 100m
memory: 700Mi
restartPolicy: Always
{{- with .Values.mysql.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.mysql.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.mysql.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
Loading

0 comments on commit 687a876

Please sign in to comment.