<p>This is about <strong>Traefik</strong> not about the way it works with <strong>K3s</strong> Kubernetes generally, so please don't give me a general K8s answer.</p>
<p>I have a simple k3s deployment and service that looks like this...</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  labels:
    app: hello-express
  name: app-tier
spec:
  type: LoadBalancer
  ports:
    - protocol: TCP
      port: 3000
      targetPort: 3000
  selector:
    tier: app

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: hello-express-deployment
  labels:
    app: hello-express
    tier: app
spec:
  replicas: 1
  selector:
    matchLabels:
      tier: app
  template:
    metadata:
      labels:
        app: hello-express
        tier: app
    spec:
      containers:
        - name: server
          image: partyk1d24/hello-express:latest
          ports:
            - containerPort: 3000
</code></pre>
<p>I can then access the application using the external ip and port 3000. Now I would like to change that port from 3000 to 80. Apparently this is controlled locally on K3s using <code>Traefik</code>. I tried the following while <a href="https://opensource.com/article/20/3/kubernetes-traefik" rel="nofollow noreferrer">looking here</a>...</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: hello-express-ingress
  annotations:
    kubernetes.io/ingress.class: &quot;traefik&quot;
spec:
  rules:
    - http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: app-tier
                port:
                  number: 80
</code></pre>
<p>But when I try to go to the site I get...</p>
<pre><code>curl 192.168.X.XXX      
Service Unavailable% 
</code></pre>
<p>The Blog is a little old so I am sure I am doing something wrong can someone help me identify it?</p>

Jackie
<p>You should change the port of service to 80.</p>
<pre><code>  ports:
    - protocol: TCP
      port: 80
      targetPort: 3000
</code></pre>
<p>Keep the target port as 3000.</p>
