Skip to content

Commit 5a36538

Browse files
committed
AppCred support
Signed-off-by: Veronika Fisarova <[email protected]>
1 parent 42a817d commit 5a36538

File tree

74 files changed

+5122
-105
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+5122
-105
lines changed

api/bases/core.openstack.org_openstackcontrolplanes.yaml

Lines changed: 855 additions & 0 deletions
Large diffs are not rendered by default.

api/core/v1beta1/openstackcontrolplane_types.go

Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,14 @@ type OpenStackControlPlaneSpec struct {
225225
// +operator-sdk:csv:customresourcedefinitions:type=spec
226226
// Watcher - Parameters related to the Watcher service
227227
Watcher WatcherSection `json:"watcher,omitempty"`
228+
229+
// +kubebuilder:validation:Optional
230+
// +operator-sdk:csv:customresourcedefinitions:type=spec
231+
// ApplicationCredential - Global configuration for ApplicationCredentials.
232+
// Both this global section AND the per-service applicationCredential section
233+
// must be enabled for a service to use ApplicationCredentials.
234+
// If omitted, defaults to enabled=false with standard expiration/grace periods.
235+
ApplicationCredential ApplicationCredentialSection `json:"applicationCredential,omitempty"`
228236
}
229237

230238
// TLSSection defines the desired state of TLS configuration
@@ -419,6 +427,13 @@ type PlacementSection struct {
419427
// +operator-sdk:csv:customresourcedefinitions:type=spec
420428
// APIOverride, provides the ability to override the generated manifest of several child resources.
421429
APIOverride Override `json:"apiOverride,omitempty"`
430+
431+
// ApplicationCredential allows service-specific overrides of the global AC configuration.
432+
// +operator-sdk:csv:customresourcedefinitions:type=spec
433+
// +kubebuilder:validation:Optional
434+
// +nullable
435+
// +kubebuilder:default={enabled:false}
436+
ApplicationCredential *ServiceAppCredSection `json:"applicationCredential"`
422437
}
423438

424439
// GlanceSection defines the desired state of Glance service
@@ -445,6 +460,13 @@ type GlanceSection struct {
445460
// Convenient to avoid podname (and thus hostname) collision between different deployments.
446461
// Useful for CI jobs as well as preproduction and production environments that use the same storage backend, etc.
447462
UniquePodNames bool `json:"uniquePodNames"`
463+
464+
// ApplicationCredential allows service-specific overrides of the global AC configuration.
465+
// +operator-sdk:csv:customresourcedefinitions:type=spec
466+
// +kubebuilder:validation:Optional
467+
// +nullable
468+
// +kubebuilder:default={enabled:false}
469+
ApplicationCredential *ServiceAppCredSection `json:"applicationCredential"`
448470
}
449471

450472
// CinderSection defines the desired state of Cinder service
@@ -471,6 +493,13 @@ type CinderSection struct {
471493
// Convenient to avoid podname (and thus hostname) collision between different deployments.
472494
// Useful for CI jobs as well as preproduction and production environments that use the same storage backend, etc.
473495
UniquePodNames bool `json:"uniquePodNames"`
496+
497+
// ApplicationCredential allows service-specific overrides of the global AC configuration.
498+
// +operator-sdk:csv:customresourcedefinitions:type=spec
499+
// +kubebuilder:validation:Optional
500+
// +nullable
501+
// +kubebuilder:default={enabled:false}
502+
ApplicationCredential *ServiceAppCredSection `json:"applicationCredential"`
474503
}
475504

476505
// GaleraSection defines the desired state of Galera services
@@ -564,6 +593,13 @@ type NeutronSection struct {
564593
// +operator-sdk:csv:customresourcedefinitions:type=spec
565594
// APIOverride, provides the ability to override the generated manifest of several child resources.
566595
APIOverride Override `json:"apiOverride,omitempty"`
596+
597+
// ApplicationCredential allows service-specific overrides of the global AC configuration.
598+
// +operator-sdk:csv:customresourcedefinitions:type=spec
599+
// +kubebuilder:validation:Optional
600+
// +nullable
601+
// +kubebuilder:default={enabled:false}
602+
ApplicationCredential *ServiceAppCredSection `json:"applicationCredential"`
567603
}
568604

