diff --git a/deployments/emojivoto/coordinator.yml b/deployments/emojivoto/coordinator.yml new file mode 100644 index 0000000000..a0fd37a943 --- /dev/null +++ b/deployments/emojivoto/coordinator.yml @@ -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 diff --git a/deployments/emojivoto/emoji.yml b/deployments/emojivoto/emoji.yml new file mode 100644 index 0000000000..3aa05c0535 --- /dev/null +++ b/deployments/emojivoto/emoji.yml @@ -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 diff --git a/deployments/emojivoto/initializer.yml b/deployments/emojivoto/initializer.yml new file mode 100644 index 0000000000..a59a3bd4fb --- /dev/null +++ b/deployments/emojivoto/initializer.yml @@ -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: {} diff --git a/deployments/emojivoto/ns.yml b/deployments/emojivoto/ns.yml new file mode 100644 index 0000000000..321162eb8e --- /dev/null +++ b/deployments/emojivoto/ns.yml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: edg-emojivoto diff --git a/deployments/emojivoto/portforwarder.yml b/deployments/emojivoto/portforwarder.yml new file mode 100644 index 0000000000..b23352a779 --- /dev/null +++ b/deployments/emojivoto/portforwarder.yml @@ -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 diff --git a/deployments/emojivoto/vote-bot.yml b/deployments/emojivoto/vote-bot.yml new file mode 100644 index 0000000000..3bcb35762a --- /dev/null +++ b/deployments/emojivoto/vote-bot.yml @@ -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 diff --git a/deployments/emojivoto/voting.yml b/deployments/emojivoto/voting.yml new file mode 100644 index 0000000000..d9ae83ec2f --- /dev/null +++ b/deployments/emojivoto/voting.yml @@ -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 diff --git a/deployments/emojivoto/web.yml b/deployments/emojivoto/web.yml new file mode 100644 index 0000000000..4583850f86 --- /dev/null +++ b/deployments/emojivoto/web.yml @@ -0,0 +1,86 @@ +kind: ServiceAccount +apiVersion: v1 +metadata: + name: web + namespace: edg-emojivoto +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: web + namespace: edg-emojivoto + labels: + app.kubernetes.io/name: web + app.kubernetes.io/part-of: emojivoto + app.kubernetes.io/version: v11 +spec: + replicas: 1 + selector: + matchLabels: + app: web-svc + version: v11 + template: + metadata: + labels: + app: web-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: web + containers: + - env: + - name: WEB_PORT + value: "8080" + - name: EMOJISVC_HOST + value: emoji-svc.edg-emojivoto:8080 + - name: VOTINGSVC_HOST + value: voting-svc.edg-emojivoto:8080 + - name: INDEX_BUNDLE + value: dist/index_bundle.js + - 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 + - name: EDG_DISABLE_CLIENT_AUTH + value: "true" + image: ghcr.io/3u13r/emojivoto-web:coco-1 + imagePullPolicy: Always + name: web-svc + ports: + - containerPort: 8080 + name: https + resources: + requests: + cpu: 100m + volumeMounts: + - name: tls-certs + mountPath: /tls-config + volumes: + - name: tls-certs + emptyDir: {} +--- +apiVersion: v1 +kind: Service +metadata: + name: web-svc + namespace: edg-emojivoto +spec: + type: ClusterIP + selector: + app: web-svc + ports: + - name: https + port: 443 + targetPort: 8080