From 00ff6ce55cc08f551b3389ac7561d6cdabf45a41 Mon Sep 17 00:00:00 2001 From: Jiri Podivin Date: Thu, 25 Jan 2024 16:21:43 +0100 Subject: [PATCH] Adding option to deploy service across nodesets Dataplane operator can now override the playbook target to 'all'. diverse scenarios across hosts. Services can be marked as global and deployed on all node sets Services can hold multiple inventory secrets. Kuttle and functional tests were expanded to new functionality. Signed-off-by: Jiri Podivin --- ...nstack.org_openstackdataplaneservices.yaml | 2 + .../openstackdataplaneservice_types.go | 5 + api/v1beta1/zz_generated.deepcopy.go | 5 + ...nstack.org_openstackdataplaneservices.yaml | 2 + ...openstackdataplanedeployment_controller.go | 31 +- docs/assemblies/custom_resources.adoc | 5 + pkg/deployment/deployment.go | 15 +- pkg/deployment/inventory.go | 2 + pkg/deployment/service.go | 7 +- pkg/util/ansible_execution.go | 122 +- tests/functional/base_test.go | 27 +- ...enstackdataplanenodeset_controller_test.go | 132 +++ tests/functional/service_test.go | 19 +- .../00-assert.yaml | 114 ++ .../00-dataplane-create.yaml | 169 +++ .../01-assert.yaml | 1004 +++++++++++++++++ .../01-dataplane-deploy.yaml | 8 + 17 files changed, 1607 insertions(+), 62 deletions(-) create mode 100644 tests/kuttl/tests/dataplane-deploy-global-service-test/00-assert.yaml create mode 100644 tests/kuttl/tests/dataplane-deploy-global-service-test/00-dataplane-create.yaml create mode 100644 tests/kuttl/tests/dataplane-deploy-global-service-test/01-assert.yaml create mode 100644 tests/kuttl/tests/dataplane-deploy-global-service-test/01-dataplane-deploy.yaml diff --git a/api/bases/dataplane.openstack.org_openstackdataplaneservices.yaml b/api/bases/dataplane.openstack.org_openstackdataplaneservices.yaml index 1034920b3..89e87e077 100644 --- a/api/bases/dataplane.openstack.org_openstackdataplaneservices.yaml +++ b/api/bases/dataplane.openstack.org_openstackdataplaneservices.yaml @@ -40,6 +40,8 @@ spec: items: type: string type: array + deployOnAllNodeSets: + type: boolean openStackAnsibleEERunnerImage: type: string play: diff --git a/api/v1beta1/openstackdataplaneservice_types.go b/api/v1beta1/openstackdataplaneservice_types.go index 9792b3fe1..16d50145e 100644 --- a/api/v1beta1/openstackdataplaneservice_types.go +++ b/api/v1beta1/openstackdataplaneservice_types.go @@ -73,6 +73,11 @@ type OpenStackDataPlaneServiceSpec struct { // +kubebuilder:default=false // +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:booleanSwitch"} AddCertMounts bool `json:"addCertMounts" yaml:"addCertMounts"` + + // DeployOnAllNodeSets - should the service be deploy across all nodesets + // This will override default target of a service play, setting it to 'all'. + // +kubebuilder:validation:Optional + DeployOnAllNodeSets *bool `json:"deployOnAllNodeSets,omitempty" yaml:"deployOnAllNodeSets,omitempty"` } // OpenStackDataPlaneServiceStatus defines the observed state of OpenStackDataPlaneService diff --git a/api/v1beta1/zz_generated.deepcopy.go b/api/v1beta1/zz_generated.deepcopy.go index e2ed53be1..194277b09 100644 --- a/api/v1beta1/zz_generated.deepcopy.go +++ b/api/v1beta1/zz_generated.deepcopy.go @@ -635,6 +635,11 @@ func (in *OpenStackDataPlaneServiceSpec) DeepCopyInto(out *OpenStackDataPlaneSer *out = new(OpenstackDataPlaneServiceCert) (*in).DeepCopyInto(*out) } + if in.DeployOnAllNodeSets != nil { + in, out := &in.DeployOnAllNodeSets, &out.DeployOnAllNodeSets + *out = new(bool) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackDataPlaneServiceSpec. diff --git a/config/crd/bases/dataplane.openstack.org_openstackdataplaneservices.yaml b/config/crd/bases/dataplane.openstack.org_openstackdataplaneservices.yaml index 1034920b3..89e87e077 100644 --- a/config/crd/bases/dataplane.openstack.org_openstackdataplaneservices.yaml +++ b/config/crd/bases/dataplane.openstack.org_openstackdataplaneservices.yaml @@ -40,6 +40,8 @@ spec: items: type: string type: array + deployOnAllNodeSets: + type: boolean openStackAnsibleEERunnerImage: type: string play: diff --git a/controllers/openstackdataplanedeployment_controller.go b/controllers/openstackdataplanedeployment_controller.go index 045c2bdd3..6698a0998 100644 --- a/controllers/openstackdataplanedeployment_controller.go +++ b/controllers/openstackdataplanedeployment_controller.go @@ -213,13 +213,23 @@ func (r *OpenStackDataPlaneDeploymentReconciler) Reconcile(ctx context.Context, // All nodeSets successfully fetched. // Mark InputReadyCondition=True instance.Status.Conditions.MarkTrue(condition.InputReadyCondition, condition.ReadyMessage) + shouldRequeue := false + haveError := false + + globalInventorySecrets := []string{} + globalSSHKeySecrets := map[string]string{} + + // Gathering individual inventory and ssh secrets for later use + for _, nodeSet := range nodeSets.Items { + // Add inventory secret to list of inventories for global services + globalInventorySecrets = append(globalInventorySecrets, fmt.Sprintf("dataplanenodeset-%s", nodeSet.Name)) + globalSSHKeySecrets[nodeSet.Name] = nodeSet.Spec.NodeTemplate.AnsibleSSHPrivateKeySecret + } // Deploy each nodeSet // The loop starts and checks NodeSet deployments sequentially. However, after they // are started, they are running in parallel, since the loop does not wait // for the first started NodeSet to finish before starting the next. - shouldRequeue := false - haveError := false for _, nodeSet := range nodeSets.Items { Log.Info(fmt.Sprintf("Deploying NodeSet: %s", nodeSet.Name)) @@ -235,8 +245,6 @@ func (r *OpenStackDataPlaneDeploymentReconciler) Reconcile(ctx context.Context, ansibleEESpec.AnsibleLimit = instance.Spec.AnsibleLimit ansibleEESpec.ExtraVars = instance.Spec.AnsibleExtraVars - nodeSetSecretInv := fmt.Sprintf("dataplanenodeset-%s", nodeSet.Name) - if nodeSet.Status.DNSClusterAddresses != nil && nodeSet.Status.CtlplaneSearchDomain != "" { ansibleEESpec.DNSConfig = &corev1.PodDNSConfig{ Nameservers: nodeSet.Status.DNSClusterAddresses, @@ -245,13 +253,14 @@ func (r *OpenStackDataPlaneDeploymentReconciler) Reconcile(ctx context.Context, } deployer := deployment.Deployer{ - Ctx: ctx, - Helper: helper, - NodeSet: &nodeSet, - Deployment: instance, - Status: &instance.Status, - AeeSpec: &ansibleEESpec, - InventorySecret: nodeSetSecretInv, + Ctx: ctx, + Helper: helper, + NodeSet: &nodeSet, + Deployment: instance, + Status: &instance.Status, + AeeSpec: &ansibleEESpec, + InventorySecrets: globalInventorySecrets, + AnsibleSSHPrivateKeySecrets: globalSSHKeySecrets, } // When ServicesOverride is set on the OpenStackDataPlaneDeployment, diff --git a/docs/assemblies/custom_resources.adoc b/docs/assemblies/custom_resources.adoc index f5c1befa3..bbab53635 100644 --- a/docs/assemblies/custom_resources.adoc +++ b/docs/assemblies/custom_resources.adoc @@ -297,6 +297,11 @@ OpenStackDataPlaneServiceSpec defines the desired state of OpenStackDataPlaneSer | AddCertMounts - Whether to add cert mounts | bool | true + +| deployOnAllNodeSets +| DeployOnAllNodeSets - should the service be deploy across all nodesets This will override default target of a service play, setting it to 'all'. +| *bool +| false |=== <> diff --git a/pkg/deployment/deployment.go b/pkg/deployment/deployment.go index 2b3dcf814..67572ebde 100644 --- a/pkg/deployment/deployment.go +++ b/pkg/deployment/deployment.go @@ -39,13 +39,14 @@ import ( // Deployer defines a data structure with all of the relevant objects required for a full deployment. type Deployer struct { - Ctx context.Context - Helper *helper.Helper - NodeSet *dataplanev1.OpenStackDataPlaneNodeSet - Deployment *dataplanev1.OpenStackDataPlaneDeployment - Status *dataplanev1.OpenStackDataPlaneDeploymentStatus - AeeSpec *dataplanev1.AnsibleEESpec - InventorySecret string + Ctx context.Context + Helper *helper.Helper + NodeSet *dataplanev1.OpenStackDataPlaneNodeSet + Deployment *dataplanev1.OpenStackDataPlaneDeployment + Status *dataplanev1.OpenStackDataPlaneDeploymentStatus + AeeSpec *dataplanev1.AnsibleEESpec + InventorySecrets []string + AnsibleSSHPrivateKeySecrets map[string]string } // Deploy function encapsulating primary deloyment handling diff --git a/pkg/deployment/inventory.go b/pkg/deployment/inventory.go index 4baae31a3..7028bf8cc 100644 --- a/pkg/deployment/inventory.go +++ b/pkg/deployment/inventory.go @@ -54,6 +54,8 @@ func GenerateNodeSetInventory(ctx context.Context, helper *helper.Helper, nodeSetGroup.Vars["role_tags"] = instance.Spec.Tags } + nodeSetGroup.Vars["ansible_ssh_private_key_file"] = fmt.Sprintf("/runner/env/ssh_key/ssh_key_%s", instance.Name) + for _, node := range instance.Spec.Nodes { host := nodeSetGroup.AddHost(strings.Split(node.HostName, ".")[0]) // Use ansible_host if provided else use hostname. Fall back to diff --git a/pkg/deployment/service.go b/pkg/deployment/service.go index d9dafaf0b..cdeaffd99 100644 --- a/pkg/deployment/service.go +++ b/pkg/deployment/service.go @@ -48,9 +48,10 @@ func (d *Deployer) DeployService(foundService dataplanev1.OpenStackDataPlaneServ d.Helper, d.Deployment, &foundService, - d.NodeSet.Spec.NodeTemplate.AnsibleSSHPrivateKeySecret, - d.InventorySecret, - d.AeeSpec) + d.AnsibleSSHPrivateKeySecrets, + d.InventorySecrets, + d.AeeSpec, + d.NodeSet.Name) if err != nil { d.Helper.GetLogger().Error(err, fmt.Sprintf("Unable to execute Ansible for %s", foundService.Name)) diff --git a/pkg/util/ansible_execution.go b/pkg/util/ansible_execution.go index ac1027bc5..a4a33c470 100644 --- a/pkg/util/ansible_execution.go +++ b/pkg/util/ansible_execution.go @@ -18,6 +18,7 @@ package util import ( "context" + "encoding/json" "fmt" "strings" @@ -41,12 +42,21 @@ func AnsibleExecution( helper *helper.Helper, obj client.Object, service *dataplanev1.OpenStackDataPlaneService, - sshKeySecret string, - inventorySecret string, + sshKeySecrets map[string]string, + inventorySecrets []string, aeeSpec *dataplanev1.AnsibleEESpec, + targetNodeset string, ) error { var err error var cmdLineArguments strings.Builder + var inventoryVolume corev1.Volume + var inventoryName string + var inventoryMountPath string + var sshKeyName string + var sshKeyMountPath string + var sshKeyMountSubPath string + + ansibleEEMounts := storage.VolMounts{} ansibleEE, err := GetAnsibleExecution(ctx, helper, obj, service.Name) if err != nil && !k8serrors.IsNotFound(err) { @@ -98,51 +108,87 @@ func AnsibleExecution( ansibleEE.Spec.Playbook = service.Spec.Playbook } - ansibleEEMounts := storage.VolMounts{} - sshKeyVolume := corev1.Volume{ - Name: "ssh-key", - VolumeSource: corev1.VolumeSource{ - Secret: &corev1.SecretVolumeSource{ - SecretName: sshKeySecret, - Items: []corev1.KeyToPath{ - { - Key: "ssh-privatekey", - Path: "ssh_key", + // If we have a service that ought to be deployed everywhere + // substitute the existing play target with 'all' + // Check if we have ExtraVars before accessing it + if ansibleEE.Spec.ExtraVars == nil { + ansibleEE.Spec.ExtraVars = make(map[string]json.RawMessage) + } + if service.Spec.DeployOnAllNodeSets != nil && *service.Spec.DeployOnAllNodeSets { + ansibleEE.Spec.ExtraVars["edpm_override_hosts"] = json.RawMessage([]byte("\"all\"")) + util.LogForObject(helper, fmt.Sprintf("for service %s, substituting existing ansible play host with 'all'.", service.Name), ansibleEE) + } else { + ansibleEE.Spec.ExtraVars["edpm_override_hosts"] = json.RawMessage([]byte(fmt.Sprintf("\"%s\"", targetNodeset))) + util.LogForObject(helper, fmt.Sprintf("for service %s, substituting existing ansible play host with 'all'.", service.Name), ansibleEE) + } + + for sshKeyNodeName, sshKeySecret := range sshKeySecrets { + if service.Spec.DeployOnAllNodeSets != nil && *service.Spec.DeployOnAllNodeSets { + sshKeyName = fmt.Sprintf("ssh-key-%s", sshKeyNodeName) + sshKeyMountSubPath = fmt.Sprintf("ssh_key_%s", targetNodeset) + sshKeyMountPath = fmt.Sprintf("/runner/env/ssh_key/%s", sshKeyMountSubPath) + } else { + sshKeyName = "ssh-key" + sshKeyMountSubPath = "ssh_key" + sshKeyMountPath = "/runner/env/ssh_key" + } + sshKeyVolume := corev1.Volume{ + Name: sshKeyName, + VolumeSource: corev1.VolumeSource{ + Secret: &corev1.SecretVolumeSource{ + SecretName: sshKeySecret, + Items: []corev1.KeyToPath{ + { + Key: "ssh-privatekey", + Path: sshKeyMountSubPath, + }, }, }, }, - }, - } - sshKeyMount := corev1.VolumeMount{ - Name: "ssh-key", - MountPath: "/runner/env/ssh_key", - SubPath: "ssh_key", + } + sshKeyMount := corev1.VolumeMount{ + Name: sshKeyName, + MountPath: sshKeyMountPath, + SubPath: sshKeyMountSubPath, + } + // Mount ssh secrets + ansibleEEMounts.Mounts = append(ansibleEEMounts.Mounts, sshKeyMount) + ansibleEEMounts.Volumes = append(ansibleEEMounts.Volumes, sshKeyVolume) } - inventoryVolume := corev1.Volume{ - Name: "inventory", - VolumeSource: corev1.VolumeSource{ - Secret: &corev1.SecretVolumeSource{ - SecretName: inventorySecret, - Items: []corev1.KeyToPath{ - { - Key: "inventory", - Path: "inventory", + // Mounting inventory and secrets + for inventoryIndex, inventorySecret := range inventorySecrets { + if service.Spec.DeployOnAllNodeSets != nil && *service.Spec.DeployOnAllNodeSets { + inventoryName = fmt.Sprintf("inventory-%d", inventoryIndex) + inventoryMountPath = fmt.Sprintf("/runner/inventory/%s", inventoryName) + } else { + inventoryName = "inventory" + inventoryMountPath = "/runner/inventory/hosts" + } + + inventoryVolume = corev1.Volume{ + Name: inventoryName, + VolumeSource: corev1.VolumeSource{ + Secret: &corev1.SecretVolumeSource{ + SecretName: inventorySecret, + Items: []corev1.KeyToPath{ + { + Key: inventoryName, + Path: inventoryName, + }, }, }, }, - }, + } + inventoryMount := corev1.VolumeMount{ + Name: inventoryName, + MountPath: inventoryMountPath, + SubPath: inventoryName, + } + // Inventory mount + ansibleEEMounts.Mounts = append(ansibleEEMounts.Mounts, inventoryMount) + ansibleEEMounts.Volumes = append(ansibleEEMounts.Volumes, inventoryVolume) } - inventoryMount := corev1.VolumeMount{ - Name: "inventory", - MountPath: "/runner/inventory/hosts", - SubPath: "inventory", - } - - ansibleEEMounts.Volumes = append(ansibleEEMounts.Volumes, sshKeyVolume) - ansibleEEMounts.Volumes = append(ansibleEEMounts.Volumes, inventoryVolume) - ansibleEEMounts.Mounts = append(ansibleEEMounts.Mounts, sshKeyMount) - ansibleEEMounts.Mounts = append(ansibleEEMounts.Mounts, inventoryMount) ansibleEE.Spec.ExtraMounts = append(aeeSpec.ExtraMounts, []storage.VolMounts{ansibleEEMounts}...) ansibleEE.Spec.Env = aeeSpec.Env diff --git a/tests/functional/base_test.go b/tests/functional/base_test.go index c16deb156..1e78ed636 100644 --- a/tests/functional/base_test.go +++ b/tests/functional/base_test.go @@ -41,8 +41,13 @@ func CreateDataplaneDeployment(name types.NamespacedName, spec map[string]interf } // Create an OpenStackDataPlaneService with a given NamespacedName, assert on success -func CreateDataplaneService(name types.NamespacedName) *unstructured.Unstructured { - raw := DefaultDataplaneService(name) +func CreateDataplaneService(name types.NamespacedName, globalService bool) *unstructured.Unstructured { + var raw map[string]interface{} + if globalService { + raw = DefaultDataplaneGlobalService(name) + } else { + raw = DefaultDataplaneService(name) + } return th.CreateUnstructured(raw) } @@ -241,6 +246,24 @@ func DefaultDataplaneService(name types.NamespacedName) map[string]interface{} { }} } +// Create an empty OpenStackDataPlaneService struct +// containing only given NamespacedName as metadata +func DefaultDataplaneGlobalService(name types.NamespacedName) map[string]interface{} { + + return map[string]interface{}{ + + "apiVersion": "dataplane.openstack.org/v1beta1", + "kind": "OpenStackDataPlaneService", + "metadata": map[string]interface{}{ + "name": name.Name, + "namespace": name.Namespace, + }, + "spec": map[string]interface{}{ + "deployOnAllNodeSets": true, + }, + } +} + // Get resources // Retrieve OpenStackDataPlaneDeployment and check for errors diff --git a/tests/functional/openstackdataplanenodeset_controller_test.go b/tests/functional/openstackdataplanenodeset_controller_test.go index 42006baab..6b0ce8e19 100644 --- a/tests/functional/openstackdataplanenodeset_controller_test.go +++ b/tests/functional/openstackdataplanenodeset_controller_test.go @@ -208,7 +208,139 @@ var _ = Describe("Dataplane NodeSet Test", func() { th.AssertSecretDoesNotExist(dataplaneSecretName) }) }) + When("A Dataplane resorce is created with PreProvisioned nodes, no deployment and global service", func() { + BeforeEach(func() { + nodeSetSpec := DefaultDataPlaneNoNodeSetSpec() + nodeSetSpec["services"] = []string{ + "download-cache", + "bootstrap", + "configure-network", + "validate-network", + "install-os", + "configure-os", + "run-os", + "reboot-os", + "install-certs", + "ovn", + "neutron-metadata", + "libvirt", + "nova", + "telemetry", + "global-service"} + + dataplaneAllNodeSetServiceName := types.NamespacedName{ + Name: "global-service", + Namespace: namespace, + } + CreateDataplaneService(dataplaneAllNodeSetServiceName, true) + DeferCleanup(th.DeleteService, dataplaneAllNodeSetServiceName) + DeferCleanup(th.DeleteInstance, CreateDataplaneNodeSet(dataplaneNodeSetName, nodeSetSpec)) + }) + It("should have the Spec fields initialized", func() { + dataplaneNodeSetInstance := GetDataplaneNodeSet(dataplaneNodeSetName) + emptyNodeSpec := dataplanev1.OpenStackDataPlaneNodeSetSpec{ + BaremetalSetTemplate: baremetalv1.OpenStackBaremetalSetSpec{ + BaremetalHosts: nil, + OSImage: "", + UserData: nil, + NetworkData: nil, + AutomatedCleaningMode: "metadata", + ProvisionServerName: "", + ProvisioningInterface: "", + DeploymentSSHSecret: "dataplane-ansible-ssh-private-key-secret", + CtlplaneInterface: "", + CtlplaneGateway: "", + CtlplaneNetmask: "255.255.255.0", + BmhNamespace: "openshift-machine-api", + HardwareReqs: baremetalv1.HardwareReqs{ + CPUReqs: baremetalv1.CPUReqs{ + Arch: "", + CountReq: baremetalv1.CPUCountReq{Count: 0, ExactMatch: false}, + MhzReq: baremetalv1.CPUMhzReq{Mhz: 0, ExactMatch: false}, + }, + MemReqs: baremetalv1.MemReqs{ + GbReq: baremetalv1.MemGbReq{Gb: 0, ExactMatch: false}, + }, + DiskReqs: baremetalv1.DiskReqs{ + GbReq: baremetalv1.DiskGbReq{Gb: 0, ExactMatch: false}, + SSDReq: baremetalv1.DiskSSDReq{SSD: false, ExactMatch: false}, + }, + }, + PasswordSecret: nil, + CloudUserName: "", + DomainName: "", + BootstrapDNS: nil, + DNSSearchDomains: nil, + }, + NodeTemplate: dataplanev1.NodeTemplate{ + AnsibleSSHPrivateKeySecret: "dataplane-ansible-ssh-private-key-secret", + Networks: nil, + ManagementNetwork: "ctlplane", + Ansible: dataplanev1.AnsibleOpts{ + AnsibleUser: "cloud-admin", + AnsibleHost: "", + AnsiblePort: 0, + AnsibleVars: nil, + }, + ExtraMounts: nil, + UserData: nil, + NetworkData: nil, + }, + Env: nil, + PreProvisioned: true, + NetworkAttachments: nil, + TLSEnabled: false, + Nodes: map[string]dataplanev1.NodeSection{}, + Services: []string{ + "download-cache", + "bootstrap", + "configure-network", + "validate-network", + "install-os", + "configure-os", + "run-os", + "reboot-os", + "install-certs", + "ovn", + "neutron-metadata", + "libvirt", + "nova", + "telemetry", + "global-service"}, + } + Expect(dataplaneNodeSetInstance.Spec).Should(Equal(emptyNodeSpec)) + }) + It("should have the Status fields initialized", func() { + dataplaneNodeSetInstance := GetDataplaneNodeSet(dataplaneNodeSetName) + Expect(dataplaneNodeSetInstance.Status.Deployed).Should(BeFalse()) + }) + + It("should have input not ready and unknown Conditions initialized", func() { + th.ExpectCondition( + dataplaneNodeSetName, + ConditionGetterFunc(DataplaneConditionGetter), + condition.ReadyCondition, + corev1.ConditionFalse, + ) + th.ExpectCondition( + dataplaneNodeSetName, + ConditionGetterFunc(DataplaneConditionGetter), + condition.InputReadyCondition, + corev1.ConditionFalse, + ) + th.ExpectCondition( + dataplaneNodeSetName, + ConditionGetterFunc(DataplaneConditionGetter), + dataplanev1.SetupReadyCondition, + corev1.ConditionFalse, + ) + }) + + It("Should not have created a Secret", func() { + th.AssertSecretDoesNotExist(dataplaneSecretName) + }) + }) When("A Dataplane resorce is created without PreProvisioned nodes and ordered deployment", func() { BeforeEach(func() { spec := DefaultDataPlaneNoNodeSetSpec() diff --git a/tests/functional/service_test.go b/tests/functional/service_test.go index 1f6226e4f..e9df47b18 100644 --- a/tests/functional/service_test.go +++ b/tests/functional/service_test.go @@ -35,7 +35,7 @@ var _ = Describe("OpenstackDataplaneService Test", func() { When("A defined service resource is created", func() { BeforeEach(func() { os.Unsetenv("OPERATOR_SERVICES") - CreateDataplaneService(dataplaneServiceName) + CreateDataplaneService(dataplaneServiceName, false) DeferCleanup(th.DeleteService, dataplaneServiceName) }) @@ -44,6 +44,23 @@ var _ = Describe("OpenstackDataplaneService Test", func() { Expect(service.Spec.Secrets).To(BeEmpty()) Expect(service.Spec.Playbook).To(BeEmpty()) Expect(service.Spec.ConfigMaps).To(BeEmpty()) + Expect(service.Spec.DeployOnAllNodeSets).To(BeNil()) + }) + }) + + When("A defined service resource for all nodes is created", func() { + BeforeEach(func() { + os.Unsetenv("OPERATOR_SERVICES") + CreateDataplaneService(dataplaneServiceName, true) + DeferCleanup(th.DeleteService, dataplaneServiceName) + }) + + It("spec fields are set up", func() { + service := GetService(dataplaneServiceName) + Expect(service.Spec.Secrets).To(BeEmpty()) + Expect(service.Spec.Playbook).To(BeEmpty()) + Expect(service.Spec.ConfigMaps).To(BeEmpty()) + Expect(*service.Spec.DeployOnAllNodeSets).To(BeTrue()) }) }) }) diff --git a/tests/kuttl/tests/dataplane-deploy-global-service-test/00-assert.yaml b/tests/kuttl/tests/dataplane-deploy-global-service-test/00-assert.yaml new file mode 100644 index 000000000..c2bcf943f --- /dev/null +++ b/tests/kuttl/tests/dataplane-deploy-global-service-test/00-assert.yaml @@ -0,0 +1,114 @@ +apiVersion: dataplane.openstack.org/v1beta1 +kind: OpenStackDataPlaneNodeSet +metadata: + name: edpm-compute-global-service + namespace: openstack +spec: + preProvisioned: true + services: + - download-cache + - bootstrap + - configure-network + - validate-network + - install-os + - configure-os + - run-os + - install-certs + - ovn + - neutron-metadata + - neutron-ovn + - neutron-sriov + - neutron-dhcp + - libvirt + - nova + - custom-global-service + tlsEnabled: false + env: + - name: ANSIBLE_FORCE_COLOR + value: "True" + nodes: {} + nodeTemplate: + ansibleSSHPrivateKeySecret: dataplane-ansible-ssh-private-key-secret + managementNetwork: ctlplane + ansible: + ansibleUser: cloud-admin + ansiblePort: 22 + ansibleVars: + service_net_map: + nova_api_network: internalapi + nova_libvirt_network: internalapi + timesync_ntp_servers: + - hostname: clock.redhat.com + # edpm_network_config + # Default nic config template for a EDPM compute node + # These vars are edpm_network_config role vars + edpm_network_config_hide_sensitive_logs: false + edpm_network_config_template: templates/single_nic_vlans/single_nic_vlans.j2 + # These vars are for the network config templates themselves and are + # considered EDPM network defaults. + neutron_physical_bridge_name: br-ex + neutron_public_interface_name: eth0 + ctlplane_mtu: 1500 + ctlplane_cidr: 24 + ctlplane_gateway_ip: 192.168.122.1 + ctlplane_host_routes: + - ip_netmask: 0.0.0.0/0 + next_hop: 192.168.122.1 + external_mtu: 1500 + external_vlan_id: 44 + external_cidr: '24' + external_host_routes: [] + internalapi_mtu: 1500 + internalapi_vlan_id: 20 + internalapi_cidr: '24' + internalapi_host_routes: [] + storage_mtu: 1500 + storage_vlan_id: 21 + storage_cidr: '24' + storage_host_routes: [] + tenant_mtu: 1500 + tenant_vlan_id: 22 + tenant_cidr: '24' + tenant_host_routes: [] + role_networks: + - InternalApi + - Storage + - Tenant + networks_lower: + External: external + InternalApi: internalapi + Storage: storage + Tenant: tenant + # edpm_nodes_validation + edpm_nodes_validation_validate_controllers_icmp: false + edpm_nodes_validation_validate_gateway_icmp: false + ctlplane_dns_nameservers: + - 192.168.122.1 + dns_search_domains: [] + gather_facts: false + enable_debug: false + # edpm firewall, change the allowed CIDR if needed + edpm_sshd_configure_firewall: true + edpm_sshd_allowed_ranges: ['192.168.122.0/24'] + # SELinux module + edpm_selinux_mode: enforcing +status: + conditions: + - message: Deployment not started + reason: Requested + severity: Info + status: "False" + type: Ready + - message: Deployment not started + reason: Requested + severity: Info + status: "False" + type: DeploymentReady + - message: Input data complete + reason: Ready + status: "True" + type: InputReady + - message: Setup complete + reason: Ready + status: "True" + type: SetupReady diff --git a/tests/kuttl/tests/dataplane-deploy-global-service-test/00-dataplane-create.yaml b/tests/kuttl/tests/dataplane-deploy-global-service-test/00-dataplane-create.yaml new file mode 100644 index 000000000..2a05369e8 --- /dev/null +++ b/tests/kuttl/tests/dataplane-deploy-global-service-test/00-dataplane-create.yaml @@ -0,0 +1,169 @@ +apiVersion: v1 +kind: Secret +metadata: + name: nova-cell1-compute-config +data: + nova-blank.conf: Zm9vCg== + 01-nova.conf: Zm9vCg== +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: ovncontroller-config +data: + ovsdb-config: test-ovn-config +--- +apiVersion: v1 +kind: Secret +metadata: + name: neutron-ovn-metadata-agent-neutron-config +data: + 10-neutron-metadata.conf: dGVzdC1uZXV0cm9uLW92bi1tZXRhZGF0YS1hZ2VudC1jb25maWc= +--- +apiVersion: v1 +kind: Secret +metadata: + name: nova-metadata-neutron-config +data: + 05-nova-metadata.conf: dGVzdC1ub3ZhLW1ldGFkYXRhLWNvbXB1dGUtY29uZmln + httpd.conf: dGVzdC1ub3ZhLW1ldGFkYXRhLWNvbXB1dGUtY29uZmln + nova-metadata-config.json: dGVzdC1ub3ZhLW1ldGFkYXRhLWNvbXB1dGUtY29uZmln +--- +apiVersion: v1 +kind: Secret +metadata: + name: neutron-ovn-agent-neutron-config +data: + 10-neutron-ovn.conf: dGVzdC1uZXV0cm9uLW92bi1hZ2VudC1jb25maWc= +--- +--- +apiVersion: v1 +kind: Secret +metadata: + name: neutron-sriov-agent-neutron-config +data: + 10-neutron-sriov.conf: dGVzdC1uZXV0cm9uLXNyaW92LWFnZW50LXNlY3JldC1jb25maWcK +--- +apiVersion: v1 +kind: Secret +metadata: + name: neutron-dhcp-agent-neutron-config +data: + 10-neutron-dhcp.conf: dGVzdC1uZXV0cm9uLWRoY3AtYWdlbnQtc2VjcmV0LWNvbmZpZwo= +--- +apiVersion: v1 +kind: Secret +metadata: + name: nova-migration-ssh-key +data: + ssh-privatekey: ZmFrZQo= + ssh-publickey: ZmFrZQo= +--- +apiVersion: dataplane.openstack.org/v1beta1 +kind: OpenStackDataPlaneService +metadata: + name: custom-global-service +spec: + label: custom-global-service + play: | + - hosts: localhost + gather_facts: no + name: global kuttl play + tasks: + - name: Sleep + command: sleep 1 + delegate_to: localhost + deployOnAllNodeSets: true +--- +apiVersion: dataplane.openstack.org/v1beta1 +kind: OpenStackDataPlaneNodeSet +metadata: + name: edpm-compute-global-service +spec: + preProvisioned: true + services: + - download-cache + - bootstrap + - configure-network + - validate-network + - install-os + - configure-os + - run-os + - install-certs + - ovn + - neutron-metadata + - neutron-ovn + - neutron-sriov + - neutron-dhcp + - libvirt + - nova + - custom-global-service + env: + - name: ANSIBLE_FORCE_COLOR + value: "True" + nodes: {} + nodeTemplate: + ansibleSSHPrivateKeySecret: dataplane-ansible-ssh-private-key-secret + managementNetwork: ctlplane + ansible: + ansibleUser: cloud-admin + ansiblePort: 22 + ansibleVars: + service_net_map: + nova_api_network: internalapi + nova_libvirt_network: internalapi + timesync_ntp_servers: + - hostname: clock.redhat.com + # edpm_network_config + # Default nic config template for a EDPM compute node + # These vars are edpm_network_config role vars + edpm_network_config_hide_sensitive_logs: false + edpm_network_config_template: templates/single_nic_vlans/single_nic_vlans.j2 + # These vars are for the network config templates themselves and are + # considered EDPM network defaults. + neutron_physical_bridge_name: br-ex + neutron_public_interface_name: eth0 + ctlplane_mtu: 1500 + ctlplane_cidr: 24 + ctlplane_gateway_ip: 192.168.122.1 + ctlplane_host_routes: + - ip_netmask: 0.0.0.0/0 + next_hop: 192.168.122.1 + external_mtu: 1500 + external_vlan_id: 44 + external_cidr: '24' + external_host_routes: [] + internalapi_mtu: 1500 + internalapi_vlan_id: 20 + internalapi_cidr: '24' + internalapi_host_routes: [] + storage_mtu: 1500 + storage_vlan_id: 21 + storage_cidr: '24' + storage_host_routes: [] + tenant_mtu: 1500 + tenant_vlan_id: 22 + tenant_cidr: '24' + tenant_host_routes: [] + role_networks: + - InternalApi + - Storage + - Tenant + networks_lower: + External: external + InternalApi: internalapi + Storage: storage + Tenant: tenant + # edpm_nodes_validation + edpm_nodes_validation_validate_controllers_icmp: false + edpm_nodes_validation_validate_gateway_icmp: false + ctlplane_dns_nameservers: + - 192.168.122.1 + dns_search_domains: [] + gather_facts: false + enable_debug: false + # edpm firewall, change the allowed CIDR if needed + edpm_sshd_configure_firewall: true + edpm_sshd_allowed_ranges: ['192.168.122.0/24'] + # SELinux module + edpm_selinux_mode: enforcing diff --git a/tests/kuttl/tests/dataplane-deploy-global-service-test/01-assert.yaml b/tests/kuttl/tests/dataplane-deploy-global-service-test/01-assert.yaml new file mode 100644 index 000000000..de9a86fb6 --- /dev/null +++ b/tests/kuttl/tests/dataplane-deploy-global-service-test/01-assert.yaml @@ -0,0 +1,1004 @@ +apiVersion: dataplane.openstack.org/v1beta1 +kind: OpenStackDataPlaneNodeSet +metadata: + name: edpm-compute-global-service + namespace: openstack +spec: + preProvisioned: true + services: + - download-cache + - bootstrap + - configure-network + - validate-network + - install-os + - configure-os + - run-os + - install-certs + - ovn + - neutron-metadata + - neutron-ovn + - neutron-sriov + - neutron-dhcp + - libvirt + - nova + - custom-global-service + tlsEnabled: false + env: + - name: ANSIBLE_FORCE_COLOR + value: "True" + nodes: {} + nodeTemplate: + ansibleSSHPrivateKeySecret: dataplane-ansible-ssh-private-key-secret + managementNetwork: ctlplane + ansible: + ansibleUser: cloud-admin + ansiblePort: 22 + ansibleVars: + service_net_map: + nova_api_network: internalapi + nova_libvirt_network: internalapi + timesync_ntp_servers: + - hostname: clock.redhat.com + # edpm_network_config + # Default nic config template for a EDPM compute node + # These vars are edpm_network_config role vars + edpm_network_config_hide_sensitive_logs: false + edpm_network_config_template: templates/single_nic_vlans/single_nic_vlans.j2 + # These vars are for the network config templates themselves and are + # considered EDPM network defaults. + neutron_physical_bridge_name: br-ex + neutron_public_interface_name: eth0 + ctlplane_mtu: 1500 + ctlplane_cidr: 24 + ctlplane_gateway_ip: 192.168.122.1 + ctlplane_host_routes: + - ip_netmask: 0.0.0.0/0 + next_hop: 192.168.122.1 + external_mtu: 1500 + external_vlan_id: 44 + external_cidr: '24' + external_host_routes: [] + internalapi_mtu: 1500 + internalapi_vlan_id: 20 + internalapi_cidr: '24' + internalapi_host_routes: [] + storage_mtu: 1500 + storage_vlan_id: 21 + storage_cidr: '24' + storage_host_routes: [] + tenant_mtu: 1500 + tenant_vlan_id: 22 + tenant_cidr: '24' + tenant_host_routes: [] + role_networks: + - InternalApi + - Storage + - Tenant + networks_lower: + External: external + InternalApi: internalapi + Storage: storage + Tenant: tenant + # edpm_nodes_validation + edpm_nodes_validation_validate_controllers_icmp: false + edpm_nodes_validation_validate_gateway_icmp: false + ctlplane_dns_nameservers: + - 192.168.122.1 + dns_search_domains: [] + gather_facts: false + enable_debug: false + # edpm firewall, change the allowed CIDR if needed + edpm_sshd_configure_firewall: true + edpm_sshd_allowed_ranges: ['192.168.122.0/24'] + # SELinux module + edpm_selinux_mode: enforcing +status: + conditions: + - message: NodeSet Ready + reason: Ready + status: "True" + type: Ready + - message: Deployment completed + reason: Ready + status: "True" + type: DeploymentReady + - message: Input data complete + reason: Ready + status: "True" + type: InputReady + - message: Setup complete + reason: Ready + status: "True" + type: SetupReady +--- +apiVersion: ansibleee.openstack.org/v1beta1 +kind: OpenStackAnsibleEE +metadata: + generation: 1 + name: custom-global-service-edpm-compute-global-service + namespace: openstack + ownerReferences: + - apiVersion: dataplane.openstack.org/v1beta1 + blockOwnerDeletion: true + controller: true + kind: OpenStackDataPlaneDeployment + name: edpm-compute-global-service +spec: + backoffLimit: 6 + env: + - name: ANSIBLE_FORCE_COLOR + value: "True" + envConfigMapName: openstack-aee-default-env + extraMounts: + - mounts: + - mountPath: /runner/env/ssh_key/ssh_key_edpm-compute-global-service + name: ssh-key-edpm-compute-global-service + subPath: ssh_key_edpm-compute-global-service + - mountPath: /runner/inventory/inventory-0 + name: inventory + subPath: inventory-0 + volumes: + - name: inventory + secret: + items: + - key: inventory-0 + path: inventory-0 + secretName: dataplaneallnodeset + - name: ssh-key-edpm-compute-global-service + secret: + items: + - key: ssh-privatekey + path: ssh_key_edpm-compute-global-service + secretName: dataplane-ansible-ssh-private-key-secret + name: openstackansibleee + play: | + - hosts: localhost + gather_facts: no + name: global kuttl play + tasks: + - name: Sleep + command: sleep 1 + delegate_to: localhost + preserveJobs: true + restartPolicy: Never + uid: 1001 +status: + JobStatus: Succeeded + conditions: + - message: AnsibleExecutionJob complete + reason: Ready + status: "True" + type: Ready + - message: AnsibleExecutionJob complete + reason: Ready + status: "True" + type: AnsibleExecutionJobReady +--- +apiVersion: ansibleee.openstack.org/v1beta1 +kind: OpenStackAnsibleEE +metadata: + name: bootstrap-edpm-compute-global-service + namespace: openstack + ownerReferences: + - apiVersion: dataplane.openstack.org/v1beta1 + blockOwnerDeletion: true + controller: true + kind: OpenStackDataPlaneDeployment + name: edpm-compute-global-service +spec: + backoffLimit: 6 + extraMounts: + - mounts: + - mountPath: /runner/env/ssh_key + name: ssh-key + subPath: ssh_key + - mountPath: /runner/inventory/hosts + name: inventory + subPath: inventory + volumes: + - name: ssh-key + secret: + items: + - key: ssh-privatekey + path: ssh_key + secretName: dataplane-ansible-ssh-private-key-secret + - name: inventory + secret: + items: + - key: inventory + path: inventory + secretName: dataplanenodeset-edpm-compute-global-service + name: openstackansibleee + restartPolicy: Never + playbook: osp.edpm.bootstrap + uid: 1001 +status: + JobStatus: Succeeded + conditions: + - message: AnsibleExecutionJob complete + reason: Ready + status: "True" + type: Ready + - message: AnsibleExecutionJob complete + reason: Ready + status: "True" + type: AnsibleExecutionJobReady + +--- +apiVersion: ansibleee.openstack.org/v1beta1 +kind: OpenStackAnsibleEE +metadata: + name: configure-network-edpm-compute-global-service + namespace: openstack + ownerReferences: + - apiVersion: dataplane.openstack.org/v1beta1 + blockOwnerDeletion: true + controller: true + kind: OpenStackDataPlaneDeployment + name: edpm-compute-global-service +spec: + backoffLimit: 6 + extraMounts: + - mounts: + - mountPath: /runner/env/ssh_key + name: ssh-key + subPath: ssh_key + - mountPath: /runner/inventory/hosts + name: inventory + subPath: inventory + volumes: + - name: ssh-key + secret: + items: + - key: ssh-privatekey + path: ssh_key + secretName: dataplane-ansible-ssh-private-key-secret + - name: inventory + secret: + items: + - key: inventory + path: inventory + secretName: dataplanenodeset-edpm-compute-global-service + name: openstackansibleee + restartPolicy: Never + playbook: osp.edpm.configure_network + uid: 1001 +status: + JobStatus: Succeeded + conditions: + - message: AnsibleExecutionJob complete + reason: Ready + status: "True" + type: Ready + - message: AnsibleExecutionJob complete + reason: Ready + status: "True" + type: AnsibleExecutionJobReady +--- +apiVersion: ansibleee.openstack.org/v1beta1 +kind: OpenStackAnsibleEE +metadata: + name: validate-network-edpm-compute-global-service + namespace: openstack + ownerReferences: + - apiVersion: dataplane.openstack.org/v1beta1 + blockOwnerDeletion: true + controller: true + kind: OpenStackDataPlaneDeployment + name: edpm-compute-global-service +spec: + backoffLimit: 6 + extraMounts: + - mounts: + - mountPath: /runner/env/ssh_key + name: ssh-key + subPath: ssh_key + - mountPath: /runner/inventory/hosts + name: inventory + subPath: inventory + volumes: + - name: ssh-key + secret: + items: + - key: ssh-privatekey + path: ssh_key + secretName: dataplane-ansible-ssh-private-key-secret + - name: inventory + secret: + items: + - key: inventory + path: inventory + secretName: dataplanenodeset-edpm-compute-global-service + name: openstackansibleee + restartPolicy: Never + playbook: osp.edpm.validate_network + uid: 1001 +status: + JobStatus: Succeeded + conditions: + - message: AnsibleExecutionJob complete + reason: Ready + status: "True" + type: Ready + - message: AnsibleExecutionJob complete + reason: Ready + status: "True" + type: AnsibleExecutionJobReady +--- +apiVersion: ansibleee.openstack.org/v1beta1 +kind: OpenStackAnsibleEE +metadata: + name: install-os-edpm-compute-global-service + namespace: openstack + ownerReferences: + - apiVersion: dataplane.openstack.org/v1beta1 + blockOwnerDeletion: true + controller: true + kind: OpenStackDataPlaneDeployment + name: edpm-compute-global-service +spec: + backoffLimit: 6 + extraMounts: + - mounts: + - mountPath: /runner/env/ssh_key + name: ssh-key + subPath: ssh_key + - mountPath: /runner/inventory/hosts + name: inventory + subPath: inventory + volumes: + - name: ssh-key + secret: + items: + - key: ssh-privatekey + path: ssh_key + secretName: dataplane-ansible-ssh-private-key-secret + - name: inventory + secret: + items: + - key: inventory + path: inventory + secretName: dataplanenodeset-edpm-compute-global-service + name: openstackansibleee + restartPolicy: Never + playbook: osp.edpm.install_os + uid: 1001 +status: + JobStatus: Succeeded + conditions: + - message: AnsibleExecutionJob complete + reason: Ready + status: "True" + type: Ready + - message: AnsibleExecutionJob complete + reason: Ready + status: "True" + type: AnsibleExecutionJobReady +--- +apiVersion: ansibleee.openstack.org/v1beta1 +kind: OpenStackAnsibleEE +metadata: + generation: 1 + name: configure-os-edpm-compute-global-service + namespace: openstack + ownerReferences: + - apiVersion: dataplane.openstack.org/v1beta1 + blockOwnerDeletion: true + controller: true + kind: OpenStackDataPlaneDeployment + name: edpm-compute-global-service +spec: + backoffLimit: 6 + extraMounts: + - mounts: + - mountPath: /runner/env/ssh_key + name: ssh-key + subPath: ssh_key + - mountPath: /runner/inventory/hosts + name: inventory + subPath: inventory + volumes: + - name: ssh-key + secret: + items: + - key: ssh-privatekey + path: ssh_key + secretName: dataplane-ansible-ssh-private-key-secret + - name: inventory + secret: + items: + - key: inventory + path: inventory + secretName: dataplanenodeset-edpm-compute-global-service + name: openstackansibleee + restartPolicy: Never + playbook: osp.edpm.configure_os + uid: 1001 +status: + JobStatus: Succeeded + conditions: + - message: AnsibleExecutionJob complete + reason: Ready + status: "True" + type: Ready + - message: AnsibleExecutionJob complete + reason: Ready + status: "True" + type: AnsibleExecutionJobReady +--- +apiVersion: ansibleee.openstack.org/v1beta1 +kind: OpenStackAnsibleEE +metadata: + name: run-os-edpm-compute-global-service + namespace: openstack + ownerReferences: + - apiVersion: dataplane.openstack.org/v1beta1 + blockOwnerDeletion: true + controller: true + kind: OpenStackDataPlaneDeployment + name: edpm-compute-global-service +spec: + backoffLimit: 6 + extraMounts: + - mounts: + - mountPath: /runner/env/ssh_key + name: ssh-key + subPath: ssh_key + - mountPath: /runner/inventory/hosts + name: inventory + subPath: inventory + volumes: + - name: ssh-key + secret: + items: + - key: ssh-privatekey + path: ssh_key + secretName: dataplane-ansible-ssh-private-key-secret + - name: inventory + secret: + items: + - key: inventory + path: inventory + secretName: dataplanenodeset-edpm-compute-global-service + name: openstackansibleee + restartPolicy: Never + playbook: osp.edpm.run_os + uid: 1001 +status: + JobStatus: Succeeded + conditions: + - message: AnsibleExecutionJob complete + reason: Ready + status: "True" + type: Ready + - message: AnsibleExecutionJob complete + reason: Ready + status: "True" + type: AnsibleExecutionJobReady +--- +apiVersion: ansibleee.openstack.org/v1beta1 +kind: OpenStackAnsibleEE +metadata: + name: install-certs-edpm-compute-global-service + namespace: openstack + ownerReferences: + - apiVersion: dataplane.openstack.org/v1beta1 + blockOwnerDeletion: true + controller: true + kind: OpenStackDataPlaneDeployment + name: edpm-compute-global-service +spec: + backoffLimit: 6 + extraMounts: + - mounts: + - mountPath: /runner/env/ssh_key + name: ssh-key + subPath: ssh_key + - mountPath: /runner/inventory/hosts + name: inventory + subPath: inventory + volumes: + - name: ssh-key + secret: + items: + - key: ssh-privatekey + path: ssh_key + secretName: dataplane-ansible-ssh-private-key-secret + - name: inventory + secret: + items: + - key: inventory + path: inventory + secretName: dataplanenodeset-edpm-compute-global-service + name: openstackansibleee + restartPolicy: Never + playbook: osp.edpm.install_certs + uid: 1001 +status: + JobStatus: Succeeded + conditions: + - message: AnsibleExecutionJob complete + reason: Ready + status: "True" + type: Ready + - message: AnsibleExecutionJob complete + reason: Ready + status: "True" + type: AnsibleExecutionJobReady +--- +apiVersion: ansibleee.openstack.org/v1beta1 +kind: OpenStackAnsibleEE +metadata: + generation: 1 + name: ovn-edpm-compute-global-service + namespace: openstack + ownerReferences: + - apiVersion: dataplane.openstack.org/v1beta1 + blockOwnerDeletion: true + controller: true + kind: OpenStackDataPlaneDeployment + name: edpm-compute-global-service +spec: + backoffLimit: 6 + extraMounts: + - mounts: + - mountPath: /var/lib/openstack/configs/ovn/ovsdb-config + name: ovncontroller-config-0 + subPath: ovsdb-config + volumes: + - configMap: + items: + - key: ovsdb-config + path: ovsdb-config + name: ovncontroller-config + name: ovncontroller-config-0 + - mounts: + - mountPath: /runner/env/ssh_key + name: ssh-key + subPath: ssh_key + - mountPath: /runner/inventory/hosts + name: inventory + subPath: inventory + volumes: + - name: ssh-key + secret: + items: + - key: ssh-privatekey + path: ssh_key + secretName: dataplane-ansible-ssh-private-key-secret + - name: inventory + secret: + items: + - key: inventory + path: inventory + secretName: dataplanenodeset-edpm-compute-global-service + name: openstackansibleee + restartPolicy: Never + playbook: osp.edpm.ovn + uid: 1001 +status: + JobStatus: Succeeded + conditions: + - message: AnsibleExecutionJob complete + reason: Ready + status: "True" + type: Ready + - message: AnsibleExecutionJob complete + reason: Ready + status: "True" + type: AnsibleExecutionJobReady +--- +apiVersion: ansibleee.openstack.org/v1beta1 +kind: OpenStackAnsibleEE +metadata: + generation: 1 + name: neutron-metadata-edpm-compute-global-service + namespace: openstack + ownerReferences: + - apiVersion: dataplane.openstack.org/v1beta1 + blockOwnerDeletion: true + controller: true + kind: OpenStackDataPlaneDeployment + name: edpm-compute-global-service +spec: + backoffLimit: 6 + extraMounts: + - mounts: + - mountPath: /var/lib/openstack/configs/neutron-metadata/10-neutron-metadata.conf + name: neutron-ovn-metadata-agent-neutron-config-0 + subPath: 10-neutron-metadata.conf + volumes: + - secret: + items: + - key: 10-neutron-metadata.conf + path: 10-neutron-metadata.conf + secretName: neutron-ovn-metadata-agent-neutron-config + name: neutron-ovn-metadata-agent-neutron-config-0 + - mounts: + - mountPath: /var/lib/openstack/configs/neutron-metadata/05-nova-metadata.conf + name: nova-metadata-neutron-config-0 + subPath: 05-nova-metadata.conf + - mountPath: /var/lib/openstack/configs/neutron-metadata/httpd.conf + name: nova-metadata-neutron-config-1 + subPath: httpd.conf + - mountPath: /var/lib/openstack/configs/neutron-metadata/nova-metadata-config.json + name: nova-metadata-neutron-config-2 + subPath: nova-metadata-config.json + volumes: + - secret: + items: + - key: 05-nova-metadata.conf + path: 05-nova-metadata.conf + secretName: nova-metadata-neutron-config + name: nova-metadata-neutron-config-0 + - name: nova-metadata-neutron-config-1 + secret: + items: + - key: httpd.conf + path: httpd.conf + secretName: nova-metadata-neutron-config + - name: nova-metadata-neutron-config-2 + secret: + items: + - key: nova-metadata-config.json + path: nova-metadata-config.json + secretName: nova-metadata-neutron-config + - mounts: + - mountPath: /runner/env/ssh_key + name: ssh-key + subPath: ssh_key + - mountPath: /runner/inventory/hosts + name: inventory + subPath: inventory + volumes: + - name: ssh-key + secret: + items: + - key: ssh-privatekey + path: ssh_key + secretName: dataplane-ansible-ssh-private-key-secret + - name: inventory + secret: + items: + - key: inventory + path: inventory + secretName: dataplanenodeset-edpm-compute-global-service + name: openstackansibleee + restartPolicy: Never + playbook: osp.edpm.neutron_metadata + uid: 1001 +status: + JobStatus: Succeeded + conditions: + - message: AnsibleExecutionJob complete + reason: Ready + status: "True" + type: Ready + - message: AnsibleExecutionJob complete + reason: Ready + status: "True" + type: AnsibleExecutionJobReady +--- +apiVersion: ansibleee.openstack.org/v1beta1 +kind: OpenStackAnsibleEE +metadata: + generation: 1 + name: neutron-ovn-edpm-compute-global-service + namespace: openstack + ownerReferences: + - apiVersion: dataplane.openstack.org/v1beta1 + blockOwnerDeletion: true + controller: true + kind: OpenStackDataPlaneDeployment + name: edpm-compute-global-service +spec: + backoffLimit: 6 + extraMounts: + - mounts: + - mountPath: /var/lib/openstack/configs/neutron-ovn/10-neutron-ovn.conf + name: neutron-ovn-agent-neutron-config-0 + subPath: 10-neutron-ovn.conf + volumes: + - secret: + items: + - key: 10-neutron-ovn.conf + path: 10-neutron-ovn.conf + secretName: neutron-ovn-agent-neutron-config + name: neutron-ovn-agent-neutron-config-0 + - mounts: + - mountPath: /runner/env/ssh_key + name: ssh-key + subPath: ssh_key + - mountPath: /runner/inventory/hosts + name: inventory + subPath: inventory + volumes: + - name: ssh-key + secret: + items: + - key: ssh-privatekey + path: ssh_key + secretName: dataplane-ansible-ssh-private-key-secret + - name: inventory + secret: + items: + - key: inventory + path: inventory + secretName: dataplanenodeset-edpm-compute-global-service + name: openstackansibleee + restartPolicy: Never + playbook: osp.edpm.neutron_ovn + uid: 1001 +status: + JobStatus: Succeeded + conditions: + - message: AnsibleExecutionJob complete + reason: Ready + status: "True" + type: Ready + - message: AnsibleExecutionJob complete + reason: Ready + status: "True" + type: AnsibleExecutionJobReady +--- +apiVersion: ansibleee.openstack.org/v1beta1 +kind: OpenStackAnsibleEE +metadata: + generation: 1 + name: neutron-sriov-edpm-compute-global-service + namespace: openstack + ownerReferences: + - apiVersion: dataplane.openstack.org/v1beta1 + blockOwnerDeletion: true + controller: true + kind: OpenStackDataPlaneDeployment + name: edpm-compute-global-service +spec: + backoffLimit: 6 + extraMounts: + - mounts: + - mountPath: /var/lib/openstack/configs/neutron-sriov/10-neutron-sriov.conf + name: neutron-sriov-agent-neutron-config-0 + subPath: 10-neutron-sriov.conf + volumes: + - secret: + items: + - key: 10-neutron-sriov.conf + path: 10-neutron-sriov.conf + secretName: neutron-sriov-agent-neutron-config + name: neutron-sriov-agent-neutron-config-0 + - mounts: + - mountPath: /runner/env/ssh_key + name: ssh-key + subPath: ssh_key + - mountPath: /runner/inventory/hosts + name: inventory + subPath: inventory + volumes: + - name: ssh-key + secret: + items: + - key: ssh-privatekey + path: ssh_key + secretName: dataplane-ansible-ssh-private-key-secret + - name: inventory + secret: + items: + - key: inventory + path: inventory + secretName: dataplanenodeset-edpm-compute-global-service + name: openstackansibleee + restartPolicy: Never + playbook: osp.edpm.neutron_sriov + uid: 1001 +status: + JobStatus: Succeeded + conditions: + - message: AnsibleExecutionJob complete + reason: Ready + status: "True" + type: Ready + - message: AnsibleExecutionJob complete + reason: Ready + status: "True" + type: AnsibleExecutionJobReady +--- +apiVersion: ansibleee.openstack.org/v1beta1 +kind: OpenStackAnsibleEE +metadata: + generation: 1 + name: neutron-dhcp-edpm-compute-global-service + namespace: openstack + ownerReferences: + - apiVersion: dataplane.openstack.org/v1beta1 + blockOwnerDeletion: true + controller: true + kind: OpenStackDataPlaneDeployment + name: edpm-compute-global-service +spec: + backoffLimit: 6 + extraMounts: + - mounts: + - mountPath: /var/lib/openstack/configs/neutron-dhcp/10-neutron-dhcp.conf + name: neutron-dhcp-agent-neutron-config-0 + subPath: 10-neutron-dhcp.conf + volumes: + - secret: + items: + - key: 10-neutron-dhcp.conf + path: 10-neutron-dhcp.conf + secretName: neutron-dhcp-agent-neutron-config + name: neutron-dhcp-agent-neutron-config-0 + - mounts: + - mountPath: /runner/env/ssh_key + name: ssh-key + subPath: ssh_key + - mountPath: /runner/inventory/hosts + name: inventory + subPath: inventory + volumes: + - name: ssh-key + secret: + items: + - key: ssh-privatekey + path: ssh_key + secretName: dataplane-ansible-ssh-private-key-secret + - name: inventory + secret: + items: + - key: inventory + path: inventory + secretName: dataplanenodeset-edpm-compute-global-service + name: openstackansibleee + restartPolicy: Never + playbook: osp.edpm.neutron_dhcp + uid: 1001 +status: + JobStatus: Succeeded + conditions: + - message: AnsibleExecutionJob complete + reason: Ready + status: "True" + type: Ready + - message: AnsibleExecutionJob complete + reason: Ready + status: "True" + type: AnsibleExecutionJobReady +--- +apiVersion: ansibleee.openstack.org/v1beta1 +kind: OpenStackAnsibleEE +metadata: + name: libvirt-edpm-compute-global-service + namespace: openstack + ownerReferences: + - apiVersion: dataplane.openstack.org/v1beta1 + blockOwnerDeletion: true + controller: true + kind: OpenStackDataPlaneDeployment + name: edpm-compute-global-service +spec: + backoffLimit: 6 + envConfigMapName: openstack-aee-default-env + extraMounts: + - mounts: + - mountPath: /runner/env/ssh_key + name: ssh-key + subPath: ssh_key + - mountPath: /runner/inventory/hosts + name: inventory + subPath: inventory + volumes: + - name: ssh-key + secret: + items: + - key: ssh-privatekey + path: ssh_key + secretName: dataplane-ansible-ssh-private-key-secret + - name: inventory + secret: + items: + - key: inventory + path: inventory + secretName: dataplanenodeset-edpm-compute-global-service + name: openstackansibleee + preserveJobs: true + restartPolicy: Never + playbook: osp.edpm.libvirt + uid: 1001 +status: + JobStatus: Succeeded + conditions: + - message: AnsibleExecutionJob complete + reason: Ready + status: "True" + type: Ready + - message: AnsibleExecutionJob complete + reason: Ready + status: "True" + type: AnsibleExecutionJobReady +--- +apiVersion: ansibleee.openstack.org/v1beta1 +kind: OpenStackAnsibleEE +metadata: + name: nova-edpm-compute-global-service + namespace: openstack +spec: + backoffLimit: 6 + envConfigMapName: openstack-aee-default-env + extraMounts: + - mounts: + - mountPath: /var/lib/openstack/configs/nova/01-nova.conf + name: nova-cell1-compute-config-0 + subPath: 01-nova.conf + - mountPath: /var/lib/openstack/configs/nova/nova-blank.conf + name: nova-cell1-compute-config-1 + subPath: nova-blank.conf + volumes: + - name: nova-cell1-compute-config-0 + secret: + items: + - key: 01-nova.conf + path: 01-nova.conf + secretName: nova-cell1-compute-config + - name: nova-cell1-compute-config-1 + secret: + items: + - key: nova-blank.conf + path: nova-blank.conf + secretName: nova-cell1-compute-config + - mounts: + - mountPath: /var/lib/openstack/configs/nova/ssh-privatekey + name: nova-migration-ssh-key-0 + subPath: ssh-privatekey + - mountPath: /var/lib/openstack/configs/nova/ssh-publickey + name: nova-migration-ssh-key-1 + subPath: ssh-publickey + volumes: + - name: nova-migration-ssh-key-0 + secret: + items: + - key: ssh-privatekey + path: ssh-privatekey + secretName: nova-migration-ssh-key + - name: nova-migration-ssh-key-1 + secret: + items: + - key: ssh-publickey + path: ssh-publickey + secretName: nova-migration-ssh-key + - mounts: + - mountPath: /runner/env/ssh_key + name: ssh-key + subPath: ssh_key + - mountPath: /runner/inventory/hosts + name: inventory + subPath: inventory + volumes: + - name: ssh-key + secret: + items: + - key: ssh-privatekey + path: ssh_key + secretName: dataplane-ansible-ssh-private-key-secret + - name: inventory + secret: + items: + - key: inventory + path: inventory + secretName: dataplanenodeset-edpm-compute-global-service + name: openstackansibleee + preserveJobs: true + restartPolicy: Never + playbook: osp.edpm.nova + uid: 1001 +status: + JobStatus: Succeeded + conditions: + - message: AnsibleExecutionJob complete + reason: Ready + status: "True" + type: Ready + - message: AnsibleExecutionJob complete + reason: Ready + status: "True" + type: AnsibleExecutionJobReady diff --git a/tests/kuttl/tests/dataplane-deploy-global-service-test/01-dataplane-deploy.yaml b/tests/kuttl/tests/dataplane-deploy-global-service-test/01-dataplane-deploy.yaml new file mode 100644 index 000000000..2db0f60f5 --- /dev/null +++ b/tests/kuttl/tests/dataplane-deploy-global-service-test/01-dataplane-deploy.yaml @@ -0,0 +1,8 @@ +--- +apiVersion: dataplane.openstack.org/v1beta1 +kind: OpenStackDataPlaneDeployment +metadata: + name: edpm-compute-global-service +spec: + nodeSets: + - edpm-compute-global-service