Skip to content

Commit

Permalink
Remove memcached container from within Swift pods
Browse files Browse the repository at this point in the history
No longer needed due to using the cluster memcached instance.
  • Loading branch information
cschwede committed Jan 30, 2024
1 parent c311872 commit d7c9e98
Show file tree
Hide file tree
Showing 16 changed files with 2 additions and 77 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ X-Openstack-Request-Id: txbb13222da0d94527a7101-00649551fc
- [ ] Refactor conf file copying, Secret and ConfigMap usage
- [ ] Use Kolla
- [ ] Support Network isolation
- [ ] Use memcached if available within cluster

## License

Expand Down
4 changes: 0 additions & 4 deletions api/bases/swift.openstack.org_swiftproxies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ spec:
spec:
description: SwiftProxySpec defines the desired state of SwiftProxy
properties:
containerImageMemcached:
description: Image URL for Memcache servicd
type: string
containerImageProxy:
description: Swift Proxy Container Image URL
type: string
Expand Down Expand Up @@ -271,7 +268,6 @@ spec:
description: Name of Secret containing swift.conf
type: string
required:
- containerImageMemcached
- containerImageProxy
- memcachedInstance
- replicas
Expand Down
8 changes: 0 additions & 8 deletions api/bases/swift.openstack.org_swifts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ spec:
description: SwiftProxy - Spec definition for the Proxy service of
this Swift deployment
properties:
containerImageMemcached:
description: Image URL for Memcache servicd
type: string
containerImageProxy:
description: Swift Proxy Container Image URL
type: string
Expand Down Expand Up @@ -302,7 +299,6 @@ spec:
description: Name of Secret containing swift.conf
type: string
required:
- containerImageMemcached
- containerImageProxy
- memcachedInstance
- replicas
Expand Down Expand Up @@ -342,9 +338,6 @@ spec:
containerImageContainer:
description: Image URL for Swift container service
type: string
containerImageMemcached:
description: Image URL for Memcache servicd
type: string
containerImageObject:
description: Image URL for Swift object service
type: string
Expand Down Expand Up @@ -381,7 +374,6 @@ spec:
required:
- containerImageAccount
- containerImageContainer
- containerImageMemcached
- containerImageObject
- containerImageProxy
- memcachedInstance
Expand Down
4 changes: 0 additions & 4 deletions api/bases/swift.openstack.org_swiftstorages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ spec:
containerImageContainer:
description: Image URL for Swift container service
type: string
containerImageMemcached:
description: Image URL for Memcache servicd
type: string
containerImageObject:
description: Image URL for Swift object service
type: string
Expand Down Expand Up @@ -93,7 +90,6 @@ spec:
required:
- containerImageAccount
- containerImageContainer
- containerImageMemcached
- containerImageObject
- containerImageProxy
- memcachedInstance
Expand Down
2 changes: 0 additions & 2 deletions api/v1beta1/swift_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const (
ContainerImageContainer = "quay.io/podified-antelope-centos9/openstack-swift-container:current-podified"
ContainerImageObject = "quay.io/podified-antelope-centos9/openstack-swift-object:current-podified"
ContainerImageProxy = "quay.io/podified-antelope-centos9/openstack-swift-proxy-server:current-podified"
ContainerImageMemcached = "quay.io/podified-antelope-centos9/openstack-memcached:current-podified"
)

// SwiftSpec defines the desired state of Swift
Expand Down Expand Up @@ -128,7 +127,6 @@ func SetupDefaults() {
ContainerContainerImageURL: util.GetEnvVar("RELATED_IMAGE_SWIFT_CONTAINER_IMAGE_URL_DEFAULT", ContainerImageContainer),
ObjectContainerImageURL: util.GetEnvVar("RELATED_IMAGE_SWIFT_OBJECT_IMAGE_URL_DEFAULT", ContainerImageObject),
ProxyContainerImageURL: util.GetEnvVar("RELATED_IMAGE_SWIFT_PROXY_IMAGE_URL_DEFAULT", ContainerImageProxy),
MemcachedContainerImageURL: util.GetEnvVar("RELATED_IMAGE_SWIFT_MEMCACHED_IMAGE_URL_DEFAULT", ContainerImageMemcached),
}

