Skip to content

Commit

Permalink
service-mesh: add emojivoto example
Browse files Browse the repository at this point in the history
  • Loading branch information
3u13r committed Feb 14, 2024
1 parent 0c824c9 commit 94e09a6
Show file tree
Hide file tree
Showing 8 changed files with 427 additions and 1 deletion.
48 changes: 48 additions & 0 deletions deployments/emojivoto-sm-egress/coordinator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: coordinator
namespace: edg-default
spec:
selector:
matchLabels:
app.kubernetes.io/name: coordinator
replicas: 1
template:
metadata:
labels:
app.kubernetes.io/name: coordinator
annotations:
nunki.edgeless.systems/pod-role: coordinator
spec:
runtimeClassName: kata-cc-isolation
containers:
- name: coordinator
image: "ghcr.io/edgelesssys/nunki/coordinator:latest"
ports:
- containerPort: 7777
- containerPort: 1313
env:
- name: NUNKI_LOG_LEVEL
value: "debug"
resources:
requests:
memory: 100Mi
limits:
memory: 100Mi
---
apiVersion: v1
kind: Service
metadata:
name: coordinator
namespace: edg-default
spec:
ports:
- name: intercom
port: 7777
protocol: TCP
- name: coordapi
port: 1313
protocol: TCP
selector:
app.kubernetes.io/name: coordinator
90 changes: 90 additions & 0 deletions deployments/emojivoto-sm-egress/emoji.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
kind: ServiceAccount
apiVersion: v1
metadata:
name: emoji
namespace: edg-default
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: emoji
namespace: edg-default
labels:
app.kubernetes.io/name: emoji
app.kubernetes.io/part-of: emojivoto
app.kubernetes.io/version: v11
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: emoji-svc
version: v11
template:
metadata:
labels:
app.kubernetes.io/name: emoji-svc
version: v11
spec:
runtimeClassName: kata-cc-isolation
initContainers:
- name: initializer
image: "ghcr.io/edgelesssys/nunki/initializer:latest"
env:
- name: COORDINATOR_HOST
value: coordinator
volumeMounts:
- name: tls-certs
mountPath: /tls-config
resources:
requests:
memory: 50Mi
limits:
memory: 50Mi
serviceAccountName: emoji
containers:
- env:
- name: GRPC_PORT
value: "8080"
- name: PROM_PORT
value: "8801"
- name: EDG_CERT_PATH
value: /tls-config/certChain.pem
- name: EDG_CA_PATH
value: /tls-config/MeshCACert.pem
- name: EDG_KEY_PATH
value: /tls-config/key.pem
image: ghcr.io/3u13r/emojivoto-emoji-svc:coco-1
name: emoji-svc
ports:
- containerPort: 8080
name: grpc
- containerPort: 8801
name: prom
resources:
requests:
cpu: 100m
memory: 50Mi
limits:
memory: 50Mi
volumeMounts:
- name: tls-certs
mountPath: /tls-config
volumes:
- name: tls-certs
emptyDir: {}
---
apiVersion: v1
kind: Service
metadata:
name: emoji-svc
namespace: edg-default
spec:
selector:
app.kubernetes.io/name: emoji-svc
ports:
- name: grpc
port: 8080
targetPort: 8080
- name: prom
port: 8801
targetPort: 8801
4 changes: 4 additions & 0 deletions deployments/emojivoto-sm-egress/ns.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: edg-default
59 changes: 59 additions & 0 deletions deployments/emojivoto-sm-egress/portforwarder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
apiVersion: v1
kind: Pod
metadata:
name: port-forwarder-coordinator
namespace: edg-default
labels:
app.kubernetes.io/name: port-forwarder-coordinator
spec:
containers:
- name: port-forwarder
image: "ghcr.io/edgelesssys/nunki/port-forwarder:latest"
env:
- name: LISTEN_PORT
value: "1313"
- name: FORWARD_HOST
value: coordinator
- name: FORWARD_PORT
value: "1313"
command:
- /bin/bash
- "-c"
- echo Starting port-forward with socat; exec socat -d -d TCP-LISTEN:${LISTEN_PORT},fork TCP:${FORWARD_HOST}:${FORWARD_PORT}
ports:
- containerPort: 1313
resources:
requests:
memory: 50Mi
limits:
memory: 50Mi
---
apiVersion: v1
kind: Pod
metadata:
name: port-forwarder-emojivoto-web
namespace: edg-default
labels:
app.kubernetes.io/name: port-forwarder-emojivoto-web
spec:
containers:
- name: port-forwarder
image: "ghcr.io/edgelesssys/nunki/port-forwarder:latest"
env:
- name: LISTEN_PORT
value: "8080"
- name: FORWARD_HOST
value: web-svc
- name: FORWARD_PORT
value: "443"
command:
- /bin/bash
- "-c"
- echo Starting port-forward with socat; exec socat -d -d TCP-LISTEN:${LISTEN_PORT},fork TCP:${FORWARD_HOST}:${FORWARD_PORT}
ports:
- containerPort: 8080
resources:
requests:
memory: 50Mi
limits:
memory: 50Mi
35 changes: 35 additions & 0 deletions deployments/emojivoto-sm-egress/vote-bot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: vote-bot
namespace: edg-default
labels:
app.kubernetes.io/name: vote-bot
app.kubernetes.io/part-of: emojivoto
app.kubernetes.io/version: v11
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: vote-bot
version: v11
template:
metadata:
labels:
app.kubernetes.io/name: vote-bot
version: v11
spec:
containers:
- command:
- emojivoto-vote-bot
env:
- name: WEB_HOST
value: web-svc:443
image: docker.l5d.io/buoyantio/emojivoto-web:v11
name: vote-bot
resources:
requests:
cpu: 10m
memory: 25Mi
limits:
memory: 25Mi
90 changes: 90 additions & 0 deletions deployments/emojivoto-sm-egress/voting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
kind: ServiceAccount
apiVersion: v1
metadata:
name: voting
namespace: edg-default
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: voting
namespace: edg-default
labels:
app.kubernetes.io/name: voting
app.kubernetes.io/part-of: emojivoto
app.kubernetes.io/version: v11
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: voting-svc
version: v11
template:
metadata:
labels:
app.kubernetes.io/name: voting-svc
version: v11
spec:
runtimeClassName: kata-cc-isolation
initContainers:
- name: initializer
image: "ghcr.io/edgelesssys/nunki/initializer:latest"
env:
- name: COORDINATOR_HOST
value: coordinator
volumeMounts:
- name: tls-certs
mountPath: /tls-config
resources:
requests:
memory: 50Mi
limits:
memory: 50Mi
serviceAccountName: voting
containers:
- env:
- name: GRPC_PORT
value: "8080"
- name: PROM_PORT
value: "8801"
- name: EDG_CERT_PATH
value: /tls-config/certChain.pem
- name: EDG_CA_PATH
value: /tls-config/MeshCACert.pem
- name: EDG_KEY_PATH
value: /tls-config/key.pem
image: ghcr.io/3u13r/emojivoto-voting-svc:coco-1
name: voting-svc
ports:
- containerPort: 8080
name: grpc
- containerPort: 8801
name: prom
resources:
requests:
cpu: 100m
memory: 50Mi
limits:
memory: 50Mi
volumeMounts:
- name: tls-certs
mountPath: /tls-config
volumes:
- name: tls-certs
emptyDir: {}
---
apiVersion: v1
kind: Service
metadata:
name: voting-svc
namespace: edg-default
spec:
selector:
app.kubernetes.io/name: voting-svc
ports:
- name: grpc
port: 8080
targetPort: 8080
- name: prom
port: 8801
targetPort: 8801
Loading

0 comments on commit 94e09a6

Please sign in to comment.