Skip to content
This repository was archived by the owner on Jul 11, 2023. It is now read-only.

Commit c24012f

Browse files
authored
feat(certs): add trust domain to mesh root certificate (#4767)
Adds the trust domain to the mesh root certificate CRD Signed-off-by: Sean Teeling <[email protected]>
1 parent 436e24f commit c24012f

File tree

6 files changed

+34
-12
lines changed

6 files changed

+34
-12
lines changed

charts/osm/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ The following table lists the configurable parameters of the osm chart and their
173173
| osm.tracing.endpoint | string | `"/api/v2/spans"` | Tracing collector's API path where the spans will be sent to |
174174
| osm.tracing.image | string | `"jaegertracing/all-in-one"` | Image used for tracing |
175175
| osm.tracing.port | int | `9411` | Port of the tracing collector service |
176+
| osm.trustDomain | string | `"cluster.local"` | The trust domain to use as part of the common name when requesting new certificates. |
176177
| osm.validatorWebhook.webhookConfigurationName | string | `""` | Name of the ValidatingWebhookConfiguration |
177178
| osm.vault.host | string | `""` | Hashicorp Vault host/service - where Vault is installed |
178179
| osm.vault.port | int | `8200` | port to use to connect to Vault |

charts/osm/templates/preset-mesh-root-certificate.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ metadata:
66
data:
77
preset-mesh-root-certificate.json: |
88
{
9+
"trustDomain": {{.Values.osm.trustDomain | mustToJson}},
910
"provider": {
1011
{{- if eq (.Values.osm.certificateProvider.kind | lower) "tresor"}}
1112
"tresor": {

charts/osm/values.schema.json

+10
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,16 @@
432432
"envoyproxy/envoy-windows:v1.19.3@sha256:f990f024e7e95f07b6c0d416684734607761e382c35d1ba9414c7e3fbf23969c"
433433
]
434434
},
435+
"trustDomain": {
436+
"$id": "#/properties/osm/properties/trustDomain",
437+
"type": "string",
438+
"title": "The certificate issuance Trust Domain",
439+
"description": "The trust domain to use as part of the common name when requesting new certificates.",
440+
"examples": [
441+
"cluster.local",
442+
"example.com"
443+
]
444+
},
435445
"certificateProvider": {
436446
"$id": "#/properties/osm/properties/certificateProvider",
437447
"type": "object",

charts/osm/values.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ osm:
108108
# -- Image used for Prometheus
109109
image: prom/prometheus:v2.34.0
110110

111+
# -- The trust domain to use as part of the common name when requesting new certificates.
112+
trustDomain: cluster.local
113+
111114
certificateProvider:
112115
# -- The Certificate manager type: `tresor`, `vault` or `cert-manager`
113116
kind: tresor

cmd/osm-bootstrap/crds/config_mesh_root_certificate.yaml

+16-12
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ kind: CustomResourceDefinition
1919
metadata:
2020
name: meshrootcertificates.config.openservicemesh.io
2121
labels:
22-
app.kubernetes.io/name : "openservicemesh.io"
22+
app.kubernetes.io/name: "openservicemesh.io"
2323
spec:
2424
group: config.openservicemesh.io
2525
scope: Namespaced
@@ -35,14 +35,14 @@ spec:
3535
served: true
3636
storage: true
3737
additionalPrinterColumns:
38-
- description: Current state of the MeshRootCertificate config
39-
jsonPath: .status.currentState
40-
name: State
41-
type: string
42-
- description: Current rotationStage of the MeshRootCertificate config
43-
jsonPath: .status.currentRotationStage
44-
name: RotationStage
45-
type: string
38+
- description: Current state of the MeshRootCertificate config
39+
jsonPath: .status.currentState
40+
name: State
41+
type: string
42+
- description: Current rotationStage of the MeshRootCertificate config
43+
jsonPath: .status.currentRotationStage
44+
name: RotationStage
45+
type: string
4646
schema:
4747
openAPIV3Schema:
4848
type: object
@@ -52,6 +52,10 @@ spec:
5252
required:
5353
- provider
5454
properties:
55+
trustDomain:
56+
description: Trust Domain to use in common name for certificates, e.g. "example.com"
57+
type: string
58+
default: cluster.local
5559
provider:
5660
description: Certificate provider used by the mesh control plane
5761
type: object
@@ -149,9 +153,9 @@ spec:
149153
description: Namespace of the kubernetes secret
150154
type: string
151155
oneOf:
152-
- required: ['certManager']
153-
- required: ['vault']
154-
- required: ['tresor']
156+
- required: ["certManager"]
157+
- required: ["vault"]
158+
- required: ["tresor"]
155159
status:
156160
type: object
157161
x-kubernetes-preserve-unknown-fields: true

pkg/apis/config/v1alpha2/meshrootcertificate.go

+3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ type MeshRootCertificate struct {
3030
type MeshRootCertificateSpec struct {
3131
// Provider specifies the mesh certificate provider
3232
Provider ProviderSpec `json:"provider"`
33+
34+
// TrustDomain is the trust domain to use as a suffix in Common Names for new certificates.
35+
TrustDomain string `json:"trustDomain"`
3336
}
3437

3538
// ProviderSpec defines the certificate provider used by the mesh control plane

0 commit comments

Comments
 (0)