diff --git a/README.md b/README.md index c46bfcf8..85d419b1 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ docker-compose --file=docker-compose.local.yml up -d --build ## Running application with helm chart Helm command example: ```bash -helm upgrade --install --namespace distributor broken \ +$ helm upgrade --install --namespace distributor broken \ --set snifferApiURL=https://hotel.playground.neuralegion.com \ --set snifferProjectID=ud8v8jwUaG14JiAihMQx1M \ --set snifferApiKey=6g0daym.nexp.spkuhhishhttv \ @@ -48,6 +48,11 @@ helm upgrade --install --namespace distributor broken \ --set ingress.authlevel=- . --wait ``` +Optionally, you can test your installation: +```bash +$ helm test broken --namespace=distributor --logs +``` + ### Arguments info **repeaterID, token and cluster** - These argument values are required if you want to use repeater. In case you don't set any of these fields, repeater container won't be run. In that case this will be regular bc deployment. (Required arguments if repeater container is to be used). diff --git a/charts/brokencrystals/templates/NOTES.txt b/charts/brokencrystals/templates/NOTES.txt index 1969ecb5..f4aedaa3 100644 --- a/charts/brokencrystals/templates/NOTES.txt +++ b/charts/brokencrystals/templates/NOTES.txt @@ -1 +1 @@ -https://{{ include "brokencrystals.fullname" . }}.brokencrystals.{{ .Values.ingress.basedomain }} +https://{{ .Values.ingress.url }} diff --git a/charts/brokencrystals/templates/tests/test-internal-connection.yaml b/charts/brokencrystals/templates/tests/test-internal-connection.yaml new file mode 100644 index 00000000..430ac383 --- /dev/null +++ b/charts/brokencrystals/templates/tests/test-internal-connection.yaml @@ -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 < /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