1
0
mirror of https://github.com/ubuntu/microk8s.git synced 2021-05-23 02:23:41 +03:00

Do not use xip.io (#2227)

This commit is contained in:
Konstantinos Tsakalozos
2021-05-04 12:24:55 +03:00
committed by GitHub
parent 932348f7b3
commit 9526eeda66
4 changed files with 1 additions and 67 deletions

View File

@@ -50,23 +50,6 @@ spec:
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: microbot-ingress-xip
spec:
rules:
- host: microbot.127.0.0.1.xip.io
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: microbot
port:
number: 80
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: microbot-ingress-nip
spec:

View File

@@ -109,9 +109,7 @@ class Ingress(Addon):
self.node.kubernetes.wait_containers_ready("default", label="app=microbot")
nip_addresses = self.node.kubernetes.wait_ingress_ready("microbot-ingress-nip", "default")
xip_addresses = self.node.kubernetes.wait_ingress_ready("microbot-ingress-xip", "default")
assert "127.0.0.1" in nip_addresses[0].ip
assert "127.0.0.1" in xip_addresses[0].ip
deadline = datetime.datetime.now() + datetime.timedelta(seconds=30)
@@ -124,17 +122,6 @@ class Ingress(Addon):
assert resp.status_code == 200
assert "microbot.png" in resp.content.decode("utf8")
deadline = datetime.datetime.now() + datetime.timedelta(seconds=30)
while True:
resp = requests.get(f"http://microbot.{context['address']}.xip.io/")
if resp.status_code == 200 or datetime.datetime.now() > deadline:
break
time.sleep(1)
assert resp.status_code == 200
assert "microbot.png" in resp.content.decode("utf8")
self.delete_template("ingress.j2", context)

View File

@@ -50,23 +50,6 @@ spec:
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: microbot-ingress-xip
spec:
rules:
- host: microbot.{{ address }}.xip.io
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: microbot
port:
number: 80
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: microbot-ingress-nip
spec:

View File

@@ -79,14 +79,6 @@ def common_ingress():
the Ingress controllers.
"""
attempt = 50
while attempt >= 0:
output = kubectl("get ing")
if "microbot.127.0.0.1.xip.io" in output:
break
time.sleep(5)
attempt -= 1
assert "microbot.127.0.0.1.xip.io" in output
attempt = 50
while attempt >= 0:
output = kubectl("get ing")
if "microbot.127.0.0.1.nip.io" in output:
@@ -99,24 +91,13 @@ def common_ingress():
attempt = 50
while attempt >= 0:
try:
resp = requests.get("http://microbot.127.0.0.1.xip.io/")
resp = requests.get("http://microbot.127.0.0.1.nip.io/")
if resp.status_code == 200 and "microbot.png" in resp.content.decode("utf-8"):
service_ok = True
break
except requests.RequestException:
time.sleep(5)
attempt -= 1
if resp.status_code != 200 or "microbot.png" not in resp.content.decode("utf-8"):
attempt = 50
while attempt >= 0:
try:
resp = requests.get("http://microbot.127.0.0.1.nip.io/")
if resp.status_code == 200 and "microbot.png" in resp.content.decode("utf-8"):
service_ok = True
break
except requests.RequestException:
time.sleep(5)
attempt -= 1
assert service_ok