Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Defer to service discoery in get_nginxhost_ip.py #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions get_nginxhost_ip.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,19 @@

import logging
import os
import socket
import sys

import docker

try:
socket.getaddrinfo('geonode', '80')
logging.info("k8s service discovery enabled")
print "http://geonode:80"
sys.exit()
except socket.gaierror as e:
logging.info("k8s service discovery not enabled, using docker-compose")

client = docker.from_env()
# print client.info()
# TODO avoid this script can fail and fall in the loop where the geoserver
Expand Down