diff --git a/api/bases/cinder.openstack.org_cinderapis.yaml b/api/bases/cinder.openstack.org_cinderapis.yaml index 1f51f92d..a0e5d7a6 100644 --- a/api/bases/cinder.openstack.org_cinderapis.yaml +++ b/api/bases/cinder.openstack.org_cinderapis.yaml @@ -53,12 +53,6 @@ spec: databaseUser: default: cinder type: string - debug: - properties: - service: - default: false - type: boolean - type: object extraMounts: items: properties: diff --git a/api/bases/cinder.openstack.org_cinderbackups.yaml b/api/bases/cinder.openstack.org_cinderbackups.yaml index d1df4a27..2c7af4b0 100644 --- a/api/bases/cinder.openstack.org_cinderbackups.yaml +++ b/api/bases/cinder.openstack.org_cinderbackups.yaml @@ -53,12 +53,6 @@ spec: databaseUser: default: cinder type: string - debug: - properties: - service: - default: false - type: boolean - type: object extraMounts: items: properties: diff --git a/api/bases/cinder.openstack.org_cinders.yaml b/api/bases/cinder.openstack.org_cinders.yaml index 208f7d56..efea86f6 100644 --- a/api/bases/cinder.openstack.org_cinders.yaml +++ b/api/bases/cinder.openstack.org_cinders.yaml @@ -46,12 +46,6 @@ spec: items: type: string type: array - debug: - properties: - service: - default: false - type: boolean - type: object networkAttachments: items: type: string @@ -178,12 +172,6 @@ spec: items: type: string type: array - debug: - properties: - service: - default: false - type: boolean - type: object networkAttachments: items: type: string @@ -241,12 +229,6 @@ spec: items: type: string type: array - debug: - properties: - service: - default: false - type: boolean - type: object networkAttachments: items: type: string @@ -305,12 +287,6 @@ spec: items: type: string type: array - debug: - properties: - service: - default: false - type: boolean - type: object networkAttachments: items: type: string @@ -382,9 +358,6 @@ spec: dbPurge: default: false type: boolean - dbSync: - default: false - type: boolean type: object extraMounts: items: diff --git a/api/bases/cinder.openstack.org_cinderschedulers.yaml b/api/bases/cinder.openstack.org_cinderschedulers.yaml index ffbbf26d..facf66df 100644 --- a/api/bases/cinder.openstack.org_cinderschedulers.yaml +++ b/api/bases/cinder.openstack.org_cinderschedulers.yaml @@ -53,12 +53,6 @@ spec: databaseUser: default: cinder type: string - debug: - properties: - service: - default: false - type: boolean - type: object extraMounts: items: properties: diff --git a/api/bases/cinder.openstack.org_cindervolumes.yaml b/api/bases/cinder.openstack.org_cindervolumes.yaml index 50f31a5b..013340e8 100644 --- a/api/bases/cinder.openstack.org_cindervolumes.yaml +++ b/api/bases/cinder.openstack.org_cindervolumes.yaml @@ -53,12 +53,6 @@ spec: databaseUser: default: cinder type: string - debug: - properties: - service: - default: false - type: boolean - type: object extraMounts: items: properties: diff --git a/api/v1beta1/cinder_types.go b/api/v1beta1/cinder_types.go index 6aeeebb5..2c2375b1 100644 --- a/api/v1beta1/cinder_types.go +++ b/api/v1beta1/cinder_types.go @@ -183,10 +183,6 @@ type DBPurge struct { // CinderDebug contains flags related to multiple debug activities. See the // individual comments for what this means for each flag. type CinderDebug struct { - // +kubebuilder:validation:Optional - // +kubebuilder:default=false - // DBSync pauses the dbSync container instead of executing the db_sync command. - DBSync bool `json:"dbSync"` // +kubebuilder:validation:Optional // +kubebuilder:default=false // DBPurge increases log verbosity by executing the db_purge command with "--debug". diff --git a/api/v1beta1/common_types.go b/api/v1beta1/common_types.go index e2f6358a..2155b6a7 100644 --- a/api/v1beta1/common_types.go +++ b/api/v1beta1/common_types.go @@ -55,11 +55,6 @@ type CinderServiceTemplate struct { // any global NodeSelector settings within the Cinder CR. NodeSelector map[string]string `json:"nodeSelector,omitempty"` - // +kubebuilder:validation:Optional - // Debug - enable debug for different deploy stages. If an init container is used, it runs and the - // actual action pod gets started with sleep infinity - Debug CinderServiceDebug `json:"debug,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 @@ -94,12 +89,3 @@ type PasswordSelector struct { // Service - Selector to get the cinder service password from the Secret Service string `json:"service"` } - -// CinderServiceDebug indicates whether certain stages of Cinder service -// deployment should pause in debug mode -type CinderServiceDebug struct { - // +kubebuilder:validation:Optional - // +kubebuilder:default=false - // service enable debug - Service bool `json:"service"` -} diff --git a/api/v1beta1/zz_generated.deepcopy.go b/api/v1beta1/zz_generated.deepcopy.go index 0e0b056d..b0c522e7 100644 --- a/api/v1beta1/zz_generated.deepcopy.go +++ b/api/v1beta1/zz_generated.deepcopy.go @@ -633,21 +633,6 @@ func (in *CinderSchedulerTemplate) DeepCopy() *CinderSchedulerTemplate { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CinderServiceDebug) DeepCopyInto(out *CinderServiceDebug) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CinderServiceDebug. -func (in *CinderServiceDebug) DeepCopy() *CinderServiceDebug { - if in == nil { - return nil - } - out := new(CinderServiceDebug) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CinderServiceTemplate) DeepCopyInto(out *CinderServiceTemplate) { *out = *in @@ -658,7 +643,6 @@ func (in *CinderServiceTemplate) DeepCopyInto(out *CinderServiceTemplate) { (*out)[key] = val } } - out.Debug = in.Debug if in.CustomServiceConfigSecrets != nil { in, out := &in.CustomServiceConfigSecrets, &out.CustomServiceConfigSecrets *out = make([]string, len(*in)) diff --git a/config/crd/bases/cinder.openstack.org_cinderapis.yaml b/config/crd/bases/cinder.openstack.org_cinderapis.yaml index 1f51f92d..a0e5d7a6 100644 --- a/config/crd/bases/cinder.openstack.org_cinderapis.yaml +++ b/config/crd/bases/cinder.openstack.org_cinderapis.yaml @@ -53,12 +53,6 @@ spec: databaseUser: default: cinder type: string - debug: - properties: - service: - default: false - type: boolean - type: object extraMounts: items: properties: diff --git a/config/crd/bases/cinder.openstack.org_cinderbackups.yaml b/config/crd/bases/cinder.openstack.org_cinderbackups.yaml index d1df4a27..2c7af4b0 100644 --- a/config/crd/bases/cinder.openstack.org_cinderbackups.yaml +++ b/config/crd/bases/cinder.openstack.org_cinderbackups.yaml @@ -53,12 +53,6 @@ spec: databaseUser: default: cinder type: string - debug: - properties: - service: - default: false - type: boolean - type: object extraMounts: items: properties: diff --git a/config/crd/bases/cinder.openstack.org_cinders.yaml b/config/crd/bases/cinder.openstack.org_cinders.yaml index 208f7d56..efea86f6 100644 --- a/config/crd/bases/cinder.openstack.org_cinders.yaml +++ b/config/crd/bases/cinder.openstack.org_cinders.yaml @@ -46,12 +46,6 @@ spec: items: type: string type: array - debug: - properties: - service: - default: false - type: boolean - type: object networkAttachments: items: type: string @@ -178,12 +172,6 @@ spec: items: type: string type: array - debug: - properties: - service: - default: false - type: boolean - type: object networkAttachments: items: type: string @@ -241,12 +229,6 @@ spec: items: type: string type: array - debug: - properties: - service: - default: false - type: boolean - type: object networkAttachments: items: type: string @@ -305,12 +287,6 @@ spec: items: type: string type: array - debug: - properties: - service: - default: false - type: boolean - type: object networkAttachments: items: type: string @@ -382,9 +358,6 @@ spec: dbPurge: default: false type: boolean - dbSync: - default: false - type: boolean type: object extraMounts: items: diff --git a/config/crd/bases/cinder.openstack.org_cinderschedulers.yaml b/config/crd/bases/cinder.openstack.org_cinderschedulers.yaml index ffbbf26d..facf66df 100644 --- a/config/crd/bases/cinder.openstack.org_cinderschedulers.yaml +++ b/config/crd/bases/cinder.openstack.org_cinderschedulers.yaml @@ -53,12 +53,6 @@ spec: databaseUser: default: cinder type: string - debug: - properties: - service: - default: false - type: boolean - type: object extraMounts: items: properties: diff --git a/config/crd/bases/cinder.openstack.org_cindervolumes.yaml b/config/crd/bases/cinder.openstack.org_cindervolumes.yaml index 50f31a5b..013340e8 100644 --- a/config/crd/bases/cinder.openstack.org_cindervolumes.yaml +++ b/config/crd/bases/cinder.openstack.org_cindervolumes.yaml @@ -53,12 +53,6 @@ spec: databaseUser: default: cinder type: string - debug: - properties: - service: - default: false - type: boolean - type: object extraMounts: items: properties: diff --git a/pkg/cinder/dbsync.go b/pkg/cinder/dbsync.go index 48658079..2844b188 100644 --- a/pkg/cinder/dbsync.go +++ b/pkg/cinder/dbsync.go @@ -2,7 +2,6 @@ package cinder import ( cinderv1beta1 "github.com/openstack-k8s-operators/cinder-operator/api/v1beta1" - common "github.com/openstack-k8s-operators/lib-common/modules/common" "github.com/openstack-k8s-operators/lib-common/modules/common/env" batchv1 "k8s.io/api/batch/v1" corev1 "k8s.io/api/core/v1" @@ -74,12 +73,7 @@ func DbSyncJob(instance *cinderv1beta1.Cinder, labels map[string]string, annotat dbSyncExtraMounts := []cinderv1beta1.CinderExtraVolMounts{} - args := []string{"-c"} - if instance.Spec.Debug.DBSync { - args = append(args, common.DebugCommand) - } else { - args = append(args, DBSyncCommand) - } + args := []string{"-c", DBSyncCommand} runAsUser := int64(0) envVars := map[string]env.Setter{} diff --git a/pkg/cinderapi/statefuleset.go b/pkg/cinderapi/statefuleset.go index 3fe2d5a7..d7c1342f 100644 --- a/pkg/cinderapi/statefuleset.go +++ b/pkg/cinderapi/statefuleset.go @@ -18,7 +18,6 @@ package cinderapi import ( cinderv1beta1 "github.com/openstack-k8s-operators/cinder-operator/api/v1beta1" cinder "github.com/openstack-k8s-operators/cinder-operator/pkg/cinder" - common "github.com/openstack-k8s-operators/lib-common/modules/common" "github.com/openstack-k8s-operators/lib-common/modules/common/env" "github.com/openstack-k8s-operators/lib-common/modules/common/service" "github.com/openstack-k8s-operators/lib-common/modules/common/tls" @@ -56,30 +55,19 @@ func StatefulSet( InitialDelaySeconds: 5, } - args := []string{"-c"} - if instance.Spec.Debug.Service { - args = append(args, common.DebugCommand) - livenessProbe.Exec = &corev1.ExecAction{ - Command: []string{ - "/bin/true", - }, - } - readinessProbe.Exec = livenessProbe.Exec - } else { - args = append(args, ServiceCommand) - // - // https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/ - // - livenessProbe.HTTPGet = &corev1.HTTPGetAction{ - Path: "/healthcheck", - Port: intstr.IntOrString{Type: intstr.Int, IntVal: int32(cinder.CinderPublicPort)}, - } - readinessProbe.HTTPGet = livenessProbe.HTTPGet + args := []string{"-c", ServiceCommand} + // + // https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/ + // + livenessProbe.HTTPGet = &corev1.HTTPGetAction{ + Path: "/healthcheck", + Port: intstr.IntOrString{Type: intstr.Int, IntVal: int32(cinder.CinderPublicPort)}, + } + readinessProbe.HTTPGet = livenessProbe.HTTPGet - if instance.Spec.TLS.API.Enabled(service.EndpointPublic) { - livenessProbe.HTTPGet.Scheme = corev1.URISchemeHTTPS - readinessProbe.HTTPGet.Scheme = corev1.URISchemeHTTPS - } + if instance.Spec.TLS.API.Enabled(service.EndpointPublic) { + livenessProbe.HTTPGet.Scheme = corev1.URISchemeHTTPS + readinessProbe.HTTPGet.Scheme = corev1.URISchemeHTTPS } // create Volume and VolumeMounts diff --git a/pkg/cinderbackup/statefulset.go b/pkg/cinderbackup/statefulset.go index 8590d945..dbe7830e 100644 --- a/pkg/cinderbackup/statefulset.go +++ b/pkg/cinderbackup/statefulset.go @@ -18,7 +18,6 @@ package cinderbackup import ( cinderv1 "github.com/openstack-k8s-operators/cinder-operator/api/v1beta1" cinder "github.com/openstack-k8s-operators/cinder-operator/pkg/cinder" - common "github.com/openstack-k8s-operators/lib-common/modules/common" "github.com/openstack-k8s-operators/lib-common/modules/common/env" appsv1 "k8s.io/api/apps/v1" @@ -59,33 +58,17 @@ func StatefulSet( InitialDelaySeconds: 5, } - args := []string{"-c"} + args := []string{"-c", ServiceCommand} var probeCommand []string - // When debugging the service container will run kolla_set_configs and - // sleep forever and the probe container will just sleep forever. - if instance.Spec.Debug.Service { - args = append(args, common.DebugCommand) - livenessProbe.Exec = &corev1.ExecAction{ - Command: []string{ - "/bin/true", - }, - } - startupProbe.Exec = livenessProbe.Exec - probeCommand = []string{ - "/bin/sleep", "infinity", - } - } else { - args = append(args, ServiceCommand) - // Use the HTTP probe now that we have a simple server running - livenessProbe.HTTPGet = &corev1.HTTPGetAction{ - Port: intstr.FromInt(8080), - } - startupProbe.HTTPGet = livenessProbe.HTTPGet - probeCommand = []string{ - "/usr/local/bin/container-scripts/healthcheck.py", - "backup", - "/etc/cinder/cinder.conf.d", - } + // Use the HTTP probe now that we have a simple server running + livenessProbe.HTTPGet = &corev1.HTTPGetAction{ + Port: intstr.FromInt(8080), + } + startupProbe.HTTPGet = livenessProbe.HTTPGet + probeCommand = []string{ + "/usr/local/bin/container-scripts/healthcheck.py", + "backup", + "/etc/cinder/cinder.conf.d", } envVars := map[string]env.Setter{} diff --git a/pkg/cinderscheduler/statefulset.go b/pkg/cinderscheduler/statefulset.go index 6e57ef51..eecd0b11 100644 --- a/pkg/cinderscheduler/statefulset.go +++ b/pkg/cinderscheduler/statefulset.go @@ -18,7 +18,6 @@ package cinderscheduler import ( cinderv1 "github.com/openstack-k8s-operators/cinder-operator/api/v1beta1" cinder "github.com/openstack-k8s-operators/cinder-operator/pkg/cinder" - common "github.com/openstack-k8s-operators/lib-common/modules/common" "github.com/openstack-k8s-operators/lib-common/modules/common/env" appsv1 "k8s.io/api/apps/v1" @@ -58,32 +57,16 @@ func StatefulSet( InitialDelaySeconds: 5, } - args := []string{"-c"} + args := []string{"-c", ServiceCommand} var probeCommand []string - // When debugging the service container will run kolla_set_configs and - // sleep forever and the probe container will just sleep forever. - if instance.Spec.Debug.Service { - args = append(args, common.DebugCommand) - livenessProbe.Exec = &corev1.ExecAction{ - Command: []string{ - "/bin/true", - }, - } - startupProbe.Exec = livenessProbe.Exec - probeCommand = []string{ - "/bin/sleep", "infinity", - } - } else { - args = append(args, ServiceCommand) - livenessProbe.HTTPGet = &corev1.HTTPGetAction{ - Port: intstr.FromInt(8080), - } - startupProbe.HTTPGet = livenessProbe.HTTPGet - probeCommand = []string{ - "/usr/local/bin/container-scripts/healthcheck.py", - "scheduler", - "/etc/cinder/cinder.conf.d", - } + livenessProbe.HTTPGet = &corev1.HTTPGetAction{ + Port: intstr.FromInt(8080), + } + startupProbe.HTTPGet = livenessProbe.HTTPGet + probeCommand = []string{ + "/usr/local/bin/container-scripts/healthcheck.py", + "scheduler", + "/etc/cinder/cinder.conf.d", } envVars := map[string]env.Setter{} diff --git a/pkg/cindervolume/statefulset.go b/pkg/cindervolume/statefulset.go index 04f1e90b..f36c118a 100644 --- a/pkg/cindervolume/statefulset.go +++ b/pkg/cindervolume/statefulset.go @@ -18,7 +18,6 @@ package cindervolume import ( cinderv1 "github.com/openstack-k8s-operators/cinder-operator/api/v1beta1" cinder "github.com/openstack-k8s-operators/cinder-operator/pkg/cinder" - common "github.com/openstack-k8s-operators/lib-common/modules/common" "github.com/openstack-k8s-operators/lib-common/modules/common/env" appsv1 "k8s.io/api/apps/v1" @@ -59,33 +58,17 @@ func StatefulSet( InitialDelaySeconds: 5, } - args := []string{"-c"} + args := []string{"-c", ServiceCommand} var probeCommand []string - // When debugging the service container will run kolla_set_configs and - // sleep forever and the probe container will just sleep forever. - if instance.Spec.Debug.Service { - args = append(args, common.DebugCommand) - livenessProbe.Exec = &corev1.ExecAction{ - Command: []string{ - "/bin/true", - }, - } - startupProbe.Exec = livenessProbe.Exec - probeCommand = []string{ - "/bin/sleep", "infinity", - } - } else { - args = append(args, ServiceCommand) - // Use the HTTP probe now that we have a simple server running - livenessProbe.HTTPGet = &corev1.HTTPGetAction{ - Port: intstr.FromInt(8080), - } - startupProbe.HTTPGet = livenessProbe.HTTPGet - probeCommand = []string{ - "/usr/local/bin/container-scripts/healthcheck.py", - "volume", - "/etc/cinder/cinder.conf.d", - } + // Use the HTTP probe now that we have a simple server running + livenessProbe.HTTPGet = &corev1.HTTPGetAction{ + Port: intstr.FromInt(8080), + } + startupProbe.HTTPGet = livenessProbe.HTTPGet + probeCommand = []string{ + "/usr/local/bin/container-scripts/healthcheck.py", + "volume", + "/etc/cinder/cinder.conf.d", } envVars := map[string]env.Setter{}