File tree Expand file tree Collapse file tree 6 files changed +21
-12
lines changed Expand file tree Collapse file tree 6 files changed +21
-12
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,8 @@ type KbsLocalCertCacheEntry struct {
5555 // SecretName is the name of the secret that maps to a local directory containing the certificates
5656 SecretName string `json:"secretName"`
5757 // MountPath is the destination path in the trustee file system
58+ // The default path is "/etc/kbs/certs" if not specified by the user
59+ // +optional
5860 MountPath string `json:"mountPath"`
5961}
6062
Original file line number Diff line number Diff line change @@ -114,15 +114,15 @@ spec:
114114 cache entry with secret and mount path
115115 properties :
116116 mountPath :
117- description : MountPath is the destination path in the trustee
118- file system
117+ description : |-
118+ MountPath is the destination path in the trustee file system
119+ The default path is "/etc/kbs/certs" if not specified by the user
119120 type : string
120121 secretName :
121122 description : SecretName is the name of the secret that maps
122123 to a local directory containing the certificates
123124 type : string
124125 required :
125- - mountPath
126126 - secretName
127127 type : object
128128 type : array
Original file line number Diff line number Diff line change @@ -114,15 +114,15 @@ spec:
114114 cache entry with secret and mount path
115115 properties :
116116 mountPath :
117- description : MountPath is the destination path in the trustee
118- file system
117+ description : |-
118+ MountPath is the destination path in the trustee file system
119+ The default path is "/etc/kbs/certs" if not specified by the user
119120 type : string
120121 secretName :
121122 description : SecretName is the name of the secret that maps
122123 to a local directory containing the certificates
123124 type : string
124125 required :
125- - mountPath
126126 - secretName
127127 type : object
128128 type : array
Original file line number Diff line number Diff line change 3838` ` `
3939
4040The ` VCEK.crt` certificate will be mounted in the trustee `mountPath` directory.
41+ The `mountPath` directory defaults to `/etc/kbs/certs` if not provided by the user.
4142
4243# ## Multiple Certificates
4344
@@ -54,12 +55,12 @@ spec:
5455 # ...
5556 kbsLocalCertCacheSpec:
5657 secrets:
57- - secretName: vcek-secret
58- mountPath: "/etc/kbs/snp/ek"
59- - secretName: ca-certs-secret
60- mountPath: "/etc/ssl/certs "
61- - secretName: client-certs-secret
62- mountPath: "/etc/ssl/client-certs "
58+ - secretName: vcek-milan
59+ mountPath: "/etc/kbs/snp/ek/milan "
60+ - secretName: vcek-genoa
61+ mountPath: "/etc/kbs/snp/ek/genoa "
62+ - secretName: vcek-turin
63+ mountPath: "/etc/kbs/snp/ek/turin "
6364` ` `
6465
6566Each secret will be mounted to its specified `mountPath` in the trustee file system.
Original file line number Diff line number Diff line change @@ -76,6 +76,9 @@ const (
7676
7777 // default attestation policy filename for cpu
7878 defaultAttestationCpuPolicy = "default_cpu.rego"
79+
80+ // default directory for locally cached certificates
81+ kbsDefaultLocalCacheDir = "/etc/kbs/certs"
7982)
8083
8184func contains (list []string , s string ) bool {
Original file line number Diff line number Diff line change @@ -427,6 +427,9 @@ func (r *KbsConfigReconciler) newKbsDeployment(ctx context.Context) (*appsv1.Dep
427427 return nil , err
428428 }
429429 volumes = append (volumes , * volume )
430+ if certCacheEntry .MountPath == "" {
431+ certCacheEntry .MountPath = kbsDefaultLocalCacheDir
432+ }
430433 volumeMount = createVolumeMount (volume .Name , certCacheEntry .MountPath )
431434 kbsVM = append (kbsVM , volumeMount )
432435 }
You can’t perform that action at this time.
0 commit comments