microshift icon indicating copy to clipboard operation
microshift copied to clipboard

USHIFT-333: networking.k8s.io/v1 Ingress doesn't work - not handled by router/ingress controller

Open rbo opened this issue 2 years ago • 6 comments

What happened:

I deploy an application with an Ingress Object NOT an Route object, application is not available via ingress.

What you expected to happen:

Application is available via ingress.

How to reproduce it (as minimally and precisely as possible):

$ oc new-project demo-route
$ oc apply -f https://gist.githubusercontent.com/rbo/54b216b53d7f93de9631ca6a4359661c/raw/8dbec50e65ea811e5494d17e2d3571fd65d1e016/deploy.yaml
$  curl -k https://$(oc get route/simple-nginx -o jsonpath="{.status.ingress[0].host}")
Greetings from MicroShift

$ oc get routes
NAME           HOST/PORT                                                PATH   SERVICES       PORT   TERMINATION     WILDCARD
simple-nginx   simple-nginx-test-router.apps.microshift.openshift.pub          simple-nginx   8080   edge/Redirect   None

$ oc delete route/simple-nginx

$ cat <<EOF | kubectl apply -f -
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name:  simple-nginx
spec:
  rules:
    - host:  simple-nginx-test-router.apps.microshift.openshift.pub
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: simple-nginx
                port:
                  number: 8080
EOF

$  oc get route
No resources found in test-router namespace.

$ oc get ingress
NAME           CLASS    HOSTS                                                    ADDRESS   PORTS   AGE
simple-nginx   <none>   simple-nginx-test-router.apps.microshift.openshift.pub             80      4m32s

=> Address is empty, ingress controller does not handle the ingress.

Anything else we need to know?:

Usually on OpenShift if you create an Ingress object some controller in the background create an route too:

 oc get ingress,route
NAME                                     CLASS    HOSTS                                             ADDRESS                                  PORTS   AGE
ingress.networking.k8s.io/simple-nginx   <none>   simple-nginx-demo-route.apps.demo.openshift.pub   router-default.apps.demo.openshift.pub   80      3m43s

NAME                                          HOST/PORT                                         PATH   SERVICES       PORT        TERMINATION   WILDCARD
route.route.openshift.io/simple-nginx-m6snf   simple-nginx-demo-route.apps.demo.openshift.pub   /      simple-nginx   8080-8080                 None

Environment:

  • Microshift version (use microshift version):
[root@microshift ~]# /usr/local/bin/microshift version
MicroShift Version: 4.8.0-0.microshift-unknown
Base OKD Version: 4.8.0-0.okd-2021-10-10-030117
[root@microshift ~]# sha256sum /usr/local/bin/microshift
4b4115fb9689c88875452e70c475d131c2460ed5401342ffacd8569bf24211a1  /usr/local/bin/microshift

=> Nighly build from May 12 2022 https://github.com/openshift/microshift/releases/tag/nightly

  • Hardware configuration: Raspberry Pi 4 8GB
  • OS (e.g: cat /etc/os-release):
[root@microshift ~]# cat /etc/os-release 
NAME="Fedora Linux"
VERSION="36.20220810.0 (IoT Edition)"
ID=fedora
VERSION_ID=36
VERSION_CODENAME=""
PLATFORM_ID="platform:f36"
PRETTY_NAME="Fedora Linux 36.20220810.0 (IoT Edition)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:36"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f36/system-administrators-guide/"
SUPPORT_URL="https://ask.fedoraproject.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=36
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=36
PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy"
VARIANT="IoT Edition"
VARIANT_ID=iot
OSTREE_VERSION='36.20220810.0'
[root@microshift ~]# 
  • Kernel (e.g. uname -a): Linux microshift 5.18.16-200.fc36.aarch64 #1 SMP PREEMPT_DYNAMIC Wed Aug 3 15:07:15 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
  • Others:

Relevant Logs

rbo avatar Aug 14 '22 08:08 rbo

/kind bug

dhellmann avatar Aug 21 '22 17:08 dhellmann

Also reproducible on x86_64 arch on RHEL Edge

sq7lrx avatar Aug 27 '22 17:08 sq7lrx

Could you please show the ingress manifest that has been created?

oglok avatar Sep 16 '22 09:09 oglok

@oglok here again:

$ cat <<EOF | kubectl apply -f -
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name:  simple-nginx
spec:
  rules:
    - host:  simple-nginx-test-router.apps.microshift.openshift.pub
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: simple-nginx
                port:
                  number: 8080
EOF

Here https://github.com/openshift/microshift/issues/860#issue-1338174707 all details "how to reproduce..."

rbo avatar Sep 19 '22 13:09 rbo

@oglok here again:

$ cat <<EOF | kubectl apply -f -
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name:  simple-nginx
spec:
  rules:
    - host:  simple-nginx-test-router.apps.microshift.openshift.pub
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: simple-nginx
                port:
                  number: 8080
EOF

Here #860 (comment) all details "how to reproduce..."

I swear I looked for it twice... my bad! thx

oglok avatar Sep 19 '22 13:09 oglok

In main branch, adding your ingress manifests to MicroShift will create the route as long as it complies with certain requirements (like having host in the spec):

cat ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name:  simple-nginx
spec:
  rules:
    - host: my-nginx.ogloknet.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: simple-nginx
                port:
                  number: 8080

 oc get ingress
NAME           CLASS    HOSTS                   ADDRESS                             PORTS   AGE
simple-nginx   <none>   my-nginx.ogloknet.com   router-default.apps.cluster.local   80      5s

[root@maxwell ~]# oc get route
NAME                 HOST                    ADMITTED   SERVICE        TLS
simple-nginx-64tj2   my-nginx.ogloknet.com   True       simple-nginx

oglok avatar Sep 19 '22 14:09 oglok

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

openshift-bot avatar Dec 19 '22 01:12 openshift-bot

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten /remove-lifecycle stale

openshift-bot avatar Jan 18 '23 08:01 openshift-bot

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen. Mark the issue as fresh by commenting /remove-lifecycle rotten. Exclude this issue from closing again by commenting /lifecycle frozen.

/close

openshift-bot avatar Feb 18 '23 00:02 openshift-bot

@openshift-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen. Mark the issue as fresh by commenting /remove-lifecycle rotten. Exclude this issue from closing again by commenting /lifecycle frozen.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

openshift-ci[bot] avatar Feb 18 '23 00:02 openshift-ci[bot]