I am really looking for hours and hours. Running in GKE with Ingress GCE.
I keep getting a 404 with only on my .Net WebApi container
I have a .net core webapi running inside a container on port 8080 with a service that accepts through prt 8082.
When I deploy the hello world example https://cloud.google.com/kubernetes-engine/docs/samples/container-helloapp-ingress everything works fine
My .net deployment and ingress look like this.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: my-ingress
annotations:
kubernetes.io/ingress.class: "gce"
kubernetes.io/ingress.allow-http: "true"
spec:
rules:
- http:
paths:
- pathType: ImplementationSpecific
path: /access
backend:
service:
name: webapi-svc #this is the .Net Core Web API service: NOT WORKING
port:
number: 8082
- pathType: ImplementationSpecific
path: /node
backend:
service:
name: hello-world-deployment-2-service #this is the Node.js service: WORKING
port:
number: 8081
Here is my service and deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: webapi-deployment
spec:
replicas: 1
selector:
matchLabels:
app: webapi
template:
metadata:
labels:
app: webapi
spec:
containers:
- name: webapi
image: gcr.io/testblazorapp-417308/webapifork8testing:3
env:
- name: ASPNETCORE_URLS
value: http://+:8080
- name: ASPNETCORE_ENVIRONMENT
value: Production
ports:
- containerPort: 8080
livenessProbe:
failureThreshold: 5
httpGet:
path: /
port: 8080
scheme: HTTP
initialDelaySeconds: 60
periodSeconds: 30
successThreshold: 1
timeoutSeconds: 5
readinessProbe:
failureThreshold: 10
httpGet:
path: /
port: 8080
scheme: HTTP
initialDelaySeconds: 15
periodSeconds: 2
successThreshold: 1
timeoutSeconds: 2
---
apiVersion: v1
kind: Service
metadata:
name: webapi-svc
labels:
app: webapi
spec:
type: NodePort
selector:
app: webapi
ports:
- port: 8082
targetPort: 8080