Skip to content

Commit

Permalink
Improve cert-manager resources for Eventing TLS certs provisioning (#…
Browse files Browse the repository at this point in the history
…6953)

This PR is refactoring how we provision certificates with cert-manager
in a way that is much easier for organizations to plug their own
root CA or even use a different issuer.

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
  • Loading branch information
pierDipi authored May 17, 2023
1 parent fc5befb commit da31970
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2023 The Knative Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
Expand Down Expand Up @@ -27,6 +41,6 @@ spec:
- broker-filter.knative-eventing.svc.cluster.local

issuerRef:
name: selfsigned-issuer
name: selfsigned-ca-issuer
kind: Issuer
group: cert-manager.io
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2023 The Knative Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
Expand Down Expand Up @@ -27,6 +41,6 @@ spec:
- broker-ingress.knative-eventing.svc.cluster.local

issuerRef:
name: selfsigned-issuer
name: selfsigned-ca-issuer
kind: Issuer
group: cert-manager.io
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2023 The Knative Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
Expand Down Expand Up @@ -27,6 +41,6 @@ spec:
- imc-dispatcher.knative-eventing.svc.cluster.local

issuerRef:
name: selfsigned-issuer
name: selfsigned-ca-issuer
kind: Issuer
group: cert-manager.io
7 changes: 0 additions & 7 deletions config/tls/issuers/eventing-selfsigned-issuer.yaml

This file was deleted.

23 changes: 23 additions & 0 deletions config/tls/issuers/selfsigned-ca-issuer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2023 The Knative Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# This is the issuer that every Eventing component should use to issue their server's certs.
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: selfsigned-ca-issuer
namespace: knative-eventing
spec:
ca:
secretName: eventing-ca
42 changes: 42 additions & 0 deletions config/tls/issuers/selfsigned-issuer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Copyright 2023 The Knative Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# This is the root issuer to bootstrap the eventing CA.
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: selfsigned-issuer
namespace: knative-eventing
spec:
selfSigned: {}
---
# This is the Eventing CA certificate.
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: selfsigned-ca
namespace: knative-eventing
spec:
secretName: eventing-ca

isCA: true
commonName: selfsigned-ca
privateKey:
algorithm: ECDSA
size: 256

issuerRef:
name: selfsigned-issuer
kind: Issuer
group: cert-manager.io

0 comments on commit da31970

Please sign in to comment.