<p>I'm new to Kubernertes and we have one app that can be customized to several costumers. </p>

<p>The deployments are fine: they are running pods correctly. The problem is to access the API outside the cluster.</p>

<p>The AWS routes are being created as expected by Kubernetes Ingress.</p>

<p>The existing ones are working fine, but when I try reach the new one (lets say <code>client09</code>), always return <code>default-backend-404</code>.</p>

<p>Plus, when <code>curl</code> the url, it shows a <code>Kubernetes Ingress Controller Fake Certificate</code> message.</p>

<p>kubectl version
Client 1.6
Server 1.9</p>

<p>Also my user does not have full access, so I can't provide any information about <code>nginx controller</code>. We just have the same paste and copy for new costumers, but don't know what might be wrong.</p>

<p>Any thoughts what is wrong?</p>

<p><strong>Service</strong></p>

<pre><code>apiVersion: v1
kind: Service
metadata:
 name: client09-svc
 labels:
   run: client09-deploy
 spec:
   type: ClusterIP
   ports:
     - port: 8080
       targetPort: 8080
       protocol: TCP
       name: api
   selector:
     run: client09-deploy
</code></pre>

<p><strong>Deploy</strong></p>

<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: client09-deploy
  namespace: default
spec:
  replicas: 1
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
    type: RollingUpdate
  template:
    metadata:
      labels:
        run: client09-deploy
    spec:
      terminationGracePeriodSeconds: 60
      containers:
      - name: client09
        image: myContainer
        ports:
        - containerPort: 8080
          name: api
        readinessProbe:
          httpGet:
            path: /health
            port: 8080
          initialDelaySeconds: 30
          periodSeconds: 10
        livenessProbe:
          httpGet:
            path: /health
            port: 8080
          initialDelaySeconds: 30
          periodSeconds: 10
        imagePullPolicy: Always
        resources:
          limits:
            cpu: 1800m
            memory: 2000Mi
          requests:
            cpu: 400m
            memory: 1000Mi
        volumeMounts:
          - mountPath: /secret-volume
            name: secretvolume
      imagePullSecrets:
        - name: dockerhubkey
      volumes:
        - name: secretvolume
          secret:
            secretName: client09-secret
</code></pre>

<p><strong>Ingress</strong></p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: my-ingress
  annotations:
    kubernetes.io/ingress.class: nginx
    kubernetes.io/tls-acme: "true"
    ingress.kubernetes.io/ssl-redirect: "true"
    ingress.kubernetes.io/use-port-in-redirects: "true"
  namespace: default
spec:
  tls:
  - hosts:
    - client01.domain.com
    - client02.domain.com
    - client09.domain.com
  secretName: my-ingress-tls
rules:
- host: client01.domain.com
  http:
    paths:
    - backend:
        serviceName: client01-svc
        servicePort: 8080
      path: /
- host: client02.domain.com
  http:
    paths:
    - backend:
        serviceName: client02-svc
        servicePort: 8080
      path: /
- host: client09.domain.com
  http:
    paths:
    - backend:
        serviceName: client09-svc
        servicePort: 8080
      path: /
</code></pre>

Leonardo
<p>Looks like problem with selector. 
Could you update Service YAML to this:</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
 name: client09-svc
 labels:
   run: client09-deploy
 spec:
   type: ClusterIP
   ports:
     - port: 8080
       targetPort: 8080
       protocol: TCP
       name: api
   selector:
     name: client09-deploy
</code></pre>
