diff --git a/README.md b/README.md index f2d22c9..3d0dc37 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,33 @@ helm upgrade diracx-demo ./diracx --values .demo/values.yaml TODO +## Troubleshooting + +### DNS Issues + +Depending on your network configuration or internet service provider restrictions, you might encounter DNS resolution issues, as evidenced by errors like: + +``` +$ diracx-charts/run_demo.sh diracx DIRAC diracx-web +🦄 Found package directories for: diracx DIRAC diracx-web +💀 ping command exited with a non-zero exit code +ping: .nip.io: Name or service not known +💀 ping command exited with a non-zero exit code +Failed to find an appropriate hostname for the demo. +``` + +This error indicates that the system cannot resolve the domain `.nip.io`. This might be due to restrictions placed by your internet provider or network configuration. To resolve this, you have two options: + +1. **Switch Networks:** Try running the demo from a different network that does not have such restrictions. + +2. **Modify Hosts File and Enable DNS Hack:** + - Add an entry to your `/etc/hosts` file with the unresolved IP address and hostname, like this: + ``` + .nip.io + ``` + - Then, in your configuration, set `dnsHack.enabled` to `true`. This action ensures that the IP address is recognized within the cluster. + + ## Requirements | Repository | Name | Version | @@ -121,6 +148,7 @@ TODO | diracxWeb.image.tag | string | `"latest"` | | | diracxWeb.service.port | int | `8080` | | | diracxWeb.service.type | string | `"ClusterIP"` | | +| dnsHack.enabled | bool | `false` | | | fullnameOverride | string | `""` | | | global.batchJobTTL | int | `600` | | | image.pullPolicy | string | `"Always"` | | diff --git a/diracx/templates/deployment.yaml b/diracx/templates/deployment.yaml index 834420e..3c424b8 100644 --- a/diracx/templates/deployment.yaml +++ b/diracx/templates/deployment.yaml @@ -27,6 +27,12 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} + {{- if .Values.dnsHack.enabled }} + hostAliases: + - ip: {{ .Values.diracx.hostname | trimSuffix ".nip.io" }} + hostnames: + - {{ .Values.diracx.hostname }} + {{- end }} serviceAccountName: {{ include "diracx.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} @@ -96,14 +102,14 @@ spec: - name: http containerPort: {{ .Values.diracx.service.port }} protocol: TCP - # livenessProbe: - # httpGet: - # path: /api/docs/ - # port: http - # readinessProbe: - # httpGet: - # path: /api/docs/ - # port: http + livenessProbe: + httpGet: + path: /api/docs/ + port: http + readinessProbe: + httpGet: + path: /api/docs/ + port: http command: ["bash", "/entrypoint.sh"] args: - uvicorn diff --git a/diracx/values.yaml b/diracx/values.yaml index 0629bd6..17d1ccc 100644 --- a/diracx/values.yaml +++ b/diracx/values.yaml @@ -90,6 +90,9 @@ developer: # If set, mount the CS stored localy instead of initializing a default one localCSPath: /local_cs_store +dnsHack: + enabled: false + diracx: # Required: The hostname where the webapp/API is running # hostname: