Skip to content

Commit 6182e6a

Browse files
committed
retrieve IP address dynamically instead
Signed-off-by: Tarun Pothulapati <[email protected]>
1 parent 6af20a6 commit 6182e6a

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,14 @@ simple as possible.
1010
sudo docker run --privileged --name gitpod --rm -it -v /tmp/workspaces:/var/gitpod/workspaces 5000-gitpodio-previewinstall-ox4ypumem4w.ws-us46.gitpod.io/gitpod-k3s:latest
1111
```
1212

13-
Once the above command is ran, Your gitpod instance can be accessed at `172-17-17-172.nip.io`. [nip.io](https://nip.io/) is just wildcard DNS for local addresses, So all
14-
of this is local, and cannot be accessed over the internet.
13+
Once the above command starts running and the pods are ready (can be checked by running `docker exec gitpod kubectl get pods`),
14+
The URL to access your gitpod instance can be retrieved by running
15+
16+
```
17+
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' gitpod | sed -r 's/[.]+/-/g' | sed 's/$/.nip.io/g'
18+
```
19+
20+
[nip.io](https://nip.io/) is just wildcard DNS for local addresses, So all off this is local, and cannot be accessed over the internet.
1521

1622
## Known Issues
1723

entrypoint.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22

33
set -eux -o pipefile
44

5-
DOMAIN="172-17-17-172.nip.io"
5+
# Get container's IP address
6+
NODE_IP=$(hostname -i)
7+
DOMAIN_STRING=${NODE_IP//[.]/-}
8+
DOMAIN="${DOMAIN_STRING}.nip.io"
9+
10+
echo "Gitpod Domain: $DOMAIN"
611

712
# M1 and cgroupsv2 stuff
813
if ! grep -iq 'cpu.*hz' /proc/cpuinfo; then
@@ -88,9 +93,6 @@ for f in /var/lib/rancher/k3s/server/manifests/gitpod/*PersistentVolumeClaim*.ya
8893
yq eval-all -i '. as $item ireduce ({}; . *+ $item)' /var/lib/rancher/k3s/server/manifests/gitpod/*_StatefulSet_messagebus.yaml /app/manifests/messagebus.yaml
8994
for f in /var/lib/rancher/k3s/server/manifests/gitpod/*StatefulSet*.yaml; do yq e -i '.spec.volumeClaimTemplates[0].spec.storageClassName="local-path"' "$f"; done
9095

91-
# assign specific external IP for the `proxy` service
92-
yq eval-all -i '.spec.externalIPs = ["172.17.17.172"]' /var/lib/rancher/k3s/server/manifests/gitpod/*_Service_proxy.yaml
93-
9496
# removing init container from ws-daemon (systemd and Ubuntu)
9597
yq eval-all -i 'del(.spec.template.spec.initContainers[0])' /var/lib/rancher/k3s/server/manifests/gitpod/*_DaemonSet_ws-daemon.yaml
9698

0 commit comments

Comments
 (0)