apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: mlservicesrouting
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- http:
paths:- backend:
serviceName: flask-demo
servicePort: 8080
- backend:
The above configuration works with Python Plotly based Docker image. However, as soon as I enable the path /bond_scoring, the URL no longer works. The below config does not work.
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: mlservicesrouting
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- http:
paths:-
path: /bond_scoring
backend:
serviceName: flask-demo
servicePort: 8080
-
path: /bond_scoring
What may I be doing wrong here? Other objects are below -
bond-predict-service.yml
apiVersion: v1
kind: Service
metadata:
name: flask-demo
labels:
app: flask-demo
spec:
ports:
- port: 8080
name: http
targetPort: 8080
selector:
app: flask-demo
bond-predict-deployment.yml
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: flask-demo
labels:
app: flask-demo
spec:
replicas: 1
selector:
matchLabels:
app: flask-demo
template:
metadata:
labels:
app: flask-demo
spec:
containers:
- name: flask-demo
image: varunkh70/bond_scoring
command: [“python3”, “app.py”]
The errors I get(when I add path /bond_scoring) are below -