diff --git a/api/bases/octavia.openstack.org_octaviaamphoracontrollers.yaml b/api/bases/octavia.openstack.org_octaviaamphoracontrollers.yaml index 403b8ecd..2567b4ca 100644 --- a/api/bases/octavia.openstack.org_octaviaamphoracontrollers.yaml +++ b/api/bases/octavia.openstack.org_octaviaamphoracontrollers.yaml @@ -147,11 +147,6 @@ spec: description: PersistenceDatabaseAccount - name of MariaDBAccount which will be used to connect for the persistence database type: string - redisHostIPs: - description: List of Redis Host IP addresses - items: - type: string - type: array resources: description: Resources - Compute Resources required by this service (Limits/Requests). https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ diff --git a/api/bases/octavia.openstack.org_octavias.yaml b/api/bases/octavia.openstack.org_octavias.yaml index d58a95b9..8c3552af 100644 --- a/api/bases/octavia.openstack.org_octavias.yaml +++ b/api/bases/octavia.openstack.org_octavias.yaml @@ -599,11 +599,6 @@ spec: description: PersistenceDatabaseAccount - name of MariaDBAccount which will be used to connect for the persistence database type: string - redisHostIPs: - description: List of Redis Host IP addresses - items: - type: string - type: array resources: description: Resources - Compute Resources required by this service (Limits/Requests). https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ @@ -796,11 +791,6 @@ spec: description: PersistenceDatabaseAccount - name of MariaDBAccount which will be used to connect for the persistence database type: string - redisHostIPs: - description: List of Redis Host IP addresses - items: - type: string - type: array resources: description: Resources - Compute Resources required by this service (Limits/Requests). https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ @@ -993,11 +983,6 @@ spec: description: PersistenceDatabaseAccount - name of MariaDBAccount which will be used to connect for the persistence database type: string - redisHostIPs: - description: List of Redis Host IP addresses - items: - type: string - type: array resources: description: Resources - Compute Resources required by this service (Limits/Requests). https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ @@ -1274,11 +1259,6 @@ spec: ContainerImage) format: int64 type: integer - redisHostIPs: - description: List of Redis Host IP addresses - items: - type: string - type: array transportURLSecret: description: TransportURLSecret - Secret containing RabbitMQ transportURL type: string diff --git a/api/v1beta1/amphoracontroller_types.go b/api/v1beta1/amphoracontroller_types.go index 367948b5..416835c5 100644 --- a/api/v1beta1/amphoracontroller_types.go +++ b/api/v1beta1/amphoracontroller_types.go @@ -136,10 +136,6 @@ type OctaviaAmphoraControllerSpecCore struct { // AmphoraCustomFlavors - User-defined flavors for Octavia AmphoraCustomFlavors []OctaviaAmphoraFlavor `json:"amphoraCustomFlavors,omitempty"` - // +kubebuilder:validation:Optional - // +kubebuilder:default={} - // List of Redis Host IP addresses - RedisHostIPs []string `json:"redisHostIPs,omitempty"` // +operator-sdk:csv:customresourcedefinitions:type=spec // TLS - Parameters related to the TLS TLS tls.Ca `json:"tls,omitempty"` diff --git a/api/v1beta1/octavia_types.go b/api/v1beta1/octavia_types.go index 3a033d3e..37acc5b2 100644 --- a/api/v1beta1/octavia_types.go +++ b/api/v1beta1/octavia_types.go @@ -267,9 +267,6 @@ type OctaviaStatus struct { // ReadyCount of octavia HealthManager instances OctaviaHealthManagerReadyCount int32 `json:"healthmanagerreadyCount,omitempty"` - // List of Redis Host IP addresses - RedisHostIPs []string `json:"redisHostIPs,omitempty"` - // ObservedGeneration - the most recent generation observed for this // service. If the observed generation is less than the spec generation, // then the controller has not processed the latest changes injected by diff --git a/api/v1beta1/zz_generated.deepcopy.go b/api/v1beta1/zz_generated.deepcopy.go index 80525a4b..23f1ce52 100644 --- a/api/v1beta1/zz_generated.deepcopy.go +++ b/api/v1beta1/zz_generated.deepcopy.go @@ -342,11 +342,6 @@ func (in *OctaviaAmphoraControllerSpecCore) DeepCopyInto(out *OctaviaAmphoraCont *out = make([]OctaviaAmphoraFlavor, len(*in)) copy(*out, *in) } - if in.RedisHostIPs != nil { - in, out := &in.RedisHostIPs, &out.RedisHostIPs - *out = make([]string, len(*in)) - copy(*out, *in) - } out.TLS = in.TLS } @@ -593,11 +588,6 @@ func (in *OctaviaStatus) DeepCopyInto(out *OctaviaStatus) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - if in.RedisHostIPs != nil { - in, out := &in.RedisHostIPs, &out.RedisHostIPs - *out = make([]string, len(*in)) - copy(*out, *in) - } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OctaviaStatus. diff --git a/config/crd/bases/octavia.openstack.org_octaviaamphoracontrollers.yaml b/config/crd/bases/octavia.openstack.org_octaviaamphoracontrollers.yaml index 403b8ecd..2567b4ca 100644 --- a/config/crd/bases/octavia.openstack.org_octaviaamphoracontrollers.yaml +++ b/config/crd/bases/octavia.openstack.org_octaviaamphoracontrollers.yaml @@ -147,11 +147,6 @@ spec: description: PersistenceDatabaseAccount - name of MariaDBAccount which will be used to connect for the persistence database type: string - redisHostIPs: - description: List of Redis Host IP addresses - items: - type: string - type: array resources: description: Resources - Compute Resources required by this service (Limits/Requests). https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ diff --git a/config/crd/bases/octavia.openstack.org_octavias.yaml b/config/crd/bases/octavia.openstack.org_octavias.yaml index d58a95b9..8c3552af 100644 --- a/config/crd/bases/octavia.openstack.org_octavias.yaml +++ b/config/crd/bases/octavia.openstack.org_octavias.yaml @@ -599,11 +599,6 @@ spec: description: PersistenceDatabaseAccount - name of MariaDBAccount which will be used to connect for the persistence database type: string - redisHostIPs: - description: List of Redis Host IP addresses - items: - type: string - type: array resources: description: Resources - Compute Resources required by this service (Limits/Requests). https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ @@ -796,11 +791,6 @@ spec: description: PersistenceDatabaseAccount - name of MariaDBAccount which will be used to connect for the persistence database type: string - redisHostIPs: - description: List of Redis Host IP addresses - items: - type: string - type: array resources: description: Resources - Compute Resources required by this service (Limits/Requests). https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ @@ -993,11 +983,6 @@ spec: description: PersistenceDatabaseAccount - name of MariaDBAccount which will be used to connect for the persistence database type: string - redisHostIPs: - description: List of Redis Host IP addresses - items: - type: string - type: array resources: description: Resources - Compute Resources required by this service (Limits/Requests). https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ @@ -1274,11 +1259,6 @@ spec: ContainerImage) format: int64 type: integer - redisHostIPs: - description: List of Redis Host IP addresses - items: - type: string - type: array transportURLSecret: description: TransportURLSecret - Secret containing RabbitMQ transportURL type: string diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index 9926123b..a2d2a851 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -293,18 +293,6 @@ rules: - list - update - watch -- apiGroups: - - redis.openstack.org - resources: - - redises - verbs: - - create - - delete - - get - - list - - patch - - update - - watch - apiGroups: - route.openshift.io resources: diff --git a/controllers/amphoracontroller_controller.go b/controllers/amphoracontroller_controller.go index 2fe402fc..2567f63a 100644 --- a/controllers/amphoracontroller_controller.go +++ b/controllers/amphoracontroller_controller.go @@ -678,7 +678,6 @@ func (r *OctaviaAmphoraControllerReconciler) generateServiceConfigMaps( } // TODO(gthiemonge) store keys/passwords/passphrases in a specific config file stored in a secret templateParameters["HeartbeatKey"] = string(ospSecret.Data["OctaviaHeartbeatKey"]) - templateParameters["JobboardBackendHosts"] = strings.Join(spec.RedisHostIPs[:], ",") // TODO(beagles): populate the template parameters cms := []util.Template{ diff --git a/controllers/octavia_controller.go b/controllers/octavia_controller.go index 008af94d..1798c721 100644 --- a/controllers/octavia_controller.go +++ b/controllers/octavia_controller.go @@ -26,7 +26,6 @@ import ( "github.com/go-logr/logr" rabbitmqv1 "github.com/openstack-k8s-operators/infra-operator/apis/rabbitmq/v1beta1" - redisv1 "github.com/openstack-k8s-operators/infra-operator/apis/redis/v1beta1" "github.com/openstack-k8s-operators/lib-common/modules/common" "github.com/openstack-k8s-operators/lib-common/modules/common/condition" "github.com/openstack-k8s-operators/lib-common/modules/common/deployment" @@ -96,7 +95,6 @@ func (r *OctaviaReconciler) GetLogger(ctx context.Context) logr.Logger { // +kubebuilder:rbac:groups=keystone.openstack.org,resources=keystoneendpoints,verbs=get;list;watch;create;update;patch;delete; // +kubebuilder:rbac:groups=rabbitmq.openstack.org,resources=transporturls,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=k8s.cni.cncf.io,resources=network-attachment-definitions,verbs=get;list;watch -// +kubebuilder:rbac:groups=redis.openstack.org,resources=redises,verbs=get;list;watch;create;update;patch;delete // service account, role, rolebinding // +kubebuilder:rbac:groups="",resources=serviceaccounts,verbs=get;list;watch;create;update @@ -250,7 +248,6 @@ func (r *OctaviaReconciler) SetupWithManager(mgr ctrl.Manager) error { Owns(&rbacv1.RoleBinding{}). Owns(&corev1.Service{}). Owns(&rabbitmqv1.TransportURL{}). - Owns(&redisv1.Redis{}). Complete(r) } @@ -478,15 +475,6 @@ func (r *OctaviaReconciler) reconcileNormal(ctx context.Context, instance *octav return rbacResult, nil } - redis, op, err := r.redisCreateOrUpdate(ctx, instance, helper) - if err != nil { - // TODO(gthiemonge) Set conditions? - return ctrl.Result{}, err - } - if op != controllerutil.OperationResultNone { - Log.Info(fmt.Sprintf("Redis %s successfully reconciled - operation: %s", redis.Name, string(op))) - } - transportURL, op, err := r.transportURLCreateOrUpdate(instance) if err != nil { instance.Status.Conditions.Set(condition.FalseCondition( @@ -1230,54 +1218,6 @@ func (r *OctaviaReconciler) transportURLCreateOrUpdate( return transportURL, op, err } -func getRedisServiceIPs( - ctx context.Context, - instance *octaviav1.Octavia, - helper *helper.Helper, - redis *redisv1.Redis, -) ([]string, error) { - getOptions := metav1.GetOptions{} - service, err := helper.GetKClient().CoreV1().Services(instance.Namespace).Get(ctx, "redis", getOptions) - if err != nil { - return []string{}, err - } - // TODO Ensure that the correct port is exposed - return service.Spec.ClusterIPs, nil -} - -func (r *OctaviaReconciler) redisCreateOrUpdate( - ctx context.Context, - instance *octaviav1.Octavia, - helper *helper.Helper, -) (*redisv1.Redis, controllerutil.OperationResult, error) { - redis := &redisv1.Redis{ - // Use the "global" redis instance. - ObjectMeta: metav1.ObjectMeta{ - Name: "redis", - Namespace: instance.Namespace, - }, - } - - op, err := controllerutil.CreateOrUpdate(context.TODO(), r.Client, redis, func() error { - // We probably don't want to own the redis instance. - //err := controllerutil.SetControllerReference(instance, redis, r.Scheme) - //return err - return nil - }) - if err != nil { - return nil, op, err - } - - hostIPs, err := getRedisServiceIPs(ctx, instance, helper, redis) - if err != nil { - return redis, op, err - } - - instance.Status.RedisHostIPs = hostIPs - - return redis, op, err -} - func (r *OctaviaReconciler) amphoraControllerDaemonSetCreateOrUpdate( instance *octaviav1.Octavia, networkInfo octavia.NetworkProvisioningSummary, @@ -1307,7 +1247,6 @@ func (r *OctaviaReconciler) amphoraControllerDaemonSetCreateOrUpdate( daemonset.Spec.LbMgmtNetworkID = networkInfo.TenantNetworkID daemonset.Spec.LbSecurityGroupID = networkInfo.SecurityGroupID daemonset.Spec.AmphoraCustomFlavors = instance.Spec.AmphoraCustomFlavors - daemonset.Spec.RedisHostIPs = instance.Status.RedisHostIPs daemonset.Spec.TLS = instance.Spec.OctaviaAPI.TLS.Ca if len(daemonset.Spec.NodeSelector) == 0 { daemonset.Spec.NodeSelector = instance.Spec.NodeSelector diff --git a/main.go b/main.go index 58825ee0..032c741a 100644 --- a/main.go +++ b/main.go @@ -42,7 +42,6 @@ import ( networkv1 "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1" rabbitmqv1 "github.com/openstack-k8s-operators/infra-operator/apis/rabbitmq/v1beta1" - redisv1 "github.com/openstack-k8s-operators/infra-operator/apis/redis/v1beta1" keystonev1 "github.com/openstack-k8s-operators/keystone-operator/api/v1beta1" mariadbv1 "github.com/openstack-k8s-operators/mariadb-operator/api/v1beta1" ovn1beta1 "github.com/openstack-k8s-operators/ovn-operator/api/v1beta1" @@ -65,7 +64,6 @@ func init() { utilruntime.Must(octaviav1.AddToScheme(scheme)) utilruntime.Must(ovn1beta1.AddToScheme(scheme)) utilruntime.Must(networkv1.AddToScheme(scheme)) - utilruntime.Must(redisv1.AddToScheme(scheme)) //+kubebuilder:scaffold:scheme } diff --git a/templates/octavia/config/octavia.conf b/templates/octavia/config/octavia.conf index 99d20064..1a3b6df5 100644 --- a/templates/octavia/config/octavia.conf +++ b/templates/octavia/config/octavia.conf @@ -56,11 +56,7 @@ amp_boot_network_list= client_ca=/etc/octavia/certs/ca_01.pem [task_flow] persistence_connection = {{ .PersistenceDatabaseConnection }} -jobboard_enabled = True -#jobboard_backend_hosts = -#jobboard_backend_port = 26379 -#jobboard_backend_password = "" -#jobboard_redis_sentinel = redis +jobboard_enabled = False [oslo_messaging] # topic=octavia-rpc [oslo_middleware] diff --git a/templates/octaviaamphoracontroller/config/octavia.conf b/templates/octaviaamphoracontroller/config/octavia.conf index b7435946..6fdce9a6 100644 --- a/templates/octaviaamphoracontroller/config/octavia.conf +++ b/templates/octaviaamphoracontroller/config/octavia.conf @@ -44,12 +44,7 @@ amp_ssh_key_name={{ .NovaSshKeyPair }} client_ca = /etc/octavia/certs/client_ca.cert.pem [task_flow] persistence_connection = {{ .PersistenceDatabaseConnection }} -jobboard_enabled = True -jobboard_backend_hosts = {{ .JobboardBackendHosts }} -# TODO(gthiemonge) enable sentinel when it is exposed in the redis service. -#jobboard_backend_port = 26379 -#jobboard_backend_password = "" -#jobboard_redis_sentinel = redis +jobboard_enabled = False [oslo_messaging] topic=octavia-rpc [oslo_middleware]