-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
50 additions
and
3 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 |
---|---|---|
@@ -1 +1 @@ | ||
https://{{ include "brokencrystals.fullname" . }}.brokencrystals.{{ .Values.ingress.basedomain }} | ||
https://{{ .Values.ingress.url }} |
42 changes: 42 additions & 0 deletions
42
charts/brokencrystals/templates/tests/test-internal-connection.yaml
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,42 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: "{{ .Release.Name }}-test-internal-connection" | ||
namespace: "{{ .Release.Namespace }}" | ||
annotations: | ||
"helm.sh/hook": test | ||
spec: | ||
containers: | ||
- name: test | ||
image: python:3 | ||
command: ["/bin/sh", "-c"] | ||
args: | ||
- | | ||
cat <<EOF > /tmp/check_availability.py | ||
import urllib.request | ||
import sys | ||
def check_availability(url: str): | ||
print(f"🔍 Checking application availability at {url}") | ||
try: | ||
with urllib.request.urlopen(url, timeout=10) as response: | ||
if response.status == 200: | ||
print(f"✅ Application is available at {url}") | ||
else: | ||
print(f"❌ Application returned status code {response.status}") | ||
sys.exit(1) | ||
except urllib.error.URLError as e: | ||
print(f"🚨 Error checking application availability: {e}") | ||
sys.exit(1) | ||
internal_url = "http://{{ .Release.Name }}:3000" | ||
check_availability(internal_url) | ||
public_url = "https://{{ .Values.ingress.url }}" | ||
check_availability(public_url) | ||
sys.exit(0) | ||
EOF | ||
python /tmp/check_availability.py | ||
restartPolicy: Never |