serving icon indicating copy to clipboard operation
serving copied to clipboard

Deleting a ksvc keeps a dm ingress in ready=true status

Open skonto opened this issue 2 years ago • 0 comments

What version of Knative?

All versions

Expected Behavior

All ingresses should be handled the same

Actual Behavior

Ingresses that belong to a dm are not set to the proper status

Steps to Reproduce the Problem

Have a random ingress in test ns:

apiVersion: networking.internal.knative.dev/v1alpha1
kind: Ingress
metadata:
  annotations:
    networking.knative.dev/ingress.class: kourier.ingress.networking.knative.dev
  finalizers:
  - ingresses.networking.internal.knative.dev
  name: hello.test
spec:
  httpOption: Enabled
  rules:
  - hosts:
    - hello.home
    http:
      paths:
      - rewriteHost: helloworld-go.test.svc.cluster.local
        splits:
        - appendHeaders:
            K-Original-Host: hello.home
          percent: 100
          serviceName: helloworld-go
          serviceNamespace: test
          servicePort: 80
    visibility: ExternalIP

and a dm:

apiVersion: serving.knative.dev/v1beta1
kind: DomainMapping
metadata:
  name: hello.home
spec:
  ref:
    name: helloworld-go
    kind: Service
    apiVersion: serving.knative.dev/v1

service:

apiVersion: serving.knative.dev/v1
kind: Service
metadata:
  name: helloworld-go
spec:
  template:
    metadata:
      labels:
        app: helloworld-go
      annotations:
        autoscaling.knative.dev/target: "10"
        autoscaling.knative.dev/min-scale: "1"
    spec:
      containers:
      - image: docker.io/skonto/readiness-fb0769c36a9b8c20b418ae9161a58e77@sha256:6f8d38ac33d584062a33d33485d3796fdff10e9d6274ca722dd2b16847db58c8
        imagePullPolicy: Always
        env:
        - name: TARGET
          value: "Go Sample v1"
        livenessProbe:
          httpGet:
            path: /healthz
          periodSeconds: 1
          failureThreshold: 1
          readinessProbe:
          httpGet:
            path: /healthz
          periodSeconds: 1
          failureThreshold: 1
# deploy the service, dm, ingress:

$ oc get ingresses.networking.internal.knative.dev  -n test
NAME            READY   REASON
hello.home      True    
hello.test      False   DomainConflict
helloworld-go   True    

$ oc delete ksvc --all -n test
service.serving.knative.dev "helloworld-go" deleted

$ oc get dm -n test
NAME         URL                 READY   REASON
hello.home   http://hello.home   False   ResolveFailed

$ oc get ingresses.networking.internal.knative.dev  -n test
NAME         READY     REASON
hello.home   True      
hello.test   Unknown   Uninitialized

Applying the ksvc again:

$ oc get ingresses.networking.internal.knative.dev  -n test
NAME            READY   REASON
hello.home      True    
hello.test      False   DomainConflict
helloworld-go   True    
$ oc get dm -n test
NAME         URL                 READY   REASON
hello.home   http://hello.home   True    

skonto avatar Dec 05 '23 11:12 skonto