503 error trying to enable https on Kubernetes

hongooi

Ars Tribunus Militum
2,244
Subscriptor
Containers noob here, so bear with me.

I'm trying to deploy a predictive service on an Azure Kubernetes cluster, with https enabled. I'm following the steps in this tutorial, but substituting my own deployment and service backend. I've managed to obtain a cert from Lets Encrypt and I can connect to the cluster, but it consistently gives me a 503 error. That would seem to indicate a problem between the ingress controller and my service.

Here is my service deployment yaml. I've previously successfully connected to it without https, so I know the backend works.

Code:
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: mls-model
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: mls-model
    spec:
      containers:
      - name: mls-model
        image: deployreg.azurecr.io/mls-model
        ports:
        - containerPort: 12800
        resources:
          requests:
            cpu: 250m
          limits:
            cpu: 500m
      imagePullSecrets:
      - name: deployreg.azurecr.io
---
apiVersion: v1
kind: Service
metadata:
  name: mls-model-svc
spec:
  selector:
    app: mls-model
#  type: LoadBalancer
  ports:
  - protocol: TCP
    port: 12800

And here is the yaml for the ingress controller:

Code:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: mls-model-ingress
  annotations:
    kubernetes.io/ingress.class: nginx
    certmanager.k8s.io/cluster-issuer: letsencrypt-staging
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  tls:
  - hosts:
    - mls-model.australiaeast.cloudapp.azure.com
    secretName: tls-secret
  rules:
  - host: mls-model.australiaeast.cloudapp.azure.com
    http:
      paths:
      - path: /
        backend:
          serviceName: mls-model
          servicePort: 12800

When I try to access https: / / mls-model[...].com/login, or mls-model[...].com/api, which are the endpoints for my service, they all result in a 503.

Can anyone see what the problem might be?