Skip to content

Ingress

Overview

See the official documentation.

Ingress kind

Different resources kind provide Ingress capabilities.

Operations

List the ingress resources

Current namespace:

kubectl get ingress

Specific namespace:

kubectl -n ${namespace} get ingress

All namespaces:

kubectl get -A ingress

Current namespace:

kubectl get ingressroute

Specific namespace:

kubectl -n ${namespace} get ingressroute

All namespaces:

kubectl get -A ingressroute

Create an ingress

Order of operations

An Ingress is used to access a Service.

If your Ingress does not seems to work, be sure you have a proper Service.

Current namespace:

kubectl apply -f ${file}

Specific namespace:

kubectl -n ${namespace} apply -f ${file}

Example ingress file (i.e. ${file}):

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: hello-world
spec:
  rules:
  - http:
      paths:
      - path: "/"
        pathType: Prefix
        backend:
          service:
            name: hello-world
            port:
              number: 8080
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: hello-world
spec:
  entryPoints:
  - web
  - websecure
  routes:
  - kind: Rule
    match: "HostRegexp(`hello-world.{domain:.*}`)"
    services:
    - name: hello-world
      port: 8080
  tls: {}