Skip to content

Commit

Permalink
Add support for memcached instance
Browse files Browse the repository at this point in the history
Removing the existing memcached container will
be done in a follow up commit.
  • Loading branch information
cschwede committed Jan 31, 2024
1 parent 678ba24 commit b29e3c8
Show file tree
Hide file tree
Showing 21 changed files with 168 additions and 16 deletions.
5 changes: 5 additions & 0 deletions api/bases/swift.openstack.org_swiftproxies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ spec:
containerImageProxy:
description: Swift Proxy Container Image URL
type: string
memcachedServers:
default: ""
description: List of memcached servers.
type: string
networkAttachments:
description: NetworkAttachments is a list of NetworkAttachment resource
names to expose the services to the given network
Expand Down Expand Up @@ -269,6 +273,7 @@ spec:
required:
- containerImageMemcached
- containerImageProxy
- memcachedServers
- replicas
- secret
- serviceUser
Expand Down
15 changes: 15 additions & 0 deletions api/bases/swift.openstack.org_swifts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ spec:
spec:
description: SwiftSpec defines the desired state of Swift
properties:
memcachedInstance:
default: memcached
description: Memcached instance name.
type: string
networkAttachments:
description: NetworkAttachments is a list of NetworkAttachment resource
names to expose the services to the given network
Expand All @@ -73,6 +77,10 @@ spec:
containerImageProxy:
description: Swift Proxy Container Image URL
type: string
memcachedServers:
default: ""
description: List of memcached servers.
type: string
networkAttachments:
description: NetworkAttachments is a list of NetworkAttachment
resource names to expose the services to the given network
Expand Down Expand Up @@ -296,6 +304,7 @@ spec:
required:
- containerImageMemcached
- containerImageProxy
- memcachedServers
- replicas
- secret
- serviceUser
Expand Down Expand Up @@ -342,6 +351,10 @@ spec:
containerImageProxy:
description: Image URL for Swift proxy service
type: string
memcachedServers:
default: ""
description: List of memcached servers.
type: string
networkAttachments:
description: NetworkAttachments is a list of NetworkAttachment
resource names to expose the services to the given network
Expand Down Expand Up @@ -371,12 +384,14 @@ spec:
- containerImageMemcached
- containerImageObject
- containerImageProxy
- memcachedServers
- replicas
- storageClass
- storageRequest
- swiftConfSecret
type: object
required:
- memcachedInstance
- storageClass
- swiftConfSecret
- swiftProxy
Expand Down
5 changes: 5 additions & 0 deletions api/bases/swift.openstack.org_swiftstorages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ spec:
containerImageProxy:
description: Image URL for Swift proxy service
type: string
memcachedServers:
default: ""
description: List of memcached servers.
type: string
networkAttachments:
description: NetworkAttachments is a list of NetworkAttachment resource
names to expose the services to the given network
Expand Down Expand Up @@ -92,6 +96,7 @@ spec:
- containerImageMemcached
- containerImageObject
- containerImageProxy
- memcachedServers
- replicas
- storageClass
- storageRequest
Expand Down
5 changes: 5 additions & 0 deletions api/v1beta1/swift_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ type SwiftSpec struct {
// +kubebuilder:validation:Optional
// NetworkAttachments is a list of NetworkAttachment resource names to expose the services to the given network
NetworkAttachments []string `json:"networkAttachments,omitempty"`

// +kubebuilder:validation:Required
// +kubebuilder:default=memcached
// Memcached instance name.
MemcachedInstance string `json:"memcachedInstance"`
}

