From 18c1375be693bab4bf7d3df899249fe223f7d494 Mon Sep 17 00:00:00 2001 From: Simon Belmas <22192134+simbelmas@users.noreply.github.com> Date: Mon, 24 Jun 2024 19:24:03 +0200 Subject: [PATCH] initial commit: adding app --- README.md | 8 ++++ config/content-git-repo | 1 + config/init.sh | 35 ++++++++++++++++ config/replicas | 1 + deployment.yaml | 90 +++++++++++++++++++++++++++++++++++++++++ kustomization.yaml | 34 ++++++++++++++++ namespace.yaml | 4 ++ service.yaml | 13 ++++++ 8 files changed, 186 insertions(+) create mode 100644 config/content-git-repo create mode 100644 config/init.sh create mode 100644 config/replicas create mode 100644 deployment.yaml create mode 100644 kustomization.yaml create mode 100644 namespace.yaml create mode 100644 service.yaml diff --git a/README.md b/README.md index f472177..6303ffb 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,10 @@ # html-kube-tester +Workload to test application behavior while making changes on infrastructure. + +Ingress is not included and have to be added on top. +Feel free to customize *replicas* and *content-git-repo* in *config* folder. + +Git will be displayed in an iframe with node name on top. + +Thanks to https://github.com/amoldalwai/RoadFighter.git for having something fun to display. diff --git a/config/content-git-repo b/config/content-git-repo new file mode 100644 index 0000000..c463c5f --- /dev/null +++ b/config/content-git-repo @@ -0,0 +1 @@ +https://github.com/amoldalwai/RoadFighter.git \ No newline at end of file diff --git a/config/init.sh b/config/init.sh new file mode 100644 index 0000000..2d6f8b3 --- /dev/null +++ b/config/init.sh @@ -0,0 +1,35 @@ +#!/bin/sh +git_retries=20 +try=0 +export GIT_SSH_COMMAND='ssh -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null"' +until timeout 10 git clone --recurse-submodules ${CONTENT_GIT_REPO} /app ; do + echo "Retry git pull after error ($try / $git_retries)" + try=$((try+1)) + if [ $try -eq $git_retries ]; then + exit 1 + fi + sleep 1 +done +cd /app +if [ -e index.html ] ; then + mv index.html index-embedded.html +fi +cat <index.html + + + Html-Kube-Tester fron ${KUBE_NODE_NAME} + + +

+ From node ${KUBE_NODE_NAME} +

+