569605
// NovaSection defines the desired state of Nova services
@@ -590,6 +626,13 @@ type NovaSection struct {
590626
// for a nova cell. cell0 never have compute nodes and therefore it won't have a noVNCProxy deployed.
591627
// Providing an override for cell0 noVNCProxy does not have an effect.
592628
CellOverride map[string]NovaCellOverrideSpec `json:"cellOverride,omitempty"`
629+
630+
// ApplicationCredential allows service-specific overrides of the global AC configuration.
631+
// +operator-sdk:csv:customresourcedefinitions:type=spec
632+
// +kubebuilder:validation:Optional
633+
// +nullable
634+
// +kubebuilder:default={enabled:false}
635+
ApplicationCredential *ServiceAppCredSection `json:"applicationCredential"`
593636
}
594637

595638
// NovaCellOverrideSpec to override the generated manifest of several child resources.
@@ -620,6 +663,13 @@ type HeatSection struct {
620663
// +operator-sdk:csv:customresourcedefinitions:type=spec
621664
// CnfAPIOverride, provides the ability to override the generated manifest of several child resources.
622665
CnfAPIOverride Override `json:"cnfAPIOverride,omitempty"`
666+
667+
// ApplicationCredential allows service-specific overrides of the global AC configuration.
668+
// +operator-sdk:csv:customresourcedefinitions:type=spec
669+
// +kubebuilder:validation:Optional
670+
// +nullable
671+
// +kubebuilder:default={enabled:false}
672+
ApplicationCredential *ServiceAppCredSection `json:"applicationCredential"`
623673
}
624674

625675
// IronicSection defines the desired state of Ironic services
@@ -644,6 +694,13 @@ type IronicSection struct {
644694
// +operator-sdk:csv:customresourcedefinitions:type=spec
645695
// InspectorOverride, provides the ability to override the generated manifest of several child resources.
646696
InspectorOverride Override `json:"inspectorOverride,omitempty"`
697+
698+
// ApplicationCredential allows service-specific overrides of the global AC configuration.
699+
// +operator-sdk:csv:customresourcedefinitions:type=spec
700+
// +kubebuilder:validation:Optional
701+
// +nullable
702+
// +kubebuilder:default={enabled:false}
703+
ApplicationCredential *ServiceAppCredSection `json:"applicationCredential"`
647704
}
648705

649706
// ManilaSection defines the desired state of Manila service
@@ -663,6 +720,13 @@ type ManilaSection struct {
663720
// +operator-sdk:csv:customresourcedefinitions:type=spec
664721
// APIOverride, provides the ability to override the generated manifest of several child resources.
665722
APIOverride Override `json:"apiOverride,omitempty"`
723+
724+
// ApplicationCredential allows service-specific overrides of the global AC configuration.
725+
// +operator-sdk:csv:customresourcedefinitions:type=spec
726+
// +kubebuilder:validation:Optional
727+
// +nullable
728+
// +kubebuilder:default={enabled:false}
729+
ApplicationCredential *ServiceAppCredSection `json:"applicationCredential"`
666730
}
667731

668732
// HorizonSection defines the desired state of Horizon services
@@ -716,6 +780,27 @@ type TelemetrySection struct {
716780
// +operator-sdk:csv:customresourcedefinitions:type=spec
717781
// AlertmanagerOverride, provides the ability to override the generated manifest of several child resources.
718782
AlertmanagerOverride Override `json:"alertmanagerOverride,omitempty"`
783+
784+
// ApplicationCredentialCeilometer allows service-specific overrides of the global AC configuration for Ceilometer.
785+
// +operator-sdk:csv:customresourcedefinitions:type=spec
786+
// +kubebuilder:validation:Optional
787+
// +nullable
788+
// +kubebuilder:default={enabled:false}
789+
ApplicationCredentialCeilometer *ServiceAppCredSection `json:"applicationCredentialCeilometer"`
790+
791+
// ApplicationCredentialAodh allows service-specific overrides of the global AC configuration for Aodh.
792+
// +operator-sdk:csv:customresourcedefinitions:type=spec
793+
// +kubebuilder:validation:Optional
794+
// +nullable
795+
// +kubebuilder:default={enabled:false}
796+
ApplicationCredentialAodh *ServiceAppCredSection `json:"applicationCredentialAodh"`
797+
798+
// ApplicationCredentialCloudKitty allows service-specific overrides of the global AC configuration for CloudKitty.
799+
// +operator-sdk:csv:customresourcedefinitions:type=spec
800+
// +kubebuilder:validation:Optional
801+
// +nullable
802+
// +kubebuilder:default={enabled:false}
803+
ApplicationCredentialCloudKitty *ServiceAppCredSection `json:"applicationCredentialCloudKitty"`
719804
}
720805

