<p>If in the ingress rules I only specify the host to do the forwarding, when editing <code>/etc/hosts</code> I relate the ip of minikube with the host as follows: <code>ip lamp-dev.com</code>, the problem I want to give these two paths to the host: <code>lamp-dev.com/server</code> returns not found and <code>lamp-dev.com/phpmyadmin</code> returns 503, reviewing the kubernetes documentation regarding the entry controller I have it identical to the example they use.</p>
<ul>
<li>server</li>
</ul>
<pre class="lang-yaml prettyprint-override"><code>    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: apachephp-deployment
      namespace: lamp-dev
      labels:
        app: apache
    spec:
      replicas: 3
      selector:
        matchLabels:
          app: apachephp
      template:
        metadata:
          labels:
            app: apachephp
        spec:
          containers:
            - name: apachephp
              image: localhost:5000/apachephp:latest
              imagePullPolicy: Always
              env:
                - name: MYSQL_DATABASE
                  valueFrom:
                    secretKeyRef:
                      name: mysql-secret
                      key: MYSQL_DATABASE
                - name: MYSQL_USER
                  valueFrom:
                    secretKeyRef:
                      name: mysql-secret
                      key: MYSQL_USER
                - name: MYSQL_PASSWORD
                  valueFrom:
                    secretKeyRef:
                      name: mysql-secret
                      key: MYSQL_PASSWORD
              ports:
                - containerPort: 80
                  name: apachephp
</code></pre>
<ul>
<li>apache-service</li>
</ul>
<pre class="lang-yaml prettyprint-override"><code>    ---
    apiVersion: v1
    kind: Service
    metadata:
      name: apachephp-service
      namespace: lamp-dev
    spec:
      selector:
        app: apachephp
      ports:
        - protocol: TCP
          port: 80
          targetPort: 80
          nodePort: 30080
      type: LoadBalancer
</code></pre>
<ul>
<li>phpmyadmin-deployment:</li>
</ul>
<pre class="lang-yaml prettyprint-override"><code>    apiVersion: apps/v1
    kind: Deployment
    metadata:
      labels:
        app: phpmyadmin
      name: phpmyadmin
      namespace: lamp-dev
    spec:
      progressDeadlineSeconds: 600
      replicas: 1
      revisionHistoryLimit: 10
      selector:
        matchLabels:
          app: phpmyadmin
      template:
        metadata:
          labels:
            app: phpmyadmin
        spec:
          containers:
          - image: phpmyadmin
            ports:
              - containerPort: 8080
                name: phpmyadmin
            env:
              - name: PMA_HOST
                value: mysql-service
              - name: PMA_PORT
                value: &quot;3306&quot;
              - name: PMA_USER
                valueFrom:
                  secretKeyRef:
                    name: phpmyadmin-secret
                    key: PMA_USER
              - name: PMA_PASSWORD
                valueFrom:
                  secretKeyRef:
                    name: phpmyadmin-secret
                    key: PMA_PASSWORD ######
              - name: MYSQL_PASSWORD
                valueFrom:
                  secretKeyRef:
                    name: mysql-secret
                    key: MYSQL_PASSWORD
              - name: MYSQL_ROOT_PASSWORD
                valueFrom:
                  secretKeyRef:
                    name: mysql-secret
                    key: MYSQL_ROOT_PASSWORD
              - name: MYSQL_USER
                valueFrom:
                  secretKeyRef:
                    name: mysql-secret
                    key: MYSQL_USER
            imagePullPolicy: Always
            name: phpmyadmin
            terminationMessagePath: /dev/termination-log
            terminationMessagePolicy: File
          restartPolicy: Always
</code></pre>
<ul>
<li>phpmyadmin-service</li>
</ul>
<pre class="lang-yaml prettyprint-override"><code>    ---
    apiVersion: v1
    kind: Service
    metadata:
      name: phpmyadmin-service
      namespace: lamp-dev
      labels:
        app: phpmyadmin
    spec:
      selector:
        app: phpmyadmin
      ports:
        - protocol: TCP
          port: 8080
          targetPort: 8080
          nodePort: 30307
      type: NodePort
</code></pre>
<ul>
<li>INGRESS.YAML</li>
</ul>
<pre class="lang-yaml prettyprint-override"><code>    apiVersion: networking.k8s.io/v1
    kind: Ingress
    metadata:
      name: ingress
      namespace: lamp-dev
    spec:
      rules:
        - host: lamp-dev.com
          http:
            paths:
              - path: /server
                pathType: Prefix
                backend:
                  service:
                    name: apachephp-service
                    port:
                      number: 80
              - path: /phpmyadmin
                pathType: Prefix
                backend:
                  service:
                    name: phpmyadmin-service
                    port:
                      number: 8080
</code></pre>
<p>When I describe the ingress the output is</p>
<pre class="lang-text prettyprint-override"><code>error Default backend: default-http-backend:80 (&lt;error: endpoints &gt; &gt; &gt; &quot;default-http-backend&quot; not found&gt;)
</code></pre>

christian
<blockquote>
<p>The problem was i did not define anything for default route = &quot;/&quot; and only
/server and /phpmyadmin were defined that's why i got default backend not found , if some one can point me more technically, i'll be grateful ,but... for the moment i fixed giving &quot;/&quot; to phpmyadmin &quot;being the default&quot; , and apachephp &quot;/server&quot;</p>
</blockquote>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: lamp-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target:  /
  namespace: lamp-dev
spec:
  rules:
  - host: &quot;lamp-dev.com&quot;
    http:
      paths:
      - path: /server
        pathType: Prefix
        backend:
          service:
            name: apachephp-service
            port:
              number: 80
      - path: /
        pathType: Prefix
        backend:
          service:
            name: phpmyadmin-service
            port:
              number: 80
</code></pre>