SetupSwiftDefaults(swiftDefaults)
Expand Down
9 changes: 0 additions & 9 deletions api/v1beta1/swift_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ type SwiftDefaults struct {
ContainerContainerImageURL string
ObjectContainerImageURL string
ProxyContainerImageURL string
MemcachedContainerImageURL string
}

var swiftDefaults SwiftDefaults
Expand Down Expand Up @@ -94,18 +93,10 @@ func (spec *SwiftSpec) Default() {
spec.SwiftStorage.ContainerImageProxy = swiftDefaults.ProxyContainerImageURL
}

if spec.SwiftStorage.ContainerImageMemcached == "" {
spec.SwiftStorage.ContainerImageMemcached = swiftDefaults.MemcachedContainerImageURL
}

// proxy
if spec.SwiftProxy.ContainerImageProxy == "" {
spec.SwiftProxy.ContainerImageProxy = swiftDefaults.ProxyContainerImageURL
}

if spec.SwiftProxy.ContainerImageMemcached == "" {
spec.SwiftProxy.ContainerImageMemcached = swiftDefaults.MemcachedContainerImageURL
}
}

// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable deletion validation.
Expand Down
2 changes: 0 additions & 2 deletions api/v1beta1/swiftproxy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ type SwiftProxySpec struct {
ContainerImageProxy string `json:"containerImageProxy"`

// +kubebuilder:validation:Required
// Image URL for Memcache servicd
ContainerImageMemcached string `json:"containerImageMemcached"`
// +kubebuilder:default=memcached
// Memcached instance name.
MemcachedInstance string `json:"memcachedInstance"`
Expand Down
4 changes: 0 additions & 4 deletions api/v1beta1/swiftstorage_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ type SwiftStorageSpec struct {
// Image URL for Swift proxy service
ContainerImageProxy string `json:"containerImageProxy"`

// +kubebuilder:validation:Required
// Image URL for Memcache servicd
ContainerImageMemcached string `json:"containerImageMemcached"`

// +kubebuilder:validation:Required
// +kubebuilder:default=swift-conf
// Name of Secret containing swift.conf
Expand Down
4 changes: 0 additions & 4 deletions config/crd/bases/swift.openstack.org_swiftproxies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ spec:
spec:
description: SwiftProxySpec defines the desired state of SwiftProxy
properties:
containerImageMemcached:
description: Image URL for Memcache servicd
type: string
containerImageProxy:
description: Swift Proxy Container Image URL
type: string
Expand Down Expand Up @@ -271,7 +268,6 @@ spec:
description: Name of Secret containing swift.conf
type: string
required:
- containerImageMemcached
- containerImageProxy
- memcachedInstance
- replicas
Expand Down
8 changes: 0 additions & 8 deletions config/crd/bases/swift.openstack.org_swifts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ spec:
description: SwiftProxy - Spec definition for the Proxy service of
this Swift deployment
properties:
containerImageMemcached:
description: Image URL for Memcache servicd
type: string
containerImageProxy:
description: Swift Proxy Container Image URL
type: string
Expand Down Expand Up @@ -302,7 +299,6 @@ spec:
description: Name of Secret containing swift.conf
type: string
required:
- containerImageMemcached
- containerImageProxy
- memcachedInstance
- replicas
Expand Down Expand Up @@ -342,9 +338,6 @@ spec:
containerImageContainer:
description: Image URL for Swift container service
type: string
containerImageMemcached:
description: Image URL for Memcache servicd
type: string
containerImageObject:
description: Image URL for Swift object service
type: string
Expand Down Expand Up @@ -381,7 +374,6 @@ spec:
required:
- containerImageAccount
- containerImageContainer
- containerImageMemcached
- containerImageObject
- containerImageProxy
- memcachedInstance
Expand Down
4 changes: 0 additions & 4 deletions config/crd/bases/swift.openstack.org_swiftstorages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ spec:
containerImageContainer:
description: Image URL for Swift container service
type: string
containerImageMemcached:
description: Image URL for Memcache servicd
type: string
containerImageObject:
description: Image URL for Swift object service
type: string
Expand Down Expand Up @@ -93,7 +90,6 @@ spec:
required:
- containerImageAccount
- containerImageContainer
- containerImageMemcached
- containerImageObject
- containerImageProxy
- memcachedInstance
Expand Down
2 changes: 0 additions & 2 deletions config/default/manager_default_images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,3 @@ spec:
value: quay.io/podified-antelope-centos9/openstack-swift-container:current-podified
- name: RELATED_IMAGE_SWIFT_OBJECT_IMAGE_URL_DEFAULT
value: quay.io/podified-antelope-centos9/openstack-swift-object:current-podified
- name: RELATED_IMAGE_SWIFT_MEMCACHED_IMAGE_URL_DEFAULT
value: quay.io/podified-antelope-centos9/openstack-memcached:current-podified
2 changes: 0 additions & 2 deletions controllers/swift_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,6 @@ func (r *SwiftReconciler) storageCreateOrUpdate(ctx context.Context, instance *s
ContainerImageContainer: instance.Spec.SwiftStorage.ContainerImageContainer,
ContainerImageObject: instance.Spec.SwiftStorage.ContainerImageObject,
ContainerImageProxy: instance.Spec.SwiftStorage.ContainerImageProxy,
ContainerImageMemcached: instance.Spec.SwiftStorage.ContainerImageMemcached,
SwiftConfSecret: instance.Spec.SwiftConfSecret,
NetworkAttachments: instance.Spec.SwiftStorage.NetworkAttachments,
MemcachedInstance: instance.Spec.MemcachedInstance,
Expand Down Expand Up @@ -381,7 +380,6 @@ func (r *SwiftReconciler) proxyCreateOrUpdate(ctx context.Context, instance *swi
swiftProxySpec := swiftv1.SwiftProxySpec{
Replicas: instance.Spec.SwiftProxy.Replicas,
ContainerImageProxy: instance.Spec.SwiftProxy.ContainerImageProxy,
ContainerImageMemcached: instance.Spec.SwiftProxy.ContainerImageMemcached,
Secret: instance.Spec.SwiftProxy.Secret,
ServiceUser: instance.Spec.SwiftProxy.ServiceUser,
PasswordSelectors: instance.Spec.SwiftProxy.PasswordSelectors,
Expand Down
5 changes: 2 additions & 3 deletions pkg/swift/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ limitations under the License.
package swift

const (
RunAsUser int64 = 42445
ProxyPort int32 = 8080
MemcachedPort int32 = 11211
RunAsUser int64 = 42445
ProxyPort int32 = 8080

AccountServerPort int32 = 6202
ContainerServerPort int32 = 6201
Expand Down
12 changes: 0 additions & 12 deletions pkg/swiftproxy/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,6 @@ func Deployment(
VolumeMounts: getProxyVolumeMounts(),
Command: []string{"/usr/bin/swift-proxy-server", "/etc/swift/proxy-server.conf", "-v"},
},
{
Image: instance.Spec.ContainerImageMemcached,
Name: "memcached",
ImagePullPolicy: corev1.PullIfNotPresent,
SecurityContext: &securityContext,
Ports: []corev1.ContainerPort{{
ContainerPort: swift.MemcachedPort,
Name: "memcached",
}},
VolumeMounts: getProxyVolumeMounts(),
Command: []string{"/usr/bin/memcached", "-p", "11211", "-u", "memcached"},
},
},
},
},
Expand Down
8 changes: 0 additions & 8 deletions pkg/swiftstorage/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,6 @@ func getStorageContainers(swiftstorage *swiftv1beta1.SwiftStorage) []corev1.Cont
VolumeMounts: getStorageVolumeMounts(),
Command: []string{"/usr/bin/rsync", "--daemon", "--no-detach", "--config=/etc/swift/rsyncd.conf", "--log-file=/dev/stdout"},
},
{
Name: "memcached",
Image: swiftstorage.Spec.ContainerImageMemcached,
ImagePullPolicy: corev1.PullIfNotPresent,
SecurityContext: &securityContext,
Ports: getPorts(swift.MemcachedPort, "memcached"),
Command: []string{"/usr/bin/memcached", "-p", "11211", "-u", "memcached"},
},
}
}

Expand Down

0 comments on commit d7c9e98

Please sign in to comment.