// SwiftStatus defines the observed state of Swift
Expand Down
6 changes: 5 additions & 1 deletion api/v1beta1/swiftproxy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ type SwiftProxySpec struct {
// Image URL for Memcache servicd
ContainerImageMemcached string `json:"containerImageMemcached"`

// +kubebuilder:validation:Required
// +kubebuilder:default=swift
// ServiceUser - optional username used for this service to register in Swift
ServiceUser string `json:"serviceUser"`
Expand All @@ -76,6 +75,11 @@ type SwiftProxySpec struct {
// +kubebuilder:validation:Optional
// NetworkAttachments is a list of NetworkAttachment resource names to expose the services to the given network
NetworkAttachments []string `json:"networkAttachments,omitempty"`

// +kubebuilder:validation:Required
// +kubebuilder:default=""
// List of memcached servers.
MemcachedServers string `json:"memcachedServers"`
}

// ProxyOverrideSpec to override the generated manifest of several child resources.
Expand Down
5 changes: 5 additions & 0 deletions api/v1beta1/swiftstorage_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ type SwiftStorageSpec struct {
// +kubebuilder:validation:Optional
// NetworkAttachments is a list of NetworkAttachment resource names to expose the services to the given network
NetworkAttachments []string `json:"networkAttachments,omitempty"`

// +kubebuilder:validation:Required
// +kubebuilder:default=""
// List of memcached servers.
MemcachedServers string `json:"memcachedServers"`
}

// SwiftStorageStatus defines the observed state of SwiftStorage
Expand Down
5 changes: 5 additions & 0 deletions config/crd/bases/swift.openstack.org_swiftproxies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ spec:
containerImageProxy:
description: Swift Proxy Container Image URL
type: string
memcachedServers:
default: ""
description: List of memcached servers.
type: string
networkAttachments:
description: NetworkAttachments is a list of NetworkAttachment resource
names to expose the services to the given network
Expand Down Expand Up @@ -269,6 +273,7 @@ spec:
required:
- containerImageMemcached
- containerImageProxy
- memcachedServers
- replicas
- secret
- serviceUser
Expand Down
15 changes: 15 additions & 0 deletions config/crd/bases/swift.openstack.org_swifts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ spec:
spec:
description: SwiftSpec defines the desired state of Swift
properties:
memcachedInstance:
default: memcached
description: Memcached instance name.
type: string
networkAttachments:
description: NetworkAttachments is a list of NetworkAttachment resource
names to expose the services to the given network
Expand All @@ -73,6 +77,10 @@ spec:
containerImageProxy:
description: Swift Proxy Container Image URL
type: string
memcachedServers:
default: ""
description: List of memcached servers.
type: string
networkAttachments:
description: NetworkAttachments is a list of NetworkAttachment
resource names to expose the services to the given network
Expand Down Expand Up @@ -296,6 +304,7 @@ spec:
required:
- containerImageMemcached
- containerImageProxy
- memcachedServers
- replicas
- secret
- serviceUser
Expand Down Expand Up @@ -342,6 +351,10 @@ spec:
containerImageProxy:
description: Image URL for Swift proxy service
type: string
memcachedServers:
default: ""
description: List of memcached servers.
type: string
networkAttachments:
description: NetworkAttachments is a list of NetworkAttachment
resource names to expose the services to the given network
Expand Down Expand Up @@ -371,12 +384,14 @@ spec:
- containerImageMemcached
- containerImageObject
- containerImageProxy
- memcachedServers
- replicas
- storageClass
- storageRequest
- swiftConfSecret
type: object
required:
- memcachedInstance
- storageClass
- swiftConfSecret
- swiftProxy
Expand Down
5 changes: 5 additions & 0 deletions config/crd/bases/swift.openstack.org_swiftstorages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ spec:
containerImageProxy:
description: Image URL for Swift proxy service
type: string
memcachedServers:
default: ""
description: List of memcached servers.
type: string
networkAttachments:
description: NetworkAttachments is a list of NetworkAttachment resource
names to expose the services to the given network
Expand Down Expand Up @@ -92,6 +96,7 @@ spec:
- containerImageMemcached
- containerImageObject
- containerImageProxy
- memcachedServers
- replicas
- storageClass
- storageRequest
Expand Down
8 changes: 8 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,14 @@ rules:
- patch
- update
- watch
- apiGroups:
- memcached.openstack.org
resources:
- memcacheds
verbs:
- get
- list
- watch
- apiGroups:
- networking.k8s.io
resources:
Expand Down
Loading

0 comments on commit b29e3c8

Please sign in to comment.