Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify glance-operator pvc interface #554

Merged
16 changes: 9 additions & 7 deletions api/bases/glance.openstack.org_glanceapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -904,8 +904,6 @@ spec:
default: GlancePassword
type: string
type: object
pvc:
type: string
quota:
default: false
type: boolean
Expand Down Expand Up @@ -953,10 +951,15 @@ spec:
serviceUser:
default: glance
type: string
storageClass:
type: string
storageRequest:
type: string
storage:
properties:
external:
type: boolean
storageClass:
type: string
storageRequest:
type: string
type: object
tls:
properties:
api:
Expand Down Expand Up @@ -988,7 +991,6 @@ spec:
- memcachedInstance
- secret
- serviceAccount
- storageRequest
type: object
status:
properties:
Expand Down
30 changes: 18 additions & 12 deletions api/bases/glance.openstack.org_glances.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -906,8 +906,6 @@ spec:
type: object
type: object
type: object
pvc:
type: string
replicas:
default: 1
format: int32
Expand Down Expand Up @@ -945,10 +943,15 @@ spec:
x-kubernetes-int-or-string: true
type: object
type: object
storageClass:
type: string
storageRequest:
type: string
storage:
properties:
external:
type: boolean
storageClass:
type: string
storageRequest:
type: string
type: object
tls:
properties:
api:
Expand Down Expand Up @@ -976,7 +979,6 @@ spec:
type: string
required:
- containerImage
- storageRequest
type: object
type: object
imageCache:
Expand Down Expand Up @@ -1039,10 +1041,15 @@ spec:
serviceUser:
default: glance
type: string
storageClass:
type: string
storageRequest:
type: string
storage:
properties:
external:
type: boolean
storageClass:
type: string
storageRequest:
type: string
type: object
required:
- containerImage
- databaseInstance
Expand All @@ -1051,7 +1058,6 @@ spec:
- keystoneEndpoint
- memcachedInstance
- secret
- storageRequest
type: object
status:
properties:
Expand Down
25 changes: 15 additions & 10 deletions api/v1beta1/common_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ type GlanceAPITemplate struct {
// NodeSelector to target subset of worker nodes running this service
NodeSelector map[string]string `json:"nodeSelector,omitempty"`

// +kubebuilder:validation:Optional
// Pvc - Storage claim for file-backed Glance
Pvc string `json:"pvc,omitempty"`

// +kubebuilder:validation:Optional
// CustomServiceConfig - customize the service config using this parameter to change service defaults,
// or overwrite rendered information using raw OpenStack config format. The content gets added to
Expand All @@ -88,12 +84,8 @@ type GlanceAPITemplate struct {
// Override, provides the ability to override the generated manifest of several child resources.
Override APIOverrideSpec `json:"override,omitempty"`

// +kubebuilder:validation:Optional
// StorageClass
StorageClass string `json:"storageClass,omitempty"`

// StorageRequest
StorageRequest string `json:"storageRequest"`
// Storage -
Storage Storage `json:"storage,omitempty"`

// +kubebuilder:validation:Enum=split;single;edge
// +kubebuilder:default:=split
Expand All @@ -116,6 +108,19 @@ type GlanceAPITemplate struct {
APITimeout int `json:"apiTimeout,omitempty"`
}

type Storage struct {
// +kubebuilder:validation:Optional
// StorageClass -
StorageClass string `json:"storageClass,omitempty"`

// StorageRequest -
StorageRequest string `json:"storageRequest,omitempty"`

// +kubebuilder:validation:Optional
// External -
External bool `json:"external,omitempty"`
}

// ImageCache - struct where the exposed imageCache params are defined
type ImageCache struct {
// Size - Local storage request, in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024)
Expand Down
9 changes: 2 additions & 7 deletions api/v1beta1/glance_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,8 @@ type GlanceSpecCore struct {
// /etc/<service>/<service>.conf.d directory as a custom config file.
CustomServiceConfigSecrets []string `json:"customServiceConfigSecrets,omitempty"`

// +kubebuilder:validation:Optional
// StorageClass
StorageClass string `json:"storageClass,omitempty"`

// +kubebuilder:validation:Required
// StorageRequest
StorageRequest string `json:"storageRequest"`
// Storage -
Storage Storage `json:"storage,omitempty"`

// +kubebuilder:validation:Required
// +kubebuilder:default={}
Expand Down
5 changes: 5 additions & 0 deletions api/v1beta1/glance_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ func GetTemplateBackend() string {
func (r *GlanceSpecCore) Default() {
var rep int32 = 0

// If no storage request has been made, do not provision PVCs
if r.Storage.StorageRequest == "" {
r.Storage.External = true
}

if r.APITimeout == 0 {
r.APITimeout = glanceDefaults.APITimeout
}
Expand Down
17 changes: 17 additions & 0 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 9 additions & 7 deletions config/crd/bases/glance.openstack.org_glanceapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -904,8 +904,6 @@ spec:
default: GlancePassword
type: string
type: object
pvc:
type: string
quota:
default: false
type: boolean
Expand Down Expand Up @@ -953,10 +951,15 @@ spec:
serviceUser:
default: glance
type: string
storageClass:
type: string
storageRequest:
type: string
storage:
properties:
external:
type: boolean
storageClass:
type: string
storageRequest:
type: string
type: object
tls:
properties:
api:
Expand Down Expand Up @@ -988,7 +991,6 @@ spec:
- memcachedInstance
- secret
- serviceAccount
- storageRequest
type: object
status:
properties:
Expand Down
30 changes: 18 additions & 12 deletions config/crd/bases/glance.openstack.org_glances.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -906,8 +906,6 @@ spec:
type: object
type: object
type: object
pvc:
type: string
replicas:
default: 1
format: int32
Expand Down Expand Up @@ -945,10 +943,15 @@ spec:
x-kubernetes-int-or-string: true
type: object
type: object
storageClass:
type: string
storageRequest:
type: string
storage:
properties:
external:
type: boolean
storageClass:
type: string
storageRequest:
type: string
type: object
tls:
properties:
api:
Expand Down Expand Up @@ -976,7 +979,6 @@ spec:
type: string
required:
- containerImage
- storageRequest
type: object
type: object
imageCache:
Expand Down Expand Up @@ -1039,10 +1041,15 @@ spec:
serviceUser:
default: glance
type: string
storageClass:
type: string
storageRequest:
type: string
storage:
properties:
external:
type: boolean
storageClass:
type: string
storageRequest:
type: string
type: object
required:
- containerImage
- databaseInstance
Expand All @@ -1051,7 +1058,6 @@ spec:
- keystoneEndpoint
- memcachedInstance
- secret
- storageRequest
type: object
status:
properties:
Expand Down
5 changes: 3 additions & 2 deletions config/samples/glance_v1beta1_glance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ spec:
databaseInstance: openstack
databaseAccount: glance
secret: osp-secret
storageClass: local-storage
storageRequest: 10G
storage:
storageClass: local-storage
storageRequest: 10G
3 changes: 2 additions & 1 deletion config/samples/glance_v1beta1_glanceapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ spec:
databaseHostname: glance
preserveJobs: false
replicas: 1
storageRequest: 10G
storage:
storageRequest: 10G
secret: glance-secret
#tls:
# api:
Expand Down
5 changes: 3 additions & 2 deletions config/samples/layout/base/glance_v1beta1_glance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ spec:
databaseInstance: openstack
databaseAccount: glance
secret: osp-secret
storageClass: local-storage
storageRequest: 10G
storage:
storageClass: local-storage
storageRequest: 10G
5 changes: 3 additions & 2 deletions config/samples/layout/edge/glance_v1beta1_glance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ spec:
replicas: 1
type: single
secret: osp-secret
storageClass: local-storage
storageRequest: 10G
storage:
storageClass: local-storage
storageRequest: 10G
5 changes: 3 additions & 2 deletions config/samples/layout/multiple/glance_v1beta1_glance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ spec:
replicas: 1
type: single
secret: osp-secret
storageClass: local-storage
storageRequest: 10G
storage:
storageClass: local-storage
storageRequest: 10G
5 changes: 3 additions & 2 deletions config/samples/layout/single/glance_v1beta1_glance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ spec:
imageCache:
size: 2G
secret: osp-secret
storageClass: local-storage
storageRequest: 10G
storage:
storageClass: local-storage
storageRequest: 10G
5 changes: 3 additions & 2 deletions config/samples/layout/single_tls/glance_v1beta1_glance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ spec:
caBundleSecretName: combined-ca-bundle
type: single
secret: osp-secret
storageClass: local-storage
storageRequest: 10G
storage:
storageClass: local-storage
storageRequest: 10G
6 changes: 3 additions & 3 deletions config/samples/layout/split/glance_v1beta1_glance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
keystoneEndpoint: default
glanceAPIs:
default:
preserveJobs: false
replicas: 1
storageClass: local-storage
storageRequest: 10G
storage:
storageClass: local-storage
storageRequest: 10G
Loading
Loading