adding echo pod container

This commit is contained in:
baschno
2024-12-19 15:39:37 +01:00
parent 4483b2fa8e
commit 77c155bdb8
7 changed files with 172 additions and 0 deletions

15
echo-pod/pod_name.sh Normal file
View File

@@ -0,0 +1,15 @@
#!/bin/sh
# Get hostname
POD_NAME=$(hostname)
POD_NAME=${POD_NAME:-"Unknown Pod Name"}
# Get node name
NODE_NAME=${NODE_NAME:-"Unknown Node Name"}
# Replace the placeholders in the HTML with the actual pod name and node name
sed -i "s/{{POD_NAME}}/${POD_NAME}/g" /usr/share/nginx/html/index.html
sed -i "s/{{NODE_NAME}}/${NODE_NAME}/g" /usr/share/nginx/html/index.html
# Start Nginx
nginx -g 'daemon off;'