Skip to content

Commit 87fa8ec

Browse files
committed
Added annotations to CRD attributes
Signed-off-by: Leonardo Milleri <[email protected]>
1 parent c1203e6 commit 87fa8ec

File tree

4 files changed

+57
-19
lines changed

4 files changed

+57
-19
lines changed

README.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,19 @@ The operator manages a Kubernetes custom resource named: `KbsConfig`. Following
99
`KbsConfig` custom resource definition
1010

1111
```golang
12+
// KbsConfigSpec defines the desired state of KbsConfig
1213
type KbsConfigSpec struct {
13-
1414
// KbsConfigMapName is the name of the configmap that contains the KBS configuration
1515
KbsConfigMapName string `json:"kbsConfigMapName,omitempty"`
1616

1717
// KbsAsConfigMapName is the name of the configmap that contains the KBS AS configuration
18+
// Required only when MicroservicesDeployment is set
19+
// +optional
1820
KbsAsConfigMapName string `json:"kbsAsConfigMapName,omitempty"`
1921

2022
// KbsRvpsConfigMapName is the name of the configmap that contains the KBS RVPS configuration
23+
// Required only when MicroservicesDeployment is set
24+
// +optional
2125
KbsRvpsConfigMapName string `json:"kbsRvpsConfigMapName,omitempty"`
2226

2327
// kbsRvpsRefValuesConfigMapName is the name of the configmap that contains the RVPS reference values
@@ -27,39 +31,44 @@ type KbsConfigSpec struct {
2731
KbsAuthSecretName string `json:"kbsAuthSecretName,omitempty"`
2832

2933
// KbsServiceType is the type of service to create for KBS
34+
// Default value is ClusterIP
35+
// +optional
3036
KbsServiceType corev1.ServiceType `json:"kbsServiceType,omitempty"`
3137

3238
// KbsDeploymentType is the type of KBS deployment
33-
// It can assume one of the following values:
39+
// It can assume one of the fREADME.mdollowing values:
3440
// AllInOneDeployment: all the KBS components will be deployed in the same container
35-
// MicroservicesDeployment: all the KBS components will be deployed in separate containers (part of the same Kubernetes pod)
41+
// MicroservicesDeployment: all the KBS components will be deployed in separate containers
42+
// +kubebuilder:validation:Enum=AllInOneDeployment;MicroservicesDeployment
43+
// Default value is AllInOneDeployment
44+
// +optional
3645
KbsDeploymentType DeploymentType `json:"kbsDeploymentType,omitempty"`
37-
46+
3847
// KbsHttpsKeySecretName is the name of the secret that contains the KBS https private key
3948
KbsHttpsKeySecretName string `json:"kbsHttpsKeySecretName,omitempty"`
4049

4150
// KbsHttpsCertSecretName is the name of the secret that contains the KBS https certificate
4251
KbsHttpsCertSecretName string `json:"kbsHttpsCertSecretName,omitempty"`
4352

44-
// KbsHttpsKeySecretName is the name of the secret that contains the KBS https private key
45-
KbsHttpsKeySecretName string `json:"kbsHttpsKeySecretName,omitempty"`
46-
4753
// KbsSecretResources is an array of secret names that contain the keys required by clients
54+
// +optional
4855
KbsSecretResources []string `json:"kbsSecretResources,omitempty"`
4956

5057
// kbsResourcePolicyConfigMapName is the name of the configmap that contains the Resource Policy
58+
// +optional
5159
KbsResourcePolicyConfigMapName string `json:"kbsResourcePolicyConfigMapName,omitempty"`
5260

5361
// tdxConfigSpec is the struct that hosts the TDX specific configuration
62+
// +optional
5463
TdxConfigSpec TdxConfigSpec `json:"tdxConfigSpec,omitempty"`
5564
}
5665

5766
// TdxConfigSpec defines the desired state for TDX configuration
5867
type TdxConfigSpec struct {
5968
// kbsTdxConfigMapName is the name of the configmap that mounts the sgx_default_qcnl.conf
69+
// +optional
6070
KbsTdxConfigMapName string `json:"kbsTdxConfigMapName,omitempty"`
61-
}
62-
```
71+
}```
6372
6473
Note: the default deployment type is ```MicroservicesDeployment```.
6574
The examples below apply to this mode.

api/v1alpha1/kbsconfig_types.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const (
3939
// TdxConfigSpec defines the desired state for TDX configuration
4040
type TdxConfigSpec struct {
4141
// kbsTdxConfigMapName is the name of the configmap that mounts the sgx_default_qcnl.conf
42+
// +optional
4243
KbsTdxConfigMapName string `json:"kbsTdxConfigMapName,omitempty"`
4344
}
4445

@@ -51,9 +52,13 @@ type KbsConfigSpec struct {
5152
KbsConfigMapName string `json:"kbsConfigMapName,omitempty"`
5253

5354
// KbsAsConfigMapName is the name of the configmap that contains the KBS AS configuration
55+
// Required only when MicroservicesDeployment is set
56+
// +optional
5457
KbsAsConfigMapName string `json:"kbsAsConfigMapName,omitempty"`
5558

5659
// KbsRvpsConfigMapName is the name of the configmap that contains the KBS RVPS configuration
60+
// Required only when MicroservicesDeployment is set
61+
// +optional
5762
KbsRvpsConfigMapName string `json:"kbsRvpsConfigMapName,omitempty"`
5863

5964
// kbsRvpsRefValuesConfigMapName is the name of the configmap that contains the RVPS reference values
@@ -63,12 +68,17 @@ type KbsConfigSpec struct {
6368
KbsAuthSecretName string `json:"kbsAuthSecretName,omitempty"`
6469

6570
// KbsServiceType is the type of service to create for KBS
71+
// Default value is ClusterIP
72+
// +optional
6673
KbsServiceType corev1.ServiceType `json:"kbsServiceType,omitempty"`
6774

6875
// KbsDeploymentType is the type of KBS deployment
6976
// It can assume one of the following values:
7077
// AllInOneDeployment: all the KBS components will be deployed in the same container
7178
// MicroservicesDeployment: all the KBS components will be deployed in separate containers
79+
// +kubebuilder:validation:Enum=AllInOneDeployment;MicroservicesDeployment
80+
// Default value is AllInOneDeployment
81+
// +optional
7282
KbsDeploymentType DeploymentType `json:"kbsDeploymentType,omitempty"`
7383

7484
// KbsHttpsKeySecretName is the name of the secret that contains the KBS https private key
@@ -78,12 +88,15 @@ type KbsConfigSpec struct {
7888
KbsHttpsCertSecretName string `json:"kbsHttpsCertSecretName,omitempty"`
7989

8090
// KbsSecretResources is an array of secret names that contain the keys required by clients
91+
// +optional
8192
KbsSecretResources []string `json:"kbsSecretResources,omitempty"`
8293

8394
// kbsResourcePolicyConfigMapName is the name of the configmap that contains the Resource Policy
95+
// +optional
8496
KbsResourcePolicyConfigMapName string `json:"kbsResourcePolicyConfigMapName,omitempty"`
8597

8698
// tdxConfigSpec is the struct that hosts the TDX specific configuration
99+
// +optional
87100
TdxConfigSpec TdxConfigSpec `json:"tdxConfigSpec,omitempty"`
88101
}
89102

bundle/manifests/confidentialcontainers.org_kbsconfigs.yaml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ spec:
4040
description: KbsConfigSpec defines the desired state of KbsConfig
4141
properties:
4242
kbsAsConfigMapName:
43-
description: KbsAsConfigMapName is the name of the configmap that
44-
contains the KBS AS configuration
43+
description: |-
44+
KbsAsConfigMapName is the name of the configmap that contains the KBS AS configuration
45+
Required only when MicroservicesDeployment is set
4546
type: string
4647
kbsAuthSecretName:
4748
description: KbsAuthSecretName is the name of the secret that contains
@@ -57,6 +58,10 @@ spec:
5758
It can assume one of the following values:
5859
AllInOneDeployment: all the KBS components will be deployed in the same container
5960
MicroservicesDeployment: all the KBS components will be deployed in separate containers
61+
Default value is AllInOneDeployment
62+
enum:
63+
- AllInOneDeployment
64+
- MicroservicesDeployment
6065
type: string
6166
kbsHttpsCertSecretName:
6267
description: KbsHttpsCertSecretName is the name of the secret that
@@ -71,8 +76,9 @@ spec:
7176
that contains the Resource Policy
7277
type: string
7378
kbsRvpsConfigMapName:
74-
description: KbsRvpsConfigMapName is the name of the configmap that
75-
contains the KBS RVPS configuration
79+
description: |-
80+
KbsRvpsConfigMapName is the name of the configmap that contains the KBS RVPS configuration
81+
Required only when MicroservicesDeployment is set
7682
type: string
7783
kbsRvpsRefValuesConfigMapName:
7884
description: kbsRvpsRefValuesConfigMapName is the name of the configmap
@@ -85,7 +91,9 @@ spec:
8591
type: string
8692
type: array
8793
kbsServiceType:
88-
description: KbsServiceType is the type of service to create for KBS
94+
description: |-
95+
KbsServiceType is the type of service to create for KBS
96+
Default value is ClusterIP
8997
type: string
9098
tdxConfigSpec:
9199
description: tdxConfigSpec is the struct that hosts the TDX specific

config/crd/bases/confidentialcontainers.org_kbsconfigs.yaml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ spec:
4040
description: KbsConfigSpec defines the desired state of KbsConfig
4141
properties:
4242
kbsAsConfigMapName:
43-
description: KbsAsConfigMapName is the name of the configmap that
44-
contains the KBS AS configuration
43+
description: |-
44+
KbsAsConfigMapName is the name of the configmap that contains the KBS AS configuration
45+
Required only when MicroservicesDeployment is set
4546
type: string
4647
kbsAuthSecretName:
4748
description: KbsAuthSecretName is the name of the secret that contains
@@ -57,6 +58,10 @@ spec:
5758
It can assume one of the following values:
5859
AllInOneDeployment: all the KBS components will be deployed in the same container
5960
MicroservicesDeployment: all the KBS components will be deployed in separate containers
61+
Default value is AllInOneDeployment
62+
enum:
63+
- AllInOneDeployment
64+
- MicroservicesDeployment
6065
type: string
6166
kbsHttpsCertSecretName:
6267
description: KbsHttpsCertSecretName is the name of the secret that
@@ -71,8 +76,9 @@ spec:
7176
that contains the Resource Policy
7277
type: string
7378
kbsRvpsConfigMapName:
74-
description: KbsRvpsConfigMapName is the name of the configmap that
75-
contains the KBS RVPS configuration
79+
description: |-
80+
KbsRvpsConfigMapName is the name of the configmap that contains the KBS RVPS configuration
81+
Required only when MicroservicesDeployment is set
7682
type: string
7783
kbsRvpsRefValuesConfigMapName:
7884
description: kbsRvpsRefValuesConfigMapName is the name of the configmap
@@ -85,7 +91,9 @@ spec:
8591
type: string
8692
type: array
8793
kbsServiceType:
88-
description: KbsServiceType is the type of service to create for KBS
94+
description: |-
95+
KbsServiceType is the type of service to create for KBS
96+
Default value is ClusterIP
8997
type: string
9098
tdxConfigSpec:
9199
description: tdxConfigSpec is the struct that hosts the TDX specific

0 commit comments

Comments
 (0)