···11+{{- if .Values.crds.install }}
22+---
33+apiVersion: apiextensions.k8s.io/v1
44+kind: CustomResourceDefinition
55+metadata:
66+ annotations:
77+ controller-gen.kubebuilder.io/version: v0.18.0
88+ {{- if not .Values.crds.keep }}
99+ "helm.sh/hook": pre-install,pre-upgrade
1010+ "helm.sh/hook-delete-policy": before-hook-creation
1111+ {{- end }}
1212+ name: hsmdevices.hsm.j5t.io
1313+ labels:
1414+ {{- include "hsm-secrets-operator.labels" . | nindent 4 }}
1515+spec:
1616+ group: hsm.j5t.io
1717+ names:
1818+ kind: HSMDevice
1919+ listKind: HSMDeviceList
2020+ plural: hsmdevices
2121+ shortNames:
2222+ - hsmdev
2323+ singular: hsmdevice
2424+ scope: Namespaced
2525+ versions:
2626+ - additionalPrinterColumns:
2727+ - jsonPath: .spec.deviceType
2828+ name: Type
2929+ type: string
3030+ - jsonPath: .status.totalDevices
3131+ name: Total
3232+ type: integer
3333+ - jsonPath: .status.availableDevices
3434+ name: Available
3535+ type: integer
3636+ - jsonPath: .status.phase
3737+ name: Phase
3838+ type: string
3939+ - jsonPath: .status.lastDiscoveryTime
4040+ name: Last Discovery
4141+ type: date
4242+ - jsonPath: .metadata.creationTimestamp
4343+ name: Age
4444+ type: date
4545+ name: v1alpha1
4646+ schema:
4747+ openAPIV3Schema:
4848+ description: HSMDevice is the Schema for the hsmdevices API.
4949+ properties:
5050+ apiVersion:
5151+ description: |-
5252+ APIVersion defines the versioned schema of this representation of an object.
5353+ Servers should convert recognized schemas to the latest internal value, and
5454+ may reject unrecognized values.
5555+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
5656+ type: string
5757+ kind:
5858+ description: |-
5959+ Kind is a string value representing the REST resource this object represents.
6060+ Servers may infer this from the endpoint the client submits requests to.
6161+ Cannot be updated.
6262+ In CamelCase.
6363+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
6464+ type: string
6565+ metadata:
6666+ type: object
6767+ spec:
6868+ description: HSMDeviceSpec defines the desired state of HSMDevice.
6969+ properties:
7070+ devicePath:
7171+ description: DevicePath defines path-based device discovery criteria
7272+ properties:
7373+ path:
7474+ description: Path is the device path pattern (e.g., "/dev/ttyUSB*",
7575+ "/dev/sc-hsm*")
7676+ type: string
7777+ permissions:
7878+ description: Permissions are the required permissions for device
7979+ access
8080+ type: string
8181+ required:
8282+ - path
8383+ type: object
8484+ deviceType:
8585+ description: DeviceType specifies the type of HSM device
8686+ type: string
8787+ maxDevices:
8888+ default: 10
8989+ description: MaxDevices limits how many instances of this device can
9090+ be discovered
9191+ format: int32
9292+ type: integer
9393+ mirroring:
9494+ description: Mirroring configures cross-node device mirroring for
9595+ high availability
9696+ properties:
9797+ autoFailover:
9898+ default: true
9999+ description: AutoFailover enables automatic failover to healthy
100100+ nodes
101101+ type: boolean
102102+ policy:
103103+ default: None
104104+ description: Policy specifies the mirroring strategy
105105+ type: string
106106+ primaryNode:
107107+ description: PrimaryNode specifies the preferred primary node
108108+ for write operations
109109+ type: string
110110+ syncInterval:
111111+ default: 60
112112+ description: SyncInterval defines how often to sync device data
113113+ across nodes (in seconds)
114114+ format: int32
115115+ type: integer
116116+ targetNodes:
117117+ description: |-
118118+ TargetNodes specifies nodes that should have mirrored access
119119+ If empty, mirrors to all nodes with the device
120120+ items:
121121+ type: string
122122+ type: array
123123+ type: object
124124+ nodeSelector:
125125+ additionalProperties:
126126+ type: string
127127+ description: NodeSelector specifies which nodes should be scanned
128128+ for this device
129129+ type: object
130130+ pkcs11LibraryPath:
131131+ description: PKCS11LibraryPath is the path to the PKCS#11 library
132132+ for this device
133133+ type: string
134134+ usb:
135135+ description: USB defines USB-based device discovery criteria
136136+ properties:
137137+ productId:
138138+ description: ProductID is the USB product ID (e.g., "4230" for
139139+ Pico HSM)
140140+ type: string
141141+ serialNumber:
142142+ description: SerialNumber optionally matches a specific device
143143+ serial number
144144+ type: string
145145+ vendorId:
146146+ description: VendorID is the USB vendor ID (e.g., "20a0" for Pico
147147+ HSM)
148148+ type: string
149149+ required:
150150+ - productId
151151+ - vendorId
152152+ type: object
153153+ required:
154154+ - deviceType
155155+ type: object
156156+ status:
157157+ description: HSMDeviceStatus defines the observed state of HSMDevice.
158158+ properties:
159159+ availableDevices:
160160+ description: AvailableDevices is the number of currently available
161161+ devices
162162+ format: int32
163163+ type: integer
164164+ conditions:
165165+ description: Conditions represent the latest available observations
166166+ of the device state
167167+ items:
168168+ description: Condition contains details for one aspect of the current
169169+ state of this API Resource.
170170+ properties:
171171+ lastTransitionTime:
172172+ description: |-
173173+ lastTransitionTime is the last time the condition transitioned from one status to another.
174174+ This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
175175+ format: date-time
176176+ type: string
177177+ message:
178178+ description: |-
179179+ message is a human readable message indicating details about the transition.
180180+ This may be an empty string.
181181+ maxLength: 32768
182182+ type: string
183183+ observedGeneration:
184184+ description: |-
185185+ observedGeneration represents the .metadata.generation that the condition was set based upon.
186186+ For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
187187+ with respect to the current state of the instance.
188188+ format: int64
189189+ minimum: 0
190190+ type: integer
191191+ reason:
192192+ description: |-
193193+ reason contains a programmatic identifier indicating the reason for the condition's last transition.
194194+ Producers of specific condition types may define expected values and meanings for this field,
195195+ and whether the values are considered a guaranteed API.
196196+ The value should be a CamelCase string.
197197+ This field may not be empty.
198198+ maxLength: 1024
199199+ minLength: 1
200200+ pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
201201+ type: string
202202+ status:
203203+ description: status of the condition, one of True, False, Unknown.
204204+ enum:
205205+ - "True"
206206+ - "False"
207207+ - Unknown
208208+ type: string
209209+ type:
210210+ description: type of condition in CamelCase or in foo.example.com/CamelCase.
211211+ maxLength: 316
212212+ pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
213213+ type: string
214214+ required:
215215+ - lastTransitionTime
216216+ - message
217217+ - reason
218218+ - status
219219+ - type
220220+ type: object
221221+ type: array
222222+ discoveredDevices:
223223+ description: DiscoveredDevices lists all discovered devices matching
224224+ the spec
225225+ items:
226226+ description: DiscoveredDevice represents a discovered HSM device
227227+ instance
228228+ properties:
229229+ available:
230230+ description: Available indicates if the device is currently
231231+ available for use
232232+ type: boolean
233233+ deviceInfo:
234234+ additionalProperties:
235235+ type: string
236236+ description: DeviceInfo contains additional device information
237237+ type: object
238238+ devicePath:
239239+ description: DevicePath is the system path to the discovered
240240+ device
241241+ type: string
242242+ health:
243243+ description: Health represents the health status of the device
244244+ type: string
245245+ lastSeen:
246246+ description: LastSeen is the timestamp when the device was last
247247+ detected
248248+ format: date-time
249249+ type: string
250250+ lastSyncTime:
251251+ description: LastSyncTime is when this device was last synchronized
252252+ format: date-time
253253+ type: string
254254+ mirroredFrom:
255255+ description: MirroredFrom indicates the primary device this
256256+ is mirrored from
257257+ type: string
258258+ nodeName:
259259+ description: NodeName is the name of the node where the device
260260+ was discovered
261261+ type: string
262262+ resourceName:
263263+ description: ResourceName is the Kubernetes resource name for
264264+ this device
265265+ type: string
266266+ role:
267267+ description: Role indicates the role of this device in a mirrored
268268+ setup
269269+ type: string
270270+ serialNumber:
271271+ description: SerialNumber is the serial number of the device
272272+ (if available)
273273+ type: string
274274+ required:
275275+ - available
276276+ - devicePath
277277+ - lastSeen
278278+ - nodeName
279279+ type: object
280280+ type: array
281281+ lastDiscoveryTime:
282282+ description: LastDiscoveryTime is the timestamp of the last discovery
283283+ scan
284284+ format: date-time
285285+ type: string
286286+ mirroring:
287287+ description: Mirroring represents the status of device mirroring
288288+ properties:
289289+ enabled:
290290+ description: Enabled indicates if mirroring is currently active
291291+ type: boolean
292292+ failoverCount:
293293+ description: FailoverCount tracks the number of failovers that
294294+ have occurred
295295+ format: int32
296296+ type: integer
297297+ lastSyncTime:
298298+ description: LastSyncTime is when devices were last synchronized
299299+ format: date-time
300300+ type: string
301301+ mirroredNodes:
302302+ description: MirroredNodes lists nodes with mirrored access
303303+ items:
304304+ type: string
305305+ type: array
306306+ primaryNode:
307307+ description: PrimaryNode is the current primary node
308308+ type: string
309309+ syncErrors:
310310+ description: SyncErrors tracks synchronization errors
311311+ items:
312312+ type: string
313313+ type: array
314314+ required:
315315+ - enabled
316316+ - failoverCount
317317+ type: object
318318+ phase:
319319+ description: Phase represents the current phase of device discovery
320320+ type: string
321321+ totalDevices:
322322+ description: TotalDevices is the total number of discovered devices
323323+ format: int32
324324+ type: integer
325325+ required:
326326+ - availableDevices
327327+ - totalDevices
328328+ type: object
329329+ type: object
330330+ served: true
331331+ storage: true
332332+ subresources:
333333+ status: {}
334334+{{- end }}
···11+{{- if .Values.crds.install }}
22+---
33+apiVersion: apiextensions.k8s.io/v1
44+kind: CustomResourceDefinition
55+metadata:
66+ annotations:
77+ controller-gen.kubebuilder.io/version: v0.18.0
88+ {{- if not .Values.crds.keep }}
99+ "helm.sh/hook": pre-install,pre-upgrade
1010+ "helm.sh/hook-delete-policy": before-hook-creation
1111+ {{- end }}
1212+ name: hsmsecrets.hsm.j5t.io
1313+ labels:
1414+ {{- include "hsm-secrets-operator.labels" . | nindent 4 }}
1515+spec:
1616+ group: hsm.j5t.io
1717+ names:
1818+ kind: HSMSecret
1919+ listKind: HSMSecretList
2020+ plural: hsmsecrets
2121+ shortNames:
2222+ - hsmsec
2323+ singular: hsmsecret
2424+ scope: Namespaced
2525+ versions:
2626+ - additionalPrinterColumns:
2727+ - jsonPath: .spec.hsmPath
2828+ name: HSM Path
2929+ type: string
3030+ - jsonPath: .spec.secretName
3131+ name: Secret Name
3232+ type: string
3333+ - jsonPath: .status.syncStatus
3434+ name: Sync Status
3535+ type: string
3636+ - jsonPath: .status.lastSyncTime
3737+ name: Last Sync
3838+ type: date
3939+ - jsonPath: .metadata.creationTimestamp
4040+ name: Age
4141+ type: date
4242+ name: v1alpha1
4343+ schema:
4444+ openAPIV3Schema:
4545+ description: HSMSecret is the Schema for the hsmsecrets API.
4646+ properties:
4747+ apiVersion:
4848+ description: |-
4949+ APIVersion defines the versioned schema of this representation of an object.
5050+ Servers should convert recognized schemas to the latest internal value, and
5151+ may reject unrecognized values.
5252+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
5353+ type: string
5454+ kind:
5555+ description: |-
5656+ Kind is a string value representing the REST resource this object represents.
5757+ Servers may infer this from the endpoint the client submits requests to.
5858+ Cannot be updated.
5959+ In CamelCase.
6060+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
6161+ type: string
6262+ metadata:
6363+ type: object
6464+ spec:
6565+ description: HSMSecretSpec defines the desired state of HSMSecret.
6666+ properties:
6767+ autoSync:
6868+ default: true
6969+ description: AutoSync enables bidirectional synchronization between
7070+ HSM and Kubernetes Secret
7171+ type: boolean
7272+ hsmPath:
7373+ description: |-
7474+ HSMPath is the path on the Pico HSM where the secret data is stored
7575+ Example: "secrets/appnamespace/appname-secret"
7676+ type: string
7777+ secretName:
7878+ description: |-
7979+ SecretName is the name of the Kubernetes Secret object to create/update
8080+ Defaults to the HSMSecret name if not specified
8181+ type: string
8282+ secretType:
8383+ default: Opaque
8484+ description: SecretType specifies the type of Kubernetes Secret to
8585+ create
8686+ type: string
8787+ syncInterval:
8888+ default: 300
8989+ description: |-
9090+ SyncInterval defines how often to check for HSM changes (in seconds)
9191+ Only applies when AutoSync is true
9292+ format: int32
9393+ type: integer
9494+ required:
9595+ - hsmPath
9696+ type: object
9797+ status:
9898+ description: HSMSecretStatus defines the observed state of HSMSecret.
9999+ properties:
100100+ conditions:
101101+ description: Conditions represent the latest available observations
102102+ of the HSMSecret's current state
103103+ items:
104104+ description: Condition contains details for one aspect of the current
105105+ state of this API Resource.
106106+ properties:
107107+ lastTransitionTime:
108108+ description: |-
109109+ lastTransitionTime is the last time the condition transitioned from one status to another.
110110+ This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
111111+ format: date-time
112112+ type: string
113113+ message:
114114+ description: |-
115115+ message is a human readable message indicating details about the transition.
116116+ This may be an empty string.
117117+ maxLength: 32768
118118+ type: string
119119+ observedGeneration:
120120+ description: |-
121121+ observedGeneration represents the .metadata.generation that the condition was set based upon.
122122+ For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
123123+ with respect to the current state of the instance.
124124+ format: int64
125125+ minimum: 0
126126+ type: integer
127127+ reason:
128128+ description: |-
129129+ reason contains a programmatic identifier indicating the reason for the condition's last transition.
130130+ Producers of specific condition types may define expected values and meanings for this field,
131131+ and whether the values are considered a guaranteed API.
132132+ The value should be a CamelCase string.
133133+ This field may not be empty.
134134+ maxLength: 1024
135135+ minLength: 1
136136+ pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
137137+ type: string
138138+ status:
139139+ description: status of the condition, one of True, False, Unknown.
140140+ enum:
141141+ - "True"
142142+ - "False"
143143+ - Unknown
144144+ type: string
145145+ type:
146146+ description: type of condition in CamelCase or in foo.example.com/CamelCase.
147147+ maxLength: 316
148148+ pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
149149+ type: string
150150+ required:
151151+ - lastTransitionTime
152152+ - message
153153+ - reason
154154+ - status
155155+ - type
156156+ type: object
157157+ type: array
158158+ hsmChecksum:
159159+ description: HSMChecksum is the SHA256 checksum of the HSM data
160160+ type: string
161161+ lastError:
162162+ description: LastError contains the last error message if SyncStatus
163163+ is Error
164164+ type: string
165165+ lastSyncTime:
166166+ description: LastSyncTime is the timestamp of the last successful
167167+ synchronization
168168+ format: date-time
169169+ type: string
170170+ secretChecksum:
171171+ description: SecretChecksum is the SHA256 checksum of the Kubernetes
172172+ Secret data
173173+ type: string
174174+ secretRef:
175175+ description: SecretRef references the created Kubernetes Secret
176176+ properties:
177177+ apiVersion:
178178+ description: API version of the referent.
179179+ type: string
180180+ fieldPath:
181181+ description: |-
182182+ If referring to a piece of an object instead of an entire object, this string
183183+ should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2].
184184+ For example, if the object reference is to a container within a pod, this would take on a value like:
185185+ "spec.containers{name}" (where "name" refers to the name of the container that triggered
186186+ the event) or if no container name is specified "spec.containers[2]" (container with
187187+ index 2 in this pod). This syntax is chosen only to have some well-defined way of
188188+ referencing a part of an object.
189189+ type: string
190190+ kind:
191191+ description: |-
192192+ Kind of the referent.
193193+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
194194+ type: string
195195+ name:
196196+ description: |-
197197+ Name of the referent.
198198+ More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
199199+ type: string
200200+ namespace:
201201+ description: |-
202202+ Namespace of the referent.
203203+ More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
204204+ type: string
205205+ resourceVersion:
206206+ description: |-
207207+ Specific resourceVersion to which this reference is made, if any.
208208+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency
209209+ type: string
210210+ uid:
211211+ description: |-
212212+ UID of the referent.
213213+ More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids
214214+ type: string
215215+ type: object
216216+ x-kubernetes-map-type: atomic
217217+ syncStatus:
218218+ description: SyncStatus indicates the current synchronization status
219219+ type: string
220220+ type: object
221221+ type: object
222222+ served: true
223223+ storage: true
224224+ subresources:
225225+ status: {}
226226+{{- end }}