I have a network speed tester service and deployment in my cluster. I would like to display the widget on a window in my frontend react app within my k8s cluster ... I used iframe as follows.
const SpeedTest = (props) => {
return (
<div>
<Container>
<iframe className="speedTestFrame" src={`..path..`}></iframe>
<br />
</Container>
</div>
);
};
My svc looks like this:
apiVersion: v1
kind: Service
metadata:
name: speedtest
spec:
ports:
- name: "10000"
port: 10000
targetPort: 8080
selector:
app: speedtest
and part of my ingress looks like this:
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: speed-ingress
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- http:
paths:
- path: /speedtest
pathType: Exact
backend:
serviceName: speedtest
servicePort: 10000
Now, when I use it (speed tester) as my default root /
with only one ingress in the project, it works fine. However, my root /
is for the frontend react app. If I set it on its own ingress like above, it says network error and does not work.
Is there any other way I can display this widget ?
How do I solve the ingress routing issue because apart from this widget and the frontend react app, I also have an admin react client app and it does not load if I place it in its own ingress as well.
TL;DR How do I load two react apps and a static container whose path is the root?