Skip to content

Commit

Permalink
deployments: add emojivoto
Browse files Browse the repository at this point in the history
  • Loading branch information
3u13r committed Dec 19, 2023
1 parent aabc133 commit 4a9bca3
Show file tree
Hide file tree
Showing 8 changed files with 420 additions and 0 deletions.
44 changes: 44 additions & 0 deletions deployments/emojivoto/coordinator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: coordinator-kbs
namespace: edg-emojivoto
spec:
selector:
matchLabels:
run: coordinator-kbs
replicas: 1
template:
metadata:
labels:
run: coordinator-kbs
spec:
runtimeClassName: kata-cc-isolation
containers:
- name: coordinator-kbs
image: "ghcr.io/katexochen/coordinator-kbs:latest"
imagePullPolicy: Always
ports:
- containerPort: 7777
- containerPort: 1313
env:
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
---
apiVersion: v1
kind: Service
metadata:
name: coordinator-kbs
namespace: edg-emojivoto
spec:
ports:
- name: intercom
port: 7777
protocol: TCP
- name: coordapi
port: 1313
protocol: TCP
selector:
run: coordinator-kbs
84 changes: 84 additions & 0 deletions deployments/emojivoto/emoji.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
kind: ServiceAccount
apiVersion: v1
metadata:
name: emoji
namespace: edg-emojivoto
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: emoji
namespace: edg-emojivoto
labels:
app.kubernetes.io/name: emoji
app.kubernetes.io/part-of: emojivoto
app.kubernetes.io/version: v11
spec:
replicas: 1
selector:
matchLabels:
app: emoji-svc
version: v11
template:
metadata:
labels:
app: emoji-svc
version: v11
spec:
runtimeClassName: kata-cc-isolation
initContainers:
- name: initializer
image: "ghcr.io/katexochen/initializer:latest"
imagePullPolicy: Always
env:
- name: COORDINATOR_HOST
value: coordinator-kbs.edg-emojivoto
volumeMounts:
- name: tls-certs
mountPath: /tls-config
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/CACert.pem
- name: EDG_KEY_PATH
value: /tls-config/key.pem
image: ghcr.io/3u13r/emojivoto-emoji-svc:coco-1
imagePullPolicy: Always
name: emoji-svc
ports:
- containerPort: 8080
name: grpc
- containerPort: 8801
name: prom
resources:
requests:
cpu: 100m
volumeMounts:
- name: tls-certs
mountPath: /tls-config
volumes:
- name: tls-certs
emptyDir: {}
---
apiVersion: v1
kind: Service
metadata:
name: emoji-svc
namespace: edg-emojivoto
spec:
selector:
app: emoji-svc
ports:
- name: grpc
port: 8080
targetPort: 8080
- name: prom
port: 8801
targetPort: 8801
40 changes: 40 additions & 0 deletions deployments/emojivoto/initializer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: workload
namespace: edg-emojivoto
spec:
selector:
matchLabels:
run: workload
replicas: 1
template:
metadata:
labels:
run: workload
spec:
runtimeClassName: kata-cc-isolation
initContainers:
- name: initializer
image: "ghcr.io/katexochen/initializer:latest"
imagePullPolicy: Always
env:
- name: COORDINATOR_HOST
value: coordinator-kbs.edg-emojivoto
volumeMounts:
- name: tls-certs
mountPath: /tls-config
containers:
- name: workload
image: "fedora:38"
imagePullPolicy: Always
command:
- /bin/bash
- "-c"
- echo Workload started ; sleep inf
volumeMounts:
- name: tls-certs
mountPath: /tls-config
volumes:
- name: tls-certs
emptyDir: {}
4 changes: 4 additions & 0 deletions deployments/emojivoto/ns.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: edg-emojivoto
45 changes: 45 additions & 0 deletions deployments/emojivoto/portforwarder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
apiVersion: v1
kind: Pod
metadata:
name: port-forwarder-coordinator
namespace: default
spec:
containers:
- name: port-forwarder
image: nixery.dev/shell/socat
env:
- name: LISTEN_PORT
value: "1313"
- name: FORWARD_HOST
value: coordinator-kbs.edg-emojivoto
- 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
---
apiVersion: v1
kind: Pod
metadata:
name: port-forwarder-2
namespace: default
spec:
containers:
- name: port-forwarder
image: nixery.dev/shell/socat
env:
- name: LISTEN_PORT
value: "8080"
- name: FORWARD_HOST
value: web-svc.edg-emojivoto
- 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
33 changes: 33 additions & 0 deletions deployments/emojivoto/vote-bot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: vote-bot
namespace: edg-emojivoto
labels:
app.kubernetes.io/name: vote-bot
app.kubernetes.io/part-of: emojivoto
app.kubernetes.io/version: v11
spec:
replicas: 1
selector:
matchLabels:
app: vote-bot
version: v11
template:
metadata:
labels:
app: vote-bot
version: v11
spec:
containers:
- command:
- emojivoto-vote-bot
env:
- name: WEB_HOST
value: web-svc.edg-emojivoto:443
image: ghcr.io/3u13r/emojivoto-web:coco-1
imagePullPolicy: Always
name: vote-bot
resources:
requests:
cpu: 10m
84 changes: 84 additions & 0 deletions deployments/emojivoto/voting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
kind: ServiceAccount
apiVersion: v1
metadata:
name: voting
namespace: edg-emojivoto
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: voting
namespace: edg-emojivoto
labels:
app.kubernetes.io/name: voting
app.kubernetes.io/part-of: emojivoto
app.kubernetes.io/version: v11
spec:
replicas: 1
selector:
matchLabels:
app: voting-svc
version: v11
template:
metadata:
labels:
app: voting-svc
version: v11
spec:
runtimeClassName: kata-cc-isolation
initContainers:
- name: initializer
image: "ghcr.io/katexochen/initializer:latest"
imagePullPolicy: Always
env:
- name: COORDINATOR_HOST
value: coordinator-kbs.edg-emojivoto
volumeMounts:
- name: tls-certs
mountPath: /tls-config
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/CACert.pem
- name: EDG_KEY_PATH
value: /tls-config/key.pem
image: ghcr.io/3u13r/emojivoto-voting-svc:coco-1
imagePullPolicy: Always
name: voting-svc
ports:
- containerPort: 8080
name: grpc
- containerPort: 8801
name: prom
resources:
requests:
cpu: 100m
volumeMounts:
- name: tls-certs
mountPath: /tls-config
volumes:
- name: tls-certs
emptyDir: {}
---
apiVersion: v1
kind: Service
metadata:
name: voting-svc
namespace: edg-emojivoto
spec:
selector:
app: voting-svc
ports:
- name: grpc
port: 8080
targetPort: 8080
- name: prom
port: 8801
targetPort: 8801
Loading

0 comments on commit 4a9bca3

Please sign in to comment.