Skip to content

Commit

Permalink
more app improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Seth Eliot committed Feb 8, 2025
1 parent 28e3492 commit 429f998
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

# Function to get the node name from the environment variable
def get_node_name():
return os.getenv("NODE_NAME", "Unavailable")
return os.getenv("NODE_NAME", "Unknown node")

# Get pod name if defined
def get_pod_name():
return os.getenv("KUBERNETES_POD_NAME", os.getenv("HOSTNAME", "Unknown-Pod"))
return os.getenv("KUBERNETES_POD_NAME", os.getenv("HOSTNAME", "Unknown Pod"))

# Function to get the AWS Region from the environment variable
def get_region():
Expand Down
17 changes: 15 additions & 2 deletions src/templates/guestbook.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,21 @@
</style>
</head>
<body>
<h2>Running on pod: {{ pod_name }}, on node: {{ node_name }}</h2>
<h2>In AWS Region: {{ region }}</h2>
<table border="1" cellpadding="8">
<tr>
<td>Pod Name</td>
<td><b>{{ pod_name }}</b></td>
</tr>
<tr>
<td>Node Name</td>
<td><b>{{ node_name }}</b></td>
</tr>
<tr>
<td>AWS Region</td>
<td><b>{{ region }}</b></td>
</tr>

</table>
<h2><br/>Hello, World! Please sign the guest book</h2>
<form action="/" method="post">
<label for="name">Name:</label>
Expand Down

0 comments on commit 429f998

Please sign in to comment.