-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
match string logic corrected; ready for testing on k8s cluster
- Loading branch information
1 parent
4963034
commit c33ba59
Showing
6 changed files
with
108 additions
and
48 deletions.
There are no files selected for viewing
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
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
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,11 @@ | ||
# Use the official Nginx image as a parent image | ||
FROM nginx:latest | ||
|
||
# Copy the custom Nginx config file into the container | ||
COPY default.conf /etc/nginx/conf.d/default.conf | ||
|
||
# Expose port 80 | ||
EXPOSE 80 | ||
|
||
# Start Nginx when the container has provisioned | ||
CMD ["nginx", "-g", "daemon off;"] |
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,19 @@ | ||
server { | ||
listen 80; | ||
server_name localhost; | ||
|
||
location / { | ||
default_type text/plain; | ||
return 220 'Welcome to /. Cheers!\n'; | ||
} | ||
|
||
location /path1 { | ||
default_type text/plain; | ||
return 220 'Welcome to /path1. Cheers!\n'; | ||
} | ||
|
||
location /path/two { | ||
default_type text/plain; | ||
return 220 'Welcome to /path/two. Cheers!\n'; | ||
} | ||
} |
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 @@ | ||
import json, os, time | ||
|
||
json_string = os.environ["HOSTS"] | ||
|
||
json_object = json.loads(json_string) | ||
formatted_json_string = json.dumps(json_object, indent=2) | ||
print(formatted_json_string) | ||
|
||
time.sleep(20) |
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,6 @@ | ||
import requests | ||
|
||
response = requests.request("GET", "http://10.0.50.114:8080") | ||
print(type(response.text)) # str | ||
print(response.text) | ||
print(response.status_code) |