<p>Hi I'm learning kubernetes and I'm having trouble exposing the service.
I want to route traffic to my cluster from HAProxy.
I'm using my own bare-metal server.</p>
<p>example config:</p>
<p>deployment.yaml</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: apache
  labels:
    app: apache-test
spec:
  replicas: 1
  selector:
    matchLabels:
      app: apache-test
  template:
    metadata:
      labels:
        app: apache-test
    spec:
      containers:
      - name: apache
        image: httpd
        ports:
        - containerPort: 80
</code></pre>
<p>service.yaml</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: apache-test-service
spec:
  selector:
    app: apache-test
  ports:
  - protocol: TCP
    port: 80
    targetPort: 80
    name: http
</code></pre>
<p>ingress.yaml</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: apache-test-ingress
spec:
  rules:
  - host: apache-test.com
    http:
      paths:
      - pathType: Prefix
        path: &quot;/&quot;
        backend:
          service:
            name: apache-test-service
            port:
              number: 80
</code></pre>
<p>What's wrong?</p>

Paweł Zając
<p>In general, setting up the ingress resource is not enough. You have to deploy an ingress controller as well: <a href="https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/</a> .</p>
<p>I have no experience with HAProxy specifically, but I would get started with <a href="https://haproxy-ingress.github.io/docs/getting-started/" rel="nofollow noreferrer">https://haproxy-ingress.github.io/docs/getting-started/</a> .</p>
