knative / serving

Kubernetes-based, scale-to-zero, request-driven compute
https://knative.dev/docs/serving/
Apache License 2.0
5.57k stars 1.16k forks source link

Can not configure issuerRef, clusterLocalIssuerRef and systemInternalIssuerRef to distinct values. Fix attached #15433

Closed mstein11 closed 3 months ago

mstein11 commented 3 months ago

What version of Knative?

1.15.0

Expected Behavior

When configuring cert manager, it should be possible to configure issuerRef, clusterLocalIssuerRef and systemInternalIssuerRef to three different configurations.

Actual Behavior

When setting one of issuerRef, clusterLocalIssuerRef and systemInternalIssuerRef in config-certmanager. All three get set to the same value. It is not possible to set distinct values for those fields.

Steps to Reproduce the Problem

Create knative serving configuration with the following:

apiVersion: operator.knative.dev/v1beta1
kind: KnativeServing
metadata:
  name: knative-serving
  namespace: knative-serving
spec:
  config:
    certmanager: 
      "issuerRef": |
        kind: ClusterIssuer
        name: letsencrypt-knative-prod
      "clusterLocalIssuerRef": |
        kind: ClusterIssuer
        name: knative-selfsigned-issuer
      "systemInternalIssuerRef": |
        kind: ClusterIssuer
        name: knative-selfsigned-issuer

Create a ksvc:

apiVersion: serving.knative.dev/v1
kind: Service
metadata:
  name: nginx-knative
  namespace: nginx-knative
spec:
  template:
    spec:
        - image: nginx
          ports:
            - containerPort: 80

The corresponding certificate will be of type knative-selfsigned-issuer.

Check the test case and bugfix in my fork as well: https://github.com/mstein11/knative-serving/tree/verify_bug_in_cert_manager_config