From afe7948c32516d5b47c6dd6b4ea11f5f7fe41916 Mon Sep 17 00:00:00 2001 From: Jose Sousa <2409jmsousa@gmail.com> Date: Fri, 16 Oct 2026 14:00:13 +0100 Subject: [PATCH 1/2] feat(games): add 2048 deployment with README --- services/games/2048/00-namespace.yaml | 5 ++ services/games/2048/01-deployment.yaml | 41 +++++++++++++++++ services/games/2048/02-ingress-route.yaml | 19 ++++++++ services/games/2048/README.md | 56 +++++++++++++++++++++++ services/games/2048/deploy.sh | 8 ++++ 5 files changed, 129 insertions(+) create mode 100644 services/games/2048/00-namespace.yaml create mode 100644 services/games/2048/01-deployment.yaml create mode 100644 services/games/2048/02-ingress-route.yaml create mode 100644 services/games/2048/README.md create mode 100755 services/games/2048/deploy.sh diff --git a/services/games/2048/00-namespace.yaml b/services/games/2048/00-namespace.yaml new file mode 100644 index 0000000..4d7e709 --- /dev/null +++ b/services/games/2048/00-namespace.yaml @@ -0,0 +1,5 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + name: game-2048 diff --git a/services/games/2048/01-deployment.yaml b/services/games/2048/01-deployment.yaml new file mode 100644 index 0000000..4f0ed9a --- /dev/null +++ b/services/games/2048/01-deployment.yaml @@ -0,0 +1,41 @@ +--- +# Deployment: runs 2 copies (replicas) of the 2048 game. +# Image: alexwhen/docker-2048 = nginx + static 2048 game from +# https://github.com/gabrielecirulli/2048, listens on port 80. +apiVersion: apps/v1 +kind: Deployment +metadata: + name: game-2048 + namespace: game-2048 + labels: + app: game-2048 +spec: + replicas: 2 + selector: + matchLabels: + app: game-2048 + template: + metadata: + labels: + app: game-2048 + spec: + containers: + - name: game-2048 + image: alexwhen/docker-2048:latest + ports: + - containerPort: 80 +--- +# Service: stable internal IP for the Deployment. +# The IngressRoute below sends traffic here. +apiVersion: v1 +kind: Service +metadata: + name: game-2048-service + namespace: game-2048 +spec: + selector: + app: game-2048 + ports: + - port: 80 + targetPort: 80 + type: ClusterIP diff --git a/services/games/2048/02-ingress-route.yaml b/services/games/2048/02-ingress-route.yaml new file mode 100644 index 0000000..74650ed --- /dev/null +++ b/services/games/2048/02-ingress-route.yaml @@ -0,0 +1,19 @@ +--- +# IngressRoute (Traefik): exposes the game outside the cluster. +# No TLS on purpose to keep the workshop setup simple. +# Access it at: http://2048.localhost/ +# (Traefik resolves *.localhost automatically, no /etc/hosts needed) +apiVersion: traefik.io/v1alpha1 +kind: IngressRoute +metadata: + name: game-2048 + namespace: game-2048 +spec: + entryPoints: + - web + routes: + - match: Host(`2048.localhost`) + kind: Rule + services: + - name: game-2048-service + port: 80 diff --git a/services/games/2048/README.md b/services/games/2048/README.md new file mode 100644 index 0000000..7815091 --- /dev/null +++ b/services/games/2048/README.md @@ -0,0 +1,56 @@ +# 2048 — Simple Setup + +Simplest possible deployment of [2048](https://github.com/gabrielecirulli/2048) +using the prebuilt image `alexwhen/docker-2048` (nginx + static site, port 80). + +## Files + +- `00-namespace.yaml` — creates namespace `game-2048` +- `01-deployment.yaml` — Deployment (2 replicas) + ClusterIP Service +- `02-ingress-route.yaml` — Traefik IngressRoute, no TLS → `http://2048.localhost/` +- `deploy.sh` — `kubectl apply` all files in order + +## Deploy + +Prerequisites: kind dev cluster up with Traefik (`bash dev/setup-kind-cluster.sh`) +and `kubectl` pointed at `kind-niployments-test-cluster`: + +```bash +kubectl config use-context kind-niployments-test-cluster +``` + +Deploy from repo root or this folder: + +```bash +bash services/games/2048/deploy.sh +# or: +cd services/games/2048 +./deploy.sh +``` + +Verify: + +```bash +kubectl -n game-2048 get pods,svc,ingressroutes.traefik.io +kubectl -n game-2048 wait --for=condition=ready pod -l app=game-2048 --timeout=120s +``` + +Then open http://2048.localhost/ + +Access via port-forward (kind Traefik LB IP isn't reachable from host directly): + +```bash +# 8080 is often taken (e.g. by aws-course-viewer), use 8888 or another free port: +kubectl port-forward -n kube-system svc/traefik 8888:80 +# open http://2048.localhost:8888/ +# or: curl -H "Host: 2048.localhost" http://127.0.0.1:8888/ +``` + +## Useful commands + +```bash +kubectl -n game-2048 get pods,svc,ingressroute +kubectl -n game-2048 logs -l app=game-2048 +kubectl -n game-2048 delete -f 01-deployment.yaml # teardown demo +./deploy.sh # re-apply +``` diff --git a/services/games/2048/deploy.sh b/services/games/2048/deploy.sh new file mode 100755 index 0000000..629468a --- /dev/null +++ b/services/games/2048/deploy.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# Deploy the simple 2048 setup. +# Usage: ./deploy.sh +cd $(dirname $0) + +kubectl apply -f 00-namespace.yaml +kubectl apply -f 01-deployment.yaml +kubectl apply -f 02-ingress-route.yaml From 0ac93d974d728137ddf4b34942479a00768c9ea5 Mon Sep 17 00:00:00 2001 From: Filipe Esteves <97606680+FrozenHart@users.noreply.github.com> Date: Tue, 20 Oct 2026 00:20:25 +0100 Subject: [PATCH 2/2] Delete services/games/2048/README.md wil be added to the wiki later --- services/games/2048/README.md | 56 ----------------------------------- 1 file changed, 56 deletions(-) delete mode 100644 services/games/2048/README.md diff --git a/services/games/2048/README.md b/services/games/2048/README.md deleted file mode 100644 index 7815091..0000000 --- a/services/games/2048/README.md +++ /dev/null @@ -1,56 +0,0 @@ -# 2048 — Simple Setup - -Simplest possible deployment of [2048](https://github.com/gabrielecirulli/2048) -using the prebuilt image `alexwhen/docker-2048` (nginx + static site, port 80). - -## Files - -- `00-namespace.yaml` — creates namespace `game-2048` -- `01-deployment.yaml` — Deployment (2 replicas) + ClusterIP Service -- `02-ingress-route.yaml` — Traefik IngressRoute, no TLS → `http://2048.localhost/` -- `deploy.sh` — `kubectl apply` all files in order - -## Deploy - -Prerequisites: kind dev cluster up with Traefik (`bash dev/setup-kind-cluster.sh`) -and `kubectl` pointed at `kind-niployments-test-cluster`: - -```bash -kubectl config use-context kind-niployments-test-cluster -``` - -Deploy from repo root or this folder: - -```bash -bash services/games/2048/deploy.sh -# or: -cd services/games/2048 -./deploy.sh -``` - -Verify: - -```bash -kubectl -n game-2048 get pods,svc,ingressroutes.traefik.io -kubectl -n game-2048 wait --for=condition=ready pod -l app=game-2048 --timeout=120s -``` - -Then open http://2048.localhost/ - -Access via port-forward (kind Traefik LB IP isn't reachable from host directly): - -```bash -# 8080 is often taken (e.g. by aws-course-viewer), use 8888 or another free port: -kubectl port-forward -n kube-system svc/traefik 8888:80 -# open http://2048.localhost:8888/ -# or: curl -H "Host: 2048.localhost" http://127.0.0.1:8888/ -``` - -## Useful commands - -```bash -kubectl -n game-2048 get pods,svc,ingressroute -kubectl -n game-2048 logs -l app=game-2048 -kubectl -n game-2048 delete -f 01-deployment.yaml # teardown demo -./deploy.sh # re-apply -```