-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use custom default backend that provides support (#263)
* feat: use custom default backend that provides support We make use of a custom 404 backend that provides some basic help text This can be extended later to provide debugging information links to docs
- Loading branch information
Showing
5 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
garden-service/static/kubernetes/system/default-backend/404.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<html> | ||
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | ||
<body> | ||
<h2>Garden</h2> | ||
404 Not Found — We've got some good news and some bad news: | ||
<ul> | ||
<li>Garden is running. 🎉</li> | ||
<li>This URL didn't match any configured ingress route. 🙈</li> | ||
</ul> | ||
We suggest running <code>garden get status</code> to check the exposed endpoints and whether your services are deployed and healthy. 🚀 | ||
</body> | ||
</html> |
4 changes: 4 additions & 0 deletions
4
garden-service/static/kubernetes/system/default-backend/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FROM nginx:1.15.3-alpine | ||
|
||
ADD nginx.conf /etc/nginx/conf.d/default.conf | ||
ADD 404.html /opt/local/html/404.html |
9 changes: 9 additions & 0 deletions
9
garden-service/static/kubernetes/system/default-backend/garden.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module: | ||
name: default-backend | ||
description: Default backend ingress controller | ||
type: container | ||
services: | ||
- name: default-backend | ||
ports: | ||
- name: http | ||
containerPort: 80 |
27 changes: 27 additions & 0 deletions
27
garden-service/static/kubernetes/system/default-backend/nginx.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# The default server. | ||
server { | ||
listen 80 default_server; | ||
listen 8080; | ||
server_name _; | ||
|
||
root /opt/local/html; | ||
|
||
error_page 404 /404.html; | ||
|
||
# needs to respond to /healthz for http health checks on port 8080 | ||
location /healthz { | ||
return 200 'OK!'; | ||
# To see reply in browser | ||
add_header Content-Type text/plain; | ||
|
||
} | ||
# Everything is a 404 | ||
location / { | ||
return 404; | ||
} | ||
|
||
# EDIT: You may need this to prevent return 404; recursion | ||
location = /404.html { | ||
internal; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters