<p>When I am create treafik ingress,it throw this error:</p>
<pre><code>{&quot;ingress&quot;:&quot;kubernetes-dashboard-route&quot;,&quot;level&quot;:&quot;error&quot;,&quot;msg&quot;:&quot;Cannot create service: service port not found&quot;,&quot;namespace&quot;:&quot;kube-system&quot;,&quot;providerName&quot;:&quot;kubernetescrd&quot;,&quot;serviceName&quot;:&quot;kubernetes-dashboard&quot;,&quot;servicePort&quot;:8443,&quot;time&quot;:&quot;2020-01-30T18:12:15Z&quot;}
{&quot;ingress&quot;:&quot;kubernetes-dashboard-route&quot;,&quot;level&quot;:&quot;error&quot;,&quot;msg&quot;:&quot;Cannot create service: service port not found&quot;,&quot;namespace&quot;:&quot;kube-system&quot;,&quot;providerName&quot;:&quot;kubernetescrd&quot;,&quot;serviceName&quot;:&quot;kubernetes-dashboard&quot;,&quot;servicePort&quot;:8443,&quot;time&quot;:&quot;2020-01-30T18:12:17Z&quot;}
</code></pre>
<p>this is the treafik define kubernetes-dashboard-route.yaml file:</p>
<pre><code>apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: kubernetes-dashboard-route
spec:
  entryPoints:
    - websecure
  tls:
    secretName: cloud-mydlq-tls
  routes:
    - match: Host(`kubernetes.balabala.com`)
      kind: Rule
      services:
        - name: kubernetes-dashboard
          port: 8443
</code></pre>
<p>this is the kubernetes dashboard file:</p>
<pre><code>{
  &quot;kind&quot;: &quot;Pod&quot;,
  &quot;apiVersion&quot;: &quot;v1&quot;,
  &quot;metadata&quot;: {
    &quot;name&quot;: &quot;kubernetes-dashboard-6466b68b-mrrs9&quot;,
    &quot;generateName&quot;: &quot;kubernetes-dashboard-6466b68b-&quot;,
    &quot;namespace&quot;: &quot;kube-system&quot;,
    &quot;selfLink&quot;: &quot;/api/v1/namespaces/kube-system/pods/kubernetes-dashboard-6466b68b-mrrs9&quot;,
    &quot;uid&quot;: &quot;fafd91a2-6e49-4f09-8479-b593f3f1d005&quot;,
    &quot;resourceVersion&quot;: &quot;12218565&quot;,
    &quot;creationTimestamp&quot;: &quot;2020-01-25T16:51:10Z&quot;,
    &quot;labels&quot;: {
      &quot;k8s-app&quot;: &quot;kubernetes-dashboard&quot;,
      &quot;pod-template-hash&quot;: &quot;6466b68b&quot;
    },
    &quot;annotations&quot;: {
      &quot;scheduler.alpha.kubernetes.io/critical-pod&quot;: &quot;&quot;,
      &quot;seccomp.security.alpha.kubernetes.io/pod&quot;: &quot;docker/default&quot;
    },
    &quot;ownerReferences&quot;: [
      {
        &quot;apiVersion&quot;: &quot;apps/v1&quot;,
        &quot;kind&quot;: &quot;ReplicaSet&quot;,
        &quot;name&quot;: &quot;kubernetes-dashboard-6466b68b&quot;,
        &quot;uid&quot;: &quot;3d8e2739-5113-4398-b7b8-28bda186b15e&quot;,
        &quot;controller&quot;: true,
        &quot;blockOwnerDeletion&quot;: true
      }
    ]
  },
  &quot;spec&quot;: {
    &quot;volumes&quot;: [
      {
        &quot;name&quot;: &quot;kubernetes-dashboard-certs&quot;,
        &quot;secret&quot;: {
          &quot;secretName&quot;: &quot;kubernetes-dashboard-certs&quot;,
          &quot;defaultMode&quot;: 420
        }
      },
      {
        &quot;name&quot;: &quot;tmp-volume&quot;,
        &quot;emptyDir&quot;: {}
      },
      {
        &quot;name&quot;: &quot;kubernetes-dashboard-token-pmxpf&quot;,
        &quot;secret&quot;: {
          &quot;secretName&quot;: &quot;kubernetes-dashboard-token-pmxpf&quot;,
          &quot;defaultMode&quot;: 420
        }
      }
    ],
    &quot;containers&quot;: [
      {
        &quot;name&quot;: &quot;kubernetes-dashboard&quot;,
        &quot;image&quot;: &quot;gcr.azk8s.cn/google_containers/kubernetes-dashboard-amd64:v1.10.1&quot;,
        &quot;args&quot;: [
          &quot;--auto-generate-certificates&quot;,
          &quot;--token-ttl=43200&quot;
        ],
        &quot;ports&quot;: [
          {
            &quot;containerPort&quot;: 8443,
            &quot;protocol&quot;: &quot;TCP&quot;
          }
        ],
        &quot;resources&quot;: {
          &quot;limits&quot;: {
            &quot;cpu&quot;: &quot;100m&quot;,
            &quot;memory&quot;: &quot;300Mi&quot;
          },
          &quot;requests&quot;: {
            &quot;cpu&quot;: &quot;50m&quot;,
            &quot;memory&quot;: &quot;100Mi&quot;
          }
        },
        &quot;volumeMounts&quot;: [
          {
            &quot;name&quot;: &quot;kubernetes-dashboard-certs&quot;,
            &quot;mountPath&quot;: &quot;/certs&quot;
          },
          {
            &quot;name&quot;: &quot;tmp-volume&quot;,
            &quot;mountPath&quot;: &quot;/tmp&quot;
          },
          {
            &quot;name&quot;: &quot;kubernetes-dashboard-token-pmxpf&quot;,
            &quot;readOnly&quot;: true,
            &quot;mountPath&quot;: &quot;/var/run/secrets/kubernetes.io/serviceaccount&quot;
          }
        ],
        &quot;livenessProbe&quot;: {
          &quot;httpGet&quot;: {
            &quot;path&quot;: &quot;/&quot;,
            &quot;port&quot;: 8443,
            &quot;scheme&quot;: &quot;HTTPS&quot;
          },
          &quot;initialDelaySeconds&quot;: 30,
          &quot;timeoutSeconds&quot;: 30,
          &quot;periodSeconds&quot;: 10,
          &quot;successThreshold&quot;: 1,
          &quot;failureThreshold&quot;: 3
        },
        &quot;terminationMessagePath&quot;: &quot;/dev/termination-log&quot;,
        &quot;terminationMessagePolicy&quot;: &quot;File&quot;,
        &quot;imagePullPolicy&quot;: &quot;IfNotPresent&quot;
      }
    ],
    &quot;restartPolicy&quot;: &quot;Always&quot;,
    &quot;terminationGracePeriodSeconds&quot;: 30,
    &quot;dnsPolicy&quot;: &quot;ClusterFirst&quot;,
    &quot;serviceAccountName&quot;: &quot;kubernetes-dashboard&quot;,
    &quot;serviceAccount&quot;: &quot;kubernetes-dashboard&quot;,
    &quot;nodeName&quot;: &quot;azshara-k8s01&quot;,
    &quot;securityContext&quot;: {},
    &quot;schedulerName&quot;: &quot;default-scheduler&quot;,
    &quot;tolerations&quot;: [
      {
        &quot;key&quot;: &quot;CriticalAddonsOnly&quot;,
        &quot;operator&quot;: &quot;Exists&quot;
      },
      {
        &quot;key&quot;: &quot;node.kubernetes.io/not-ready&quot;,
        &quot;operator&quot;: &quot;Exists&quot;,
        &quot;effect&quot;: &quot;NoExecute&quot;,
        &quot;tolerationSeconds&quot;: 360
      },
      {
        &quot;key&quot;: &quot;node.kubernetes.io/unreachable&quot;,
        &quot;operator&quot;: &quot;Exists&quot;,
        &quot;effect&quot;: &quot;NoExecute&quot;,
        &quot;tolerationSeconds&quot;: 360
      }
    ],
    &quot;priorityClassName&quot;: &quot;system-cluster-critical&quot;,
    &quot;priority&quot;: 2000000000,
    &quot;enableServiceLinks&quot;: true
  },
  &quot;status&quot;: {
    &quot;phase&quot;: &quot;Running&quot;,
    &quot;conditions&quot;: [
      {
        &quot;type&quot;: &quot;Initialized&quot;,
        &quot;status&quot;: &quot;True&quot;,
        &quot;lastProbeTime&quot;: null,
        &quot;lastTransitionTime&quot;: &quot;2020-01-25T16:51:10Z&quot;
      },
      {
        &quot;type&quot;: &quot;Ready&quot;,
        &quot;status&quot;: &quot;True&quot;,
        &quot;lastProbeTime&quot;: null,
        &quot;lastTransitionTime&quot;: &quot;2020-01-25T16:51:24Z&quot;
      },
      {
        &quot;type&quot;: &quot;ContainersReady&quot;,
        &quot;status&quot;: &quot;True&quot;,
        &quot;lastProbeTime&quot;: null,
        &quot;lastTransitionTime&quot;: &quot;2020-01-25T16:51:24Z&quot;
      },
      {
        &quot;type&quot;: &quot;PodScheduled&quot;,
        &quot;status&quot;: &quot;True&quot;,
        &quot;lastProbeTime&quot;: null,
        &quot;lastTransitionTime&quot;: &quot;2020-01-25T16:51:10Z&quot;
      }
    ],
    &quot;hostIP&quot;: &quot;172.19.104.231&quot;,
    &quot;podIP&quot;: &quot;172.30.224.9&quot;,
    &quot;startTime&quot;: &quot;2020-01-25T16:51:10Z&quot;,
    &quot;containerStatuses&quot;: [
      {
        &quot;name&quot;: &quot;kubernetes-dashboard&quot;,
        &quot;state&quot;: {
          &quot;running&quot;: {
            &quot;startedAt&quot;: &quot;2020-01-25T16:51:23Z&quot;
          }
        },
        &quot;lastState&quot;: {},
        &quot;ready&quot;: true,
        &quot;restartCount&quot;: 0,
        &quot;image&quot;: &quot;gcr.azk8s.cn/google_containers/kubernetes-dashboard-amd64:v1.10.1&quot;,
        &quot;imageID&quot;: &quot;docker-pullable://gcr.azk8s.cn/google_containers/kubernetes-dashboard-amd64@sha256:0ae6b69432e78069c5ce2bcde0fe409c5c4d6f0f4d9cd50a17974fea38898747&quot;,
        &quot;containerID&quot;: &quot;docker://07ab8a9e93cb2f9a27194f73094ce77cb8938edf32a36fe6962737bfd16c3c38&quot;
      }
    ],
    &quot;qosClass&quot;: &quot;Burstable&quot;
  }
}
</code></pre>
<p>what is wrong with my config,the kubernetes dashboard config is in 8443 port? and in the same namespace,why it give port not found exception?</p>

<p>The port 8443 is container port,could not access outside the container.You should using this command to find the cluster service port:</p>

<pre><code>kubectl get svc --namespace=kube-system

NAME                   TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)                   AGE
kube-dns               ClusterIP   10.254.0.2      &lt;none&gt;        53/UDP,53/TCP,9153/TCP    131d
kubernetes-dashboard   NodePort    10.254.75.193   &lt;none&gt;        443:31085/TCP             131d
traefik                ClusterIP   10.254.169.66   &lt;none&gt;        80/TCP,443/TCP,8080/TCP   2d4h
</code></pre>

<p>the port 443 is the cluster port treafik could access. change container port 8443 to port 443.</p>