721806
// SwiftSection defines the desired state of Swift service
@@ -735,6 +820,13 @@ type SwiftSection struct {
735820
// +operator-sdk:csv:customresourcedefinitions:type=spec
736821
// ProxyOverride, provides the ability to override the generated manifest of several child resources.
737822
ProxyOverride Override `json:"proxyOverride,omitempty"`
823+
824+
// ApplicationCredential allows service-specific overrides of the global AC configuration.
825+
// +operator-sdk:csv:customresourcedefinitions:type=spec
826+
// +kubebuilder:validation:Optional
827+
// +nullable
828+
// +kubebuilder:default={enabled:false}
829+
ApplicationCredential *ServiceAppCredSection `json:"applicationCredential"`
738830
}
739831

740832
// OctaviaSection defines the desired state of the Octavia service
@@ -754,6 +846,13 @@ type OctaviaSection struct {
754846
// +operator-sdk:csv:customresourcedefinitions:type=spec
755847
// APIOverride, provides the ability to override the generated manifest of several child resources.
756848
APIOverride Override `json:"apiOverride,omitempty"`
849+
850+
// ApplicationCredential allows service-specific overrides of the global AC configuration.
851+
// +operator-sdk:csv:customresourcedefinitions:type=spec
852+
// +kubebuilder:validation:Optional
853+
// +nullable
854+
// +kubebuilder:default={enabled:false}
855+
ApplicationCredential *ServiceAppCredSection `json:"applicationCredential"`
757856
}
758857

759858
// DesignateSection defines the desired state of the Designate service
@@ -773,6 +872,13 @@ type DesignateSection struct {
773872
// +operator-sdk:csv:customresourcedefinitions:type=spec
774873
// APIOverride, provides the ability to override the generated manifest of several child resources.
775874
APIOverride Override `json:"apiOverride,omitempty"`
875+
876+
// ApplicationCredential allows service-specific overrides of the global AC configuration.
877+
// +operator-sdk:csv:customresourcedefinitions:type=spec
878+
// +kubebuilder:validation:Optional
879+
// +nullable
880+
// +kubebuilder:default={enabled:false}
881+
ApplicationCredential *ServiceAppCredSection `json:"applicationCredential"`
776882
}
777883

778884
// BarbicanSection defines the desired state of Barbican service
@@ -792,6 +898,13 @@ type BarbicanSection struct {
792898
// +operator-sdk:csv:customresourcedefinitions:type=spec
793899
// APIOverride, provides the ability to override the generated manifest of several child resources.
794900
APIOverride Override `json:"apiOverride,omitempty"`
901+
902+
// ApplicationCredential allows service-specific overrides of the global AC configuration.
903+
// +operator-sdk:csv:customresourcedefinitions:type=spec
904+
// +kubebuilder:validation:Optional
905+
// +nullable
906+
// +kubebuilder:default={enabled:false}
907+
ApplicationCredential *ServiceAppCredSection `json:"applicationCredential"`
795908
}
796909

797910
// RedisSection defines the desired state of the Redis service
@@ -833,6 +946,97 @@ type WatcherSection struct {
833946
// +operator-sdk:csv:customresourcedefinitions:type=spec
834947
// APIOverride, provides the ability to override the generated manifest of several child resources.
835948
APIOverride Override `json:"apiOverride,omitempty"`
949+
950+
// ApplicationCredential allows service-specific overrides of the global AC configuration.
951+
// +operator-sdk:csv:customresourcedefinitions:type=spec
952+
// +kubebuilder:validation:Optional
953+
// +nullable
954+
// +kubebuilder:default={enabled:false}
955+
ApplicationCredential *ServiceAppCredSection `json:"applicationCredential"`
956+
}
957+
958+
// +kubebuilder:validation:XValidation:rule="self.gracePeriodDays < self.expirationDays",message="gracePeriodDays must be smaller than expirationDays"
959+
// ApplicationCredentialSection defines the desired configuration for ApplicationCredentials
960+
type ApplicationCredentialSection struct {
961+
// Enabled indicates whether an ApplicationCredential should be created
962+
// +kubebuilder:validation:Optional
963+
// +kubebuilder:default=false
964+
Enabled bool `json:"enabled"`
965+
966+
// ExpirationDays sets the lifetime in days for the AC
967+
// +kubebuilder:validation:Optional
968+
// +kubebuilder:default=365
969+
// +kubebuilder:validation:Minimum=2
970+
ExpirationDays *int `json:"expirationDays"`
971+
972+
// GracePeriodDays sets how many days before expiration the AC should be rotated
973+
// +kubebuilder:validation:Optional
974+
// +kubebuilder:default=182
975+
// +kubebuilder:validation:Minimum=1
976+
GracePeriodDays *int `json:"gracePeriodDays"`
977+
978+
// +kubebuilder:validation:Optional
979+
// +kubebuilder:default={"service"}
980+
// +kubebuilder:validation:MinItems=1
981+
// Roles to assign to the ApplicationCredential
982+
Roles []string `json:"roles"`
983+
984+
// +kubebuilder:validation:Optional
985+
// +kubebuilder:default=false
986+
// Whether the AC should be unrestricted
987+
Unrestricted *bool `json:"unrestricted"`
988+
989+
// AccessRules lets supply a custom list of rules
990+
// If unset, no accessRules field is emitted
991+
// +kubebuilder:validation:Optional
992+
// +listType=atomic
993+
AccessRules []ACRule `json:"accessRules,omitempty"`
994+
}
995+
996+
// +kubebuilder:validation:XValidation:rule="!(has(self.expirationDays) && has(self.gracePeriodDays)) || self.gracePeriodDays < self.expirationDays",message="gracePeriodDays must be smaller than expirationDays"
997+
// ServiceAppCredSection allows service-specific overrides of the global AC configuration
998+
type ServiceAppCredSection struct {
999+
// +kubebuilder:validation:Optional
1000+
// +kubebuilder:default=false
1001+
Enabled bool `json:"enabled"`
1002+
1003+
// +kubebuilder:validation:Optional
1004+
// +kubebuilder:validation:Minimum=2
1005+
ExpirationDays *int `json:"expirationDays,omitempty"`
1006+
1007+
// +kubebuilder:validation:Optional
1008+
// +kubebuilder:validation:Minimum=1
1009+
GracePeriodDays *int `json:"gracePeriodDays,omitempty"`
1010+
1011+
// +kubebuilder:validation:Optional
1012+
// Roles to assign to the ApplicationCredential
1013+
Roles []string `json:"roles,omitempty"`
1014+
1015+
// +kubebuilder:validation:Optional
1016+
// Whether the AC should be unrestricted
1017+
Unrestricted *bool `json:"unrestricted,omitempty"`
1018+
1019+
// AccessRules lets the service override either the global rules
1020+
// +kubebuilder:validation:Optional
1021+
// +listType=atomic
1022+
AccessRules []ACRule `json:"accessRules,omitempty"`
1023+
}
1024+
1025+
// ACRule describes a single access rule for an ApplicationCredential
1026+
// +k8s:openapi-gen=true
1027+
type ACRule struct {
1028+
// Service is the name of the service to target (e.g. "identity").
1029+
// +kubebuilder:validation:Required
1030+
// +kubebuilder:validation:MinLength=1
1031+
Service string `json:"service"`
1032+
// Path is the HTTP path (e.g. "/v3/auth/tokens").
1033+
// +kubebuilder:validation:Required
1034+
// +kubebuilder:validation:MinLength=1
1035+
Path string `json:"path"`
1036+
// Method is the HTTP method to allow (e.g. "POST").
1037+
// +kubebuilder:validation:Required
1038+
// +kubebuilder:validation:MinLength=1
1039+
Method string `json:"method"`
8361040
}
8371041

8381042
// OpenStackControlPlaneStatus defines the observed state of OpenStackControlPlane

0 commit comments

Comments
 (0)