diff --git a/Makefile b/Makefile index 063af5d49..011bc4d7b 100644 --- a/Makefile +++ b/Makefile @@ -96,6 +96,7 @@ manifests: gowork controller-gen crd-to-markdown ## Generate WebhookConfiguratio rm -f api/bases/* && cp -a config/crd/bases api/ $(CRD_MARKDOWN) -f api/v1beta1/common.go -f api/v1beta1/openstackdataplanenodeset_types.go -n OpenStackDataPlaneNodeSet > docs/openstack_dataplanenodeset.md $(CRD_MARKDOWN) -f api/v1beta1/common.go -f api/v1beta1/openstackdataplaneservice_types.go -n OpenStackDataPlaneService > docs/openstack_dataplaneservice.md + $(CRD_MARKDOWN) -f api/v1beta1/common.go -f api/v1beta1/openstackdataplanedeployment_types.go -n OpenStackDataPlaneDeployment > docs/openstack_dataplanedeloyment.md .PHONY: generate generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations. diff --git a/OWNERS_ALIASES b/OWNERS_ALIASES index bbb8a4d1b..fe990c63b 100644 --- a/OWNERS_ALIASES +++ b/OWNERS_ALIASES @@ -7,7 +7,6 @@ aliases: - rebtoor - slagle - bshephar - - kajinamit - rabi ci-approvers: - Sandeepyadav93 diff --git a/PROJECT b/PROJECT index 044530e77..e66db3494 100644 --- a/PROJECT +++ b/PROJECT @@ -33,4 +33,13 @@ resources: kind: OpenStackDataPlaneService path: github.com/openstack-k8s-operators/dataplane-operator/api/v1beta1 version: v1beta1 +- api: + crdVersion: v1 + namespaced: true + controller: true + domain: openstack.org + group: dataplane + kind: OpenStackDataPlaneDeployment + path: github.com/openstack-k8s-operators/dataplane-operator/api/v1beta1 + version: v1beta1 version: "3" diff --git a/api/bases/dataplane.openstack.org_openstackdataplanedeployments.yaml b/api/bases/dataplane.openstack.org_openstackdataplanedeployments.yaml new file mode 100644 index 000000000..3fa3c613f --- /dev/null +++ b/api/bases/dataplane.openstack.org_openstackdataplanedeployments.yaml @@ -0,0 +1,91 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.1 + creationTimestamp: null + name: openstackdataplanedeployments.dataplane.openstack.org +spec: + group: dataplane.openstack.org + names: + kind: OpenStackDataPlaneDeployment + listKind: OpenStackDataPlaneDeploymentList + plural: openstackdataplanedeployments + shortNames: + - osdpd + - osdpdeployment + - osdpdeployments + singular: openstackdataplanedeployment + scope: Namespaced + versions: + - additionalPrinterColumns: + - description: NodeSets + jsonPath: .spec.NodeSets + name: NodeSets + type: string + - description: Status + jsonPath: .status.conditions[0].status + name: Status + type: string + - description: Message + jsonPath: .status.conditions[0].message + name: Message + type: string + name: v1beta1 + schema: + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + properties: + ansibleLimit: + type: string + ansibleSkipTags: + type: string + ansibleTags: + type: string + nodeSets: + items: + type: string + type: array + required: + - nodeSets + type: object + status: + properties: + conditions: + items: + properties: + lastTransitionTime: + format: date-time + type: string + message: + type: string + reason: + type: string + severity: + type: string + status: + type: string + type: + type: string + required: + - lastTransitionTime + - status + - type + type: object + type: array + deployed: + type: boolean + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/api/bases/dataplane.openstack.org_openstackdataplanenodesets.yaml b/api/bases/dataplane.openstack.org_openstackdataplanenodesets.yaml index de03b3b32..36b6acdc2 100644 --- a/api/bases/dataplane.openstack.org_openstackdataplanenodesets.yaml +++ b/api/bases/dataplane.openstack.org_openstackdataplanenodesets.yaml @@ -191,20 +191,6 @@ spec: - ctlplaneInterface - deploymentSSHSecret type: object - deployStrategy: - properties: - ansibleLimit: - type: string - ansibleSkipTags: - type: string - ansibleTags: - type: string - deploy: - default: true - type: boolean - required: - - deploy - type: object env: items: properties: @@ -1035,10 +1021,6 @@ spec: type: array managementNetwork: type: string - networkAttachments: - items: - type: string - type: array networkConfig: properties: template: @@ -1070,820 +1052,820 @@ spec: - subnetName type: object type: array - nodes: - additionalProperties: + userData: + properties: + name: + type: string + namespace: + type: string + type: object + x-kubernetes-map-type: atomic + required: + - ansibleSSHPrivateKeySecret + type: object + nodes: + additionalProperties: + properties: + ansible: properties: - ansible: - properties: - ansibleHost: - type: string - ansiblePort: - type: integer - ansibleUser: + ansibleHost: + type: string + ansiblePort: + type: integer + ansibleUser: + type: string + ansibleVars: + x-kubernetes-preserve-unknown-fields: true + type: object + extraMounts: + items: + properties: + extraVolType: + type: string + mounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + required: + - mountPath + - name + type: object + type: array + propagation: + items: type: string - ansibleVars: - x-kubernetes-preserve-unknown-fields: true - type: object - extraMounts: - items: - properties: - extraVolType: - type: string - mounts: - items: + type: array + volumes: + items: + properties: + awsElasticBlockStore: properties: - mountPath: + fsType: type: string - mountPropagation: + partition: + format: int32 + type: integer + readOnly: + type: boolean + volumeID: type: string - name: + required: + - volumeID + type: object + azureDisk: + properties: + cachingMode: + type: string + diskName: type: string + diskURI: + type: string + fsType: + type: string + kind: + type: string + readOnly: + type: boolean + required: + - diskName + - diskURI + type: object + azureFile: + properties: readOnly: type: boolean - subPath: + secretName: type: string - subPathExpr: + shareName: type: string required: - - mountPath - - name + - secretName + - shareName type: object - type: array - propagation: - items: - type: string - type: array - volumes: - items: + cephfs: properties: - awsElasticBlockStore: - properties: - fsType: - type: string - partition: - format: int32 - type: integer - readOnly: - type: boolean - volumeID: - type: string - required: - - volumeID - type: object - azureDisk: + monitors: + items: + type: string + type: array + path: + type: string + readOnly: + type: boolean + secretFile: + type: string + secretRef: properties: - cachingMode: - type: string - diskName: - type: string - diskURI: - type: string - fsType: - type: string - kind: + name: type: string - readOnly: - type: boolean - required: - - diskName - - diskURI type: object - azureFile: + x-kubernetes-map-type: atomic + user: + type: string + required: + - monitors + type: object + cinder: + properties: + fsType: + type: string + readOnly: + type: boolean + secretRef: properties: - readOnly: - type: boolean - secretName: - type: string - shareName: + name: type: string - required: - - secretName - - shareName type: object - cephfs: - properties: - monitors: - items: + x-kubernetes-map-type: atomic + volumeID: + type: string + required: + - volumeID + type: object + configMap: + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + key: type: string - type: array - path: - type: string - readOnly: - type: boolean - secretFile: - type: string - secretRef: - properties: - name: - type: string - type: object - x-kubernetes-map-type: atomic - user: - type: string - required: - - monitors - type: object - cinder: + mode: + format: int32 + type: integer + path: + type: string + required: + - key + - path + type: object + type: array + name: + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + csi: + properties: + driver: + type: string + fsType: + type: string + nodePublishSecretRef: properties: - fsType: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - x-kubernetes-map-type: atomic - volumeID: + name: type: string - required: - - volumeID type: object - configMap: - properties: - defaultMode: - format: int32 - type: integer - items: - items: + x-kubernetes-map-type: atomic + readOnly: + type: boolean + volumeAttributes: + additionalProperties: + type: string + type: object + required: + - driver + type: object + downwardAPI: + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + fieldRef: properties: - key: + apiVersion: type: string - mode: - format: int32 - type: integer - path: + fieldPath: type: string required: - - key - - path + - fieldPath type: object - type: array - name: - type: string - optional: - type: boolean - type: object - x-kubernetes-map-type: atomic - csi: - properties: - driver: - type: string - fsType: - type: string - nodePublishSecretRef: - properties: - name: - type: string - type: object - x-kubernetes-map-type: atomic - readOnly: - type: boolean - volumeAttributes: - additionalProperties: + x-kubernetes-map-type: atomic + mode: + format: int32 + type: integer + path: type: string - type: object - required: - - driver - type: object - downwardAPI: - properties: - defaultMode: - format: int32 - type: integer - items: - items: + resourceFieldRef: properties: - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - x-kubernetes-map-type: atomic - mode: - format: int32 - type: integer - path: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: type: string - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - x-kubernetes-map-type: atomic required: - - path + - resource type: object - type: array - type: object - emptyDir: - properties: - medium: - type: string - sizeLimit: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - ephemeral: + x-kubernetes-map-type: atomic + required: + - path + type: object + type: array + type: object + emptyDir: + properties: + medium: + type: string + sizeLimit: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + ephemeral: + properties: + volumeClaimTemplate: properties: - volumeClaimTemplate: + metadata: + type: object + spec: properties: - metadata: + accessModes: + items: + type: string + type: array + dataSource: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + required: + - kind + - name + type: object + x-kubernetes-map-type: atomic + dataSourceRef: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + namespace: + type: string + required: + - kind + - name type: object - spec: + resources: properties: - accessModes: + claims: items: - type: string + properties: + name: + type: string + required: + - name + type: object type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - x-kubernetes-map-type: atomic - dataSourceRef: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - namespace: - type: string - required: - - kind + x-kubernetes-list-map-keys: - name + x-kubernetes-list-type: map + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true type: object - resources: - properties: - claims: - items: - properties: - name: - type: string - required: - - name - type: object - type: array - x-kubernetes-list-map-keys: - - name - x-kubernetes-list-type: map - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true type: object - selector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: + type: object + selector: + properties: + matchExpressions: + items: + properties: + key: type: string - type: object + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string type: object - x-kubernetes-map-type: atomic - storageClassName: - type: string - volumeMode: - type: string - volumeName: - type: string type: object - required: - - spec - type: object - type: object - fc: - properties: - fsType: - type: string - lun: - format: int32 - type: integer - readOnly: - type: boolean - targetWWNs: - items: - type: string - type: array - wwids: - items: - type: string - type: array - type: object - flexVolume: - properties: - driver: - type: string - fsType: - type: string - options: - additionalProperties: - type: string - type: object - readOnly: - type: boolean - secretRef: - properties: - name: + x-kubernetes-map-type: atomic + storageClassName: type: string - type: object - x-kubernetes-map-type: atomic - required: - - driver - type: object - flocker: - properties: - datasetName: - type: string - datasetUUID: - type: string - type: object - gcePersistentDisk: - properties: - fsType: - type: string - partition: - format: int32 - type: integer - pdName: - type: string - readOnly: - type: boolean - required: - - pdName - type: object - gitRepo: - properties: - directory: - type: string - repository: - type: string - revision: - type: string - required: - - repository - type: object - glusterfs: - properties: - endpoints: - type: string - path: - type: string - readOnly: - type: boolean - required: - - endpoints - - path - type: object - hostPath: - properties: - path: - type: string - type: - type: string - required: - - path - type: object - iscsi: - properties: - chapAuthDiscovery: - type: boolean - chapAuthSession: - type: boolean - fsType: - type: string - initiatorName: - type: string - iqn: - type: string - iscsiInterface: - type: string - lun: - format: int32 - type: integer - portals: - items: - type: string - type: array - readOnly: - type: boolean - secretRef: - properties: - name: + volumeMode: + type: string + volumeName: type: string type: object - x-kubernetes-map-type: atomic - targetPortal: - type: string required: - - iqn - - lun - - targetPortal + - spec type: object - name: + type: object + fc: + properties: + fsType: type: string - nfs: - properties: - path: - type: string - readOnly: - type: boolean - server: - type: string - required: - - path - - server - type: object - persistentVolumeClaim: - properties: - claimName: - type: string - readOnly: - type: boolean - required: - - claimName + lun: + format: int32 + type: integer + readOnly: + type: boolean + targetWWNs: + items: + type: string + type: array + wwids: + items: + type: string + type: array + type: object + flexVolume: + properties: + driver: + type: string + fsType: + type: string + options: + additionalProperties: + type: string type: object - photonPersistentDisk: + readOnly: + type: boolean + secretRef: properties: - fsType: - type: string - pdID: + name: type: string - required: - - pdID type: object - portworxVolume: + x-kubernetes-map-type: atomic + required: + - driver + type: object + flocker: + properties: + datasetName: + type: string + datasetUUID: + type: string + type: object + gcePersistentDisk: + properties: + fsType: + type: string + partition: + format: int32 + type: integer + pdName: + type: string + readOnly: + type: boolean + required: + - pdName + type: object + gitRepo: + properties: + directory: + type: string + repository: + type: string + revision: + type: string + required: + - repository + type: object + glusterfs: + properties: + endpoints: + type: string + path: + type: string + readOnly: + type: boolean + required: + - endpoints + - path + type: object + hostPath: + properties: + path: + type: string + type: + type: string + required: + - path + type: object + iscsi: + properties: + chapAuthDiscovery: + type: boolean + chapAuthSession: + type: boolean + fsType: + type: string + initiatorName: + type: string + iqn: + type: string + iscsiInterface: + type: string + lun: + format: int32 + type: integer + portals: + items: + type: string + type: array + readOnly: + type: boolean + secretRef: properties: - fsType: - type: string - readOnly: - type: boolean - volumeID: + name: type: string - required: - - volumeID type: object - projected: - properties: - defaultMode: - format: int32 - type: integer - sources: - items: + x-kubernetes-map-type: atomic + targetPortal: + type: string + required: + - iqn + - lun + - targetPortal + type: object + name: + type: string + nfs: + properties: + path: + type: string + readOnly: + type: boolean + server: + type: string + required: + - path + - server + type: object + persistentVolumeClaim: + properties: + claimName: + type: string + readOnly: + type: boolean + required: + - claimName + type: object + photonPersistentDisk: + properties: + fsType: + type: string + pdID: + type: string + required: + - pdID + type: object + portworxVolume: + properties: + fsType: + type: string + readOnly: + type: boolean + volumeID: + type: string + required: + - volumeID + type: object + projected: + properties: + defaultMode: + format: int32 + type: integer + sources: + items: + properties: + configMap: properties: - configMap: - properties: - items: - items: + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + required: + - key + - path + type: object + type: array + name: + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + downwardAPI: + properties: + items: + items: + properties: + fieldRef: properties: - key: + apiVersion: type: string - mode: - format: int32 - type: integer - path: + fieldPath: type: string required: - - key - - path + - fieldPath type: object - type: array - name: - type: string - optional: - type: boolean - type: object - x-kubernetes-map-type: atomic - downwardAPI: - properties: - items: - items: - properties: - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - x-kubernetes-map-type: atomic - mode: - format: int32 - type: integer - path: - type: string - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - x-kubernetes-map-type: atomic - required: - - path - type: object - type: array - type: object - secret: - properties: - items: - items: + x-kubernetes-map-type: atomic + mode: + format: int32 + type: integer + path: + type: string + resourceFieldRef: properties: - key: + containerName: type: string - mode: - format: int32 - type: integer - path: + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: type: string required: - - key - - path + - resource type: object - type: array - name: - type: string - optional: - type: boolean - type: object - x-kubernetes-map-type: atomic - serviceAccountToken: - properties: - audience: - type: string - expirationSeconds: - format: int64 - type: integer - path: - type: string - required: - - path - type: object + x-kubernetes-map-type: atomic + required: + - path + type: object + type: array type: object - type: array - type: object - quobyte: - properties: - group: - type: string - readOnly: - type: boolean - registry: - type: string - tenant: - type: string - user: - type: string - volume: - type: string - required: - - registry - - volume - type: object - rbd: - properties: - fsType: - type: string - image: - type: string - keyring: - type: string - monitors: - items: - type: string - type: array - pool: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - x-kubernetes-map-type: atomic - user: - type: string - required: - - image - - monitors - type: object - scaleIO: - properties: - fsType: - type: string - gateway: - type: string - protectionDomain: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - x-kubernetes-map-type: atomic - sslEnabled: - type: boolean - storageMode: - type: string - storagePool: - type: string - system: - type: string - volumeName: - type: string - required: - - gateway - - secretRef - - system - type: object - secret: - properties: - defaultMode: - format: int32 - type: integer - items: - items: + secret: + properties: + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + required: + - key + - path + type: object + type: array + name: + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + serviceAccountToken: properties: - key: + audience: type: string - mode: - format: int32 + expirationSeconds: + format: int64 type: integer path: type: string required: - - key - path type: object - type: array - optional: - type: boolean - secretName: + type: object + type: array + type: object + quobyte: + properties: + group: + type: string + readOnly: + type: boolean + registry: + type: string + tenant: + type: string + user: + type: string + volume: + type: string + required: + - registry + - volume + type: object + rbd: + properties: + fsType: + type: string + image: + type: string + keyring: + type: string + monitors: + items: + type: string + type: array + pool: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: type: string type: object - storageos: + x-kubernetes-map-type: atomic + user: + type: string + required: + - image + - monitors + type: object + scaleIO: + properties: + fsType: + type: string + gateway: + type: string + protectionDomain: + type: string + readOnly: + type: boolean + secretRef: properties: - fsType: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - x-kubernetes-map-type: atomic - volumeName: - type: string - volumeNamespace: + name: type: string type: object - vsphereVolume: + x-kubernetes-map-type: atomic + sslEnabled: + type: boolean + storageMode: + type: string + storagePool: + type: string + system: + type: string + volumeName: + type: string + required: + - gateway + - secretRef + - system + type: object + secret: + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + required: + - key + - path + type: object + type: array + optional: + type: boolean + secretName: + type: string + type: object + storageos: + properties: + fsType: + type: string + readOnly: + type: boolean + secretRef: properties: - fsType: - type: string - storagePolicyID: - type: string - storagePolicyName: - type: string - volumePath: + name: type: string - required: - - volumePath type: object + x-kubernetes-map-type: atomic + volumeName: + type: string + volumeNamespace: + type: string + type: object + vsphereVolume: + properties: + fsType: + type: string + storagePolicyID: + type: string + storagePolicyName: + type: string + volumePath: + type: string required: - - name + - volumePath type: object - type: array - required: - - mounts - - volumes - type: object - type: array - hostName: + required: + - name + type: object + type: array + required: + - mounts + - volumes + type: object + type: array + hostName: + type: string + managementNetwork: + type: string + networkConfig: + properties: + template: type: string - managementNetwork: + type: object + networkData: + properties: + name: + type: string + namespace: type: string - networkConfig: - properties: - template: - type: string - type: object - networkData: - properties: - name: - type: string - namespace: - type: string - type: object - x-kubernetes-map-type: atomic - networks: - items: - properties: - defaultRoute: - type: boolean - fixedIP: - type: string - name: - pattern: ^[a-zA-Z0-9][a-zA-Z0-9\-_]*[a-zA-Z0-9]$ - type: string - subnetName: - pattern: ^[a-zA-Z0-9][a-zA-Z0-9\-_]*[a-zA-Z0-9]$ - type: string - required: - - name - - subnetName - type: object - type: array - userData: - properties: - name: - type: string - namespace: - type: string - type: object - x-kubernetes-map-type: atomic type: object - type: object - userData: - properties: - name: - type: string - namespace: - type: string - type: object - x-kubernetes-map-type: atomic - required: - - nodes + x-kubernetes-map-type: atomic + networks: + items: + properties: + defaultRoute: + type: boolean + fixedIP: + type: string + name: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9\-_]*[a-zA-Z0-9]$ + type: string + subnetName: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9\-_]*[a-zA-Z0-9]$ + type: string + required: + - name + - subnetName + type: object + type: array + userData: + properties: + name: + type: string + namespace: + type: string + type: object + x-kubernetes-map-type: atomic + type: object type: object preProvisioned: type: boolean @@ -1904,9 +1886,16 @@ spec: type: array required: - nodeTemplate + - nodes type: object status: properties: + CtlplaneSearchDomain: + type: string + DNSClusterAddresses: + items: + type: string + type: array conditions: items: properties: diff --git a/api/go.mod b/api/go.mod index 58f9e93ad..b7009a918 100644 --- a/api/go.mod +++ b/api/go.mod @@ -3,12 +3,12 @@ module github.com/openstack-k8s-operators/dataplane-operator/api go 1.19 require ( - github.com/openstack-k8s-operators/infra-operator/apis v0.1.1-0.20230829092744-a3dd5edba332 - github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230824094610-976b18ca2875 - github.com/openstack-k8s-operators/lib-common/modules/storage v0.1.1-0.20230824094610-976b18ca2875 - github.com/openstack-k8s-operators/openstack-baremetal-operator/api v0.1.1-0.20230823035821-d980f270d836 - k8s.io/api v0.26.7 - k8s.io/apimachinery v0.26.7 + github.com/openstack-k8s-operators/infra-operator/apis v0.1.1-0.20230914145253-116f307c7875 + github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230913075424-2680ce4b6ad2 + github.com/openstack-k8s-operators/lib-common/modules/storage v0.1.1-0.20230913075424-2680ce4b6ad2 + github.com/openstack-k8s-operators/openstack-baremetal-operator/api v0.1.1-0.20230915055858-ecb378f804c9 + k8s.io/api v0.26.9 + k8s.io/apimachinery v0.26.9 sigs.k8s.io/controller-runtime v0.14.6 ) @@ -41,7 +41,6 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/onsi/ginkgo/v2 v2.12.0 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/prometheus/client_golang v1.14.0 // indirect github.com/prometheus/client_model v0.3.0 // indirect @@ -49,12 +48,12 @@ require ( github.com/prometheus/procfs v0.8.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/testify v1.8.2 // indirect - golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect - golang.org/x/net v0.14.0 // indirect + golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect + golang.org/x/net v0.15.0 // indirect golang.org/x/oauth2 v0.8.0 // indirect - golang.org/x/sys v0.11.0 // indirect - golang.org/x/term v0.11.0 // indirect - golang.org/x/text v0.12.0 // indirect + golang.org/x/sys v0.12.0 // indirect + golang.org/x/term v0.12.0 // indirect + golang.org/x/text v0.13.0 // indirect golang.org/x/time v0.3.0 // indirect gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect google.golang.org/appengine v1.6.7 // indirect @@ -62,9 +61,9 @@ require ( gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/apiextensions-apiserver v0.26.7 // indirect - k8s.io/client-go v0.26.7 // indirect - k8s.io/component-base v0.26.7 // indirect + k8s.io/apiextensions-apiserver v0.26.9 // indirect + k8s.io/client-go v0.26.9 // indirect + k8s.io/component-base v0.26.9 // indirect k8s.io/klog/v2 v2.100.1 // indirect k8s.io/kube-openapi v0.0.0-20230515203736-54b630e78af5 // indirect k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect diff --git a/api/go.sum b/api/go.sum index 0a1a58fda..0818373a5 100644 --- a/api/go.sum +++ b/api/go.sum @@ -224,16 +224,15 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/onsi/ginkgo/v2 v2.12.0 h1:UIVDowFPwpg6yMUpPjGkYvf06K3RAiJXUhCxEwQVHRI= -github.com/onsi/ginkgo/v2 v2.12.0/go.mod h1:ZNEzXISYlqpb8S36iN71ifqLi3vVD1rVJGvWRCJOUpQ= github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= -github.com/openstack-k8s-operators/infra-operator/apis v0.1.1-0.20230829092744-a3dd5edba332 h1:OxhwqONfFHQjJuJjK3HKTXTSo2oQwKa97s+T+vKspkY= -github.com/openstack-k8s-operators/infra-operator/apis v0.1.1-0.20230829092744-a3dd5edba332/go.mod h1:t1xmsiZDqM3wXcLMqgHp7/iilK8ozuOkydV4Vi2Qibk= -github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230824094610-976b18ca2875 h1:pj22n6PQy/XAmV5m6XaarMY6X1lvxAh16oVT5ZSVoNI= -github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230824094610-976b18ca2875/go.mod h1:Mqg9hyHpWPda62750vqmk5TajxP3zbYPDP1rtSH7mg0= -github.com/openstack-k8s-operators/lib-common/modules/storage v0.1.1-0.20230824094610-976b18ca2875 h1:lC8Nw4PF2Lcqc7BJAdlBvYPyLqyaKa9R1e15dM9b3BY= -github.com/openstack-k8s-operators/lib-common/modules/storage v0.1.1-0.20230824094610-976b18ca2875/go.mod h1:lazDTPD8BYde2yyzZ3HbOfG51Sf87vSr4KXwpF57hDs= -github.com/openstack-k8s-operators/openstack-baremetal-operator/api v0.1.1-0.20230823035821-d980f270d836 h1:pQ6I7ImuEmi84fMb1tZFAVPA75ShZN10WIrKaHKl3uQ= -github.com/openstack-k8s-operators/openstack-baremetal-operator/api v0.1.1-0.20230823035821-d980f270d836/go.mod h1:H8r8C3OLaWMze/io3LP8otMz07vmjBZKV4Fk4U9JH9s= +github.com/openstack-k8s-operators/infra-operator/apis v0.1.1-0.20230914145253-116f307c7875 h1:DUlCjbi3XxH66oL97MFZF5wgL28HdU+r8TkBZVw7WIc= +github.com/openstack-k8s-operators/infra-operator/apis v0.1.1-0.20230914145253-116f307c7875/go.mod h1:NgrvT3CKMu6fE8Nt1H79qHx11L3I7Bb2eItniM7c9ow= +github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230913075424-2680ce4b6ad2 h1:/ez+9PSwtucQ9v1I5X72xlP5UJztTMPH4M5gDAJAatc= +github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230913075424-2680ce4b6ad2/go.mod h1:bG2JdbaO4bR4u8rtXZ7MgmMELuEseTkL2BPgk9JBYmY= +github.com/openstack-k8s-operators/lib-common/modules/storage v0.1.1-0.20230913075424-2680ce4b6ad2 h1:WqquubnK/hLqeZpTnNjjBCloo3HgvKhCrhEDNyQg21I= +github.com/openstack-k8s-operators/lib-common/modules/storage v0.1.1-0.20230913075424-2680ce4b6ad2/go.mod h1:UKzRiNlmYVIE7Ggc6+qd7MMrNBL20sgW46rhP+U0Ilc= +github.com/openstack-k8s-operators/openstack-baremetal-operator/api v0.1.1-0.20230915055858-ecb378f804c9 h1:Q6CPgccNeA2zfLZnDFxYBa0nwlfnZm60kSDa/4TqucY= +github.com/openstack-k8s-operators/openstack-baremetal-operator/api v0.1.1-0.20230915055858-ecb378f804c9/go.mod h1:9cWHjNK7MyiWxCx9779Mcieal5N0NLn75yraIlTuI2s= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -321,8 +320,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -377,8 +376,8 @@ golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= -golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= +golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= +golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -440,12 +439,12 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.11.0 h1:F9tnn/DA/Im8nCwm+fX+1/eBwi4qFjRT++MhtVC4ZX0= -golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= +golang.org/x/term v0.12.0 h1:/ZfYdc3zq+q02Rv9vGqTeSItdzZTSNDmfTi0mBAuidU= +golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -454,8 +453,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= -golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -503,7 +502,7 @@ golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.12.0 h1:YW6HUoUmYBpwSgyaGaZq1fHjrBjX1rlpZ54T6mu2kss= +golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -624,16 +623,16 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.26.7 h1:Lf4iEBEJb5OFNmawtBfSZV/UNi9riSJ0t1qdhyZqI40= -k8s.io/api v0.26.7/go.mod h1:Vk9bMadzA49UHPmHB//lX7VRCQSXGoVwfLd3Sc1SSXI= -k8s.io/apiextensions-apiserver v0.26.7 h1:L7ImW831auK1ZQBtNJPaG5qyrFxeISEBlgfZJfnaIPk= -k8s.io/apiextensions-apiserver v0.26.7/go.mod h1:3DbZBfS3kO7/Jaj7qqzcBtPcKP0/KcklyAnk8zc+fs4= -k8s.io/apimachinery v0.26.7 h1:590jSBwaSHCAFCqltaEogY/zybFlhGsnLteLpuF2wig= -k8s.io/apimachinery v0.26.7/go.mod h1:qYzLkrQ9lhrZRh0jNKo2cfvf/R1/kQONnSiyB7NUJU0= -k8s.io/client-go v0.26.7 h1:hyU9aKHlwVOykgyxzGYkrDSLCc4+mimZVyUJjPyUn1E= -k8s.io/client-go v0.26.7/go.mod h1:okYjy0jtq6sdeztALDvCh24tg4opOQS1XNvsJlERDAo= -k8s.io/component-base v0.26.7 h1:uqsOyZh0Zqoaup8tmHa491D/CvgFdGUs+X2H/inNUKM= -k8s.io/component-base v0.26.7/go.mod h1:CZe1HTmX/DQdeBrb9XYOXzs96jXth8ZbFvhLMsoJLUg= +k8s.io/api v0.26.9 h1:s8Y+G1u2JM55b90+Yo2RVb3PGT/hkWNVPN4idPERxJg= +k8s.io/api v0.26.9/go.mod h1:W/W4fEWRVzPD36820LlVUQfNBiSbiq0VPWRFJKwzmUg= +k8s.io/apiextensions-apiserver v0.26.9 h1:aJqWRuBj9i9J6tIDniqUDYM5QCRajTKXK/GO+zEccGQ= +k8s.io/apiextensions-apiserver v0.26.9/go.mod h1:L1uysxOP2kC1vkZTlHGUlUl5WSpa7e4GHJmGEZY7yLg= +k8s.io/apimachinery v0.26.9 h1:5yAV9cFR7Z4gIorKcAjWnx4uxtxiFsERwq4Pvmx0CCg= +k8s.io/apimachinery v0.26.9/go.mod h1:qYzLkrQ9lhrZRh0jNKo2cfvf/R1/kQONnSiyB7NUJU0= +k8s.io/client-go v0.26.9 h1:TGWi/6guEjIgT0Hg871Gsmx0qFuoGyGFjlFedrk7It0= +k8s.io/client-go v0.26.9/go.mod h1:tU1FZS0bwAmAFyPYpZycUQrQnUMzQ5MHloop7EbX6ow= +k8s.io/component-base v0.26.9 h1:qQVdQgyEIUe8EUkB3EEuQ9l5sgVlG2KgOB519yWEBGw= +k8s.io/component-base v0.26.9/go.mod h1:3WmW9lH9tbjpuvpAc22cPF/6C3VxCjMxkOU1j2mpzr8= k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20230515203736-54b630e78af5 h1:azYPdzztXxPSa8wb+hksEKayiz0o+PPisO/d+QhWnoo= diff --git a/api/v1beta1/common.go b/api/v1beta1/common.go index c2a810066..49bf20f4d 100644 --- a/api/v1beta1/common.go +++ b/api/v1beta1/common.go @@ -89,19 +89,9 @@ type NodeTemplate struct { // The named secret must be of the form: // Secret.data.ssh-privatekey: // - // +kubebuilder:validation:Optional - // +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:io.kubernetes:Secret"} - AnsibleSSHPrivateKeySecret string `json:"ansibleSSHPrivateKeySecret,omitempty"` - - // Nodes - Map of Node Names and node specific data. Values here override defaults in the - // upper level section. // +kubebuilder:validation:Required - Nodes map[string]NodeSection `json:"nodes"` - - // NetworkAttachments is a list of NetworkAttachment resource names to pass to the ansibleee resource - // which allows to connect the ansibleee runner to the given network - // +kubebuilder:validation:Optional - NetworkAttachments []string `json:"networkAttachments,omitempty"` + // +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:io.kubernetes:Secret"} + AnsibleSSHPrivateKeySecret string `json:"ansibleSSHPrivateKeySecret"` // NetworkConfig - Network configuration details. Contains os-net-config // related properties. @@ -133,26 +123,6 @@ type NodeTemplate struct { NetworkData *corev1.SecretReference `json:"networkData,omitempty"` } -// DeployStrategySection for fields controlling the deployment -type DeployStrategySection struct { - // +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:booleanSwitch"} - // Deploy boolean to trigger ansible execution - // +kubebuilder:default=true - Deploy bool `json:"deploy"` - - // AnsibleTags for ansible execution - // +kubebuilder:validation:Optional - AnsibleTags string `json:"ansibleTags,omitempty"` - - // AnsibleLimit for ansible execution - // +kubebuilder:validation:Optional - AnsibleLimit string `json:"ansibleLimit,omitempty"` - - // AnsibleSkipTags for ansible execution - // +kubebuilder:validation:Optional - AnsibleSkipTags string `json:"ansibleSkipTags,omitempty"` -} - // NetworkConfigSection is a specification of the Network configuration details type NetworkConfigSection struct { diff --git a/api/v1beta1/conditions.go b/api/v1beta1/conditions.go index 40943d91c..d4b4b4e58 100644 --- a/api/v1beta1/conditions.go +++ b/api/v1beta1/conditions.go @@ -85,4 +85,30 @@ const ( // InputReadyWaitingMessage not yet ready InputReadyWaitingMessage = "Waiting for input %s, not yet ready" + + // NodeSetDeploymentReadyCondition Status=True condition indicates if the + // NodeSet Deployment is finished and successful. + NodeSetDeploymentReadyCondition string = "%s Deployment ready" + + // NodeSetDeploymentReadyMessage ready + NodeSetDeploymentReadyMessage = "%s Deployment ready" + + // NodeSetDeploymentReadyWaitingMessage not yet ready + NodeSetDeploymentReadyWaitingMessage = "%s Deployment not yet ready" + + // NodeSetDeploymentErrorMessage error + NodeSetDeploymentErrorMessage = "%s Deployment error occurred %s" + + // NodeSetServiceDeploymentReadyCondition Status=True condition indicates if the + // NodeSet Deployment is finished and successful. + NodeSetServiceDeploymentReadyCondition string = "%s %s Deployment ready" + + // NodeSetServiceDeploymentReadyMessage ready + NodeSetServiceDeploymentReadyMessage = "%s %s Deployment ready" + + // NodeSetServiceDeploymentReadyWaitingMessage not yet ready + NodeSetServiceDeploymentReadyWaitingMessage = "%s %s Deployment not yet ready" + + // NodeSetServiceDeploymentErrorMessage error + NodeSetServiceDeploymentErrorMessage = "%s %s Deployment error occurred" ) diff --git a/api/v1beta1/openstackdataplanedeployment_types.go b/api/v1beta1/openstackdataplanedeployment_types.go new file mode 100644 index 000000000..63e90e6f0 --- /dev/null +++ b/api/v1beta1/openstackdataplanedeployment_types.go @@ -0,0 +1,110 @@ +/* +Copyright 2023. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + "fmt" + + "github.com/openstack-k8s-operators/lib-common/modules/common/condition" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// OpenStackDataPlaneDeploymentSpec defines the desired state of OpenStackDataPlaneDeployment +type OpenStackDataPlaneDeploymentSpec struct { + + // +kubebuilder:validation:Required + // NodeSets is the list of NodeSets deployed + NodeSets []string `json:"nodeSets"` + + // AnsibleTags for ansible execution + // +kubebuilder:validation:Optional + AnsibleTags string `json:"ansibleTags,omitempty"` + + // AnsibleLimit for ansible execution + // +kubebuilder:validation:Optional + AnsibleLimit string `json:"ansibleLimit,omitempty"` + + // AnsibleSkipTags for ansible execution + // +kubebuilder:validation:Optional + AnsibleSkipTags string `json:"ansibleSkipTags,omitempty"` +} + +// OpenStackDataPlaneDeploymentStatus defines the observed state of OpenStackDataPlaneDeployment +type OpenStackDataPlaneDeploymentStatus struct { + // +operator-sdk:csv:customresourcedefinitions:type=status,xDescriptors={"urn:alm:descriptor:io.kubernetes.conditions"} + // Conditions + Conditions condition.Conditions `json:"conditions,omitempty" optional:"true"` + + // +operator-sdk:csv:customresourcedefinitions:type=status,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:booleanSwitch"} + // Deployed + Deployed bool `json:"deployed,omitempty" optional:"true"` +} + +//+kubebuilder:object:root=true +//+kubebuilder:subresource:status +//+operator-sdk:csv:customresourcedefinitions:displayName="OpenStack Data Plane Deployments" +//+kubebuilder:resource:shortName=osdpd;osdpdeployment;osdpdeployments +//+kubebuilder:printcolumn:name="NodeSets",type="string",JSONPath=".spec.NodeSets",description="NodeSets" +//+kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.conditions[0].status",description="Status" +//+kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[0].message",description="Message" + +// OpenStackDataPlaneDeployment is the Schema for the openstackdataplanedeployments API +type OpenStackDataPlaneDeployment struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec OpenStackDataPlaneDeploymentSpec `json:"spec,omitempty"` + Status OpenStackDataPlaneDeploymentStatus `json:"status,omitempty"` +} + +//+kubebuilder:object:root=true + +// OpenStackDataPlaneDeploymentList contains a list of OpenStackDataPlaneDeployment +type OpenStackDataPlaneDeploymentList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []OpenStackDataPlaneDeployment `json:"items"` +} + +func init() { + SchemeBuilder.Register(&OpenStackDataPlaneDeployment{}, &OpenStackDataPlaneDeploymentList{}) +} + +// IsReady - returns true if the OpenStackDataPlaneDeployment is ready +func (instance OpenStackDataPlaneDeployment) IsReady() bool { + return instance.Status.Conditions.IsTrue(condition.ReadyCondition) +} + +// InitConditions - Initializes Status Conditons +func (instance *OpenStackDataPlaneDeployment) InitConditions() { + instance.Status.Conditions = condition.Conditions{} + + cl := condition.CreateList( + condition.UnknownCondition(condition.DeploymentReadyCondition, condition.InitReason, condition.InitReason), + condition.UnknownCondition(condition.InputReadyCondition, condition.InitReason, condition.InitReason), + ) + + if instance.Spec.NodeSets != nil { + for _, nodeSet := range instance.Spec.NodeSets { + readyCondition := condition.Type(fmt.Sprintf(NodeSetDeploymentReadyCondition, nodeSet)) + cl = append(cl, *condition.UnknownCondition(readyCondition, condition.InitReason, condition.InitReason)) + } + } + + instance.Status.Conditions.Init(&cl) + instance.Status.Deployed = false +} diff --git a/api/v1beta1/openstackdataplanenodeset_types.go b/api/v1beta1/openstackdataplanenodeset_types.go index 42af67560..1c2780762 100644 --- a/api/v1beta1/openstackdataplanenodeset_types.go +++ b/api/v1beta1/openstackdataplanenodeset_types.go @@ -17,8 +17,6 @@ limitations under the License. package v1beta1 import ( - "fmt" - condition "github.com/openstack-k8s-operators/lib-common/modules/common/condition" baremetalv1 "github.com/openstack-k8s-operators/openstack-baremetal-operator/api/v1beta1" corev1 "k8s.io/api/core/v1" @@ -37,6 +35,11 @@ type OpenStackDataPlaneNodeSetSpec struct { // from valus in this section. NodeTemplate NodeTemplate `json:"nodeTemplate"` + // Nodes - Map of Node Names and node specific data. Values here override defaults in the + // upper level section. + // +kubebuilder:validation:Required + Nodes map[string]NodeSection `json:"nodes"` + // +kubebuilder:validation:Optional // // +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:booleanSwitch"} @@ -47,10 +50,6 @@ type OpenStackDataPlaneNodeSetSpec struct { // Env is a list containing the environment variables to pass to the pod Env []corev1.EnvVar `json:"env,omitempty"` - // +kubebuilder:validation:Optional - // DeployStrategy section to control how the node is deployed - DeployStrategy DeployStrategySection `json:"deployStrategy,omitempty"` - // +kubebuilder:validation:Optional // NetworkAttachments is a list of NetworkAttachment resource names to pass to the ansibleee resource // which allows to connect the ansibleee runner to the given network @@ -88,6 +87,12 @@ type OpenStackDataPlaneNodeSetStatus struct { // +operator-sdk:csv:customresourcedefinitions:type=status,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:booleanSwitch"} // Deployed Deployed bool `json:"deployed,omitempty" optional:"true"` + + // DNSClusterAddresses + DNSClusterAddresses []string `json:"DNSClusterAddresses,omitempty" optional:"true"` + + // CtlplaneSearchDomain + CtlplaneSearchDomain string `json:"CtlplaneSearchDomain,omitempty" optional:"true"` } //+kubebuilder:object:root=true @@ -126,13 +131,6 @@ func (instance *OpenStackDataPlaneNodeSet) InitConditions() { cl = append(cl, *condition.UnknownCondition(NodeSetBareMetalProvisionReadyCondition, condition.InitReason, condition.InitReason)) } - if instance.Spec.Services != nil && instance.Spec.DeployStrategy.Deploy { - for _, service := range instance.Spec.Services { - readyCondition := condition.Type(fmt.Sprintf(ServiceReadyCondition, service)) - cl = append(cl, *condition.UnknownCondition(readyCondition, condition.InitReason, condition.InitReason)) - } - } - instance.Status.Conditions.Init(&cl) instance.Status.Deployed = false } @@ -141,9 +139,6 @@ func (instance *OpenStackDataPlaneNodeSet) InitConditions() { func (instance OpenStackDataPlaneNodeSet) GetAnsibleEESpec() AnsibleEESpec { return AnsibleEESpec{ NetworkAttachments: instance.Spec.NetworkAttachments, - AnsibleTags: instance.Spec.DeployStrategy.AnsibleTags, - AnsibleLimit: instance.Spec.DeployStrategy.AnsibleLimit, - AnsibleSkipTags: instance.Spec.DeployStrategy.AnsibleSkipTags, ExtraMounts: instance.Spec.NodeTemplate.ExtraMounts, Env: instance.Spec.Env, } diff --git a/api/v1beta1/openstackdataplanenodeset_webhook.go b/api/v1beta1/openstackdataplanenodeset_webhook.go index 0b817167d..360439b5b 100644 --- a/api/v1beta1/openstackdataplanenodeset_webhook.go +++ b/api/v1beta1/openstackdataplanenodeset_webhook.go @@ -48,11 +48,11 @@ func (r *OpenStackDataPlaneNodeSet) Default() { // Default - set defaults for this OpenStackDataPlaneNodeSet Spec func (spec *OpenStackDataPlaneNodeSetSpec) Default() { - for nodeName, node := range spec.NodeTemplate.Nodes { + for nodeName, node := range spec.Nodes { if node.HostName == "" { node.HostName = nodeName } - spec.NodeTemplate.Nodes[nodeName] = *node.DeepCopy() + spec.Nodes[nodeName] = *node.DeepCopy() } if spec.BaremetalSetTemplate.DeploymentSSHSecret == "" { @@ -61,7 +61,7 @@ func (spec *OpenStackDataPlaneNodeSetSpec) Default() { if !spec.PreProvisioned && spec.BaremetalSetTemplate.BaremetalHosts == nil { nodeSetHostMap := make(map[string]baremetalv1.InstanceSpec) - for _, node := range spec.NodeTemplate.Nodes { + for _, node := range spec.Nodes { instanceSpec := baremetalv1.InstanceSpec{} instanceSpec.UserData = node.UserData instanceSpec.NetworkData = node.NetworkData diff --git a/api/v1beta1/zz_generated.deepcopy.go b/api/v1beta1/zz_generated.deepcopy.go index 3b56ee647..67ec54aa8 100644 --- a/api/v1beta1/zz_generated.deepcopy.go +++ b/api/v1beta1/zz_generated.deepcopy.go @@ -99,21 +99,6 @@ func (in *AnsibleOpts) DeepCopy() *AnsibleOpts { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DeployStrategySection) DeepCopyInto(out *DeployStrategySection) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeployStrategySection. -func (in *DeployStrategySection) DeepCopy() *DeployStrategySection { - if in == nil { - return nil - } - out := new(DeployStrategySection) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *KubeService) DeepCopyInto(out *KubeService) { *out = *in @@ -188,18 +173,6 @@ func (in *NodeSection) DeepCopy() *NodeSection { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NodeTemplate) DeepCopyInto(out *NodeTemplate) { *out = *in - if in.Nodes != nil { - in, out := &in.Nodes, &out.Nodes - *out = make(map[string]NodeSection, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } - if in.NetworkAttachments != nil { - in, out := &in.NetworkAttachments, &out.NetworkAttachments - *out = make([]string, len(*in)) - copy(*out, *in) - } out.NetworkConfig = in.NetworkConfig if in.Networks != nil { in, out := &in.Networks, &out.Networks @@ -238,6 +211,107 @@ func (in *NodeTemplate) DeepCopy() *NodeTemplate { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenStackDataPlaneDeployment) DeepCopyInto(out *OpenStackDataPlaneDeployment) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackDataPlaneDeployment. +func (in *OpenStackDataPlaneDeployment) DeepCopy() *OpenStackDataPlaneDeployment { + if in == nil { + return nil + } + out := new(OpenStackDataPlaneDeployment) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *OpenStackDataPlaneDeployment) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenStackDataPlaneDeploymentList) DeepCopyInto(out *OpenStackDataPlaneDeploymentList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]OpenStackDataPlaneDeployment, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackDataPlaneDeploymentList. +func (in *OpenStackDataPlaneDeploymentList) DeepCopy() *OpenStackDataPlaneDeploymentList { + if in == nil { + return nil + } + out := new(OpenStackDataPlaneDeploymentList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *OpenStackDataPlaneDeploymentList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenStackDataPlaneDeploymentSpec) DeepCopyInto(out *OpenStackDataPlaneDeploymentSpec) { + *out = *in + if in.NodeSets != nil { + in, out := &in.NodeSets, &out.NodeSets + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackDataPlaneDeploymentSpec. +func (in *OpenStackDataPlaneDeploymentSpec) DeepCopy() *OpenStackDataPlaneDeploymentSpec { + if in == nil { + return nil + } + out := new(OpenStackDataPlaneDeploymentSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OpenStackDataPlaneDeploymentStatus) DeepCopyInto(out *OpenStackDataPlaneDeploymentStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(condition.Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackDataPlaneDeploymentStatus. +func (in *OpenStackDataPlaneDeploymentStatus) DeepCopy() *OpenStackDataPlaneDeploymentStatus { + if in == nil { + return nil + } + out := new(OpenStackDataPlaneDeploymentStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *OpenStackDataPlaneNodeSet) DeepCopyInto(out *OpenStackDataPlaneNodeSet) { *out = *in @@ -302,6 +376,13 @@ func (in *OpenStackDataPlaneNodeSetSpec) DeepCopyInto(out *OpenStackDataPlaneNod *out = *in in.BaremetalSetTemplate.DeepCopyInto(&out.BaremetalSetTemplate) in.NodeTemplate.DeepCopyInto(&out.NodeTemplate) + if in.Nodes != nil { + in, out := &in.Nodes, &out.Nodes + *out = make(map[string]NodeSection, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } if in.Env != nil { in, out := &in.Env, &out.Env *out = make([]v1.EnvVar, len(*in)) @@ -309,7 +390,6 @@ func (in *OpenStackDataPlaneNodeSetSpec) DeepCopyInto(out *OpenStackDataPlaneNod (*in)[i].DeepCopyInto(&(*out)[i]) } } - out.DeployStrategy = in.DeployStrategy if in.NetworkAttachments != nil { in, out := &in.NetworkAttachments, &out.NetworkAttachments *out = make([]string, len(*in)) @@ -342,6 +422,11 @@ func (in *OpenStackDataPlaneNodeSetStatus) DeepCopyInto(out *OpenStackDataPlaneN (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.DNSClusterAddresses != nil { + in, out := &in.DNSClusterAddresses, &out.DNSClusterAddresses + *out = make([]string, len(*in)) + copy(*out, *in) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackDataPlaneNodeSetStatus. diff --git a/config/crd/bases/dataplane.openstack.org_openstackdataplanedeployments.yaml b/config/crd/bases/dataplane.openstack.org_openstackdataplanedeployments.yaml new file mode 100644 index 000000000..3fa3c613f --- /dev/null +++ b/config/crd/bases/dataplane.openstack.org_openstackdataplanedeployments.yaml @@ -0,0 +1,91 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.1 + creationTimestamp: null + name: openstackdataplanedeployments.dataplane.openstack.org +spec: + group: dataplane.openstack.org + names: + kind: OpenStackDataPlaneDeployment + listKind: OpenStackDataPlaneDeploymentList + plural: openstackdataplanedeployments + shortNames: + - osdpd + - osdpdeployment + - osdpdeployments + singular: openstackdataplanedeployment + scope: Namespaced + versions: + - additionalPrinterColumns: + - description: NodeSets + jsonPath: .spec.NodeSets + name: NodeSets + type: string + - description: Status + jsonPath: .status.conditions[0].status + name: Status + type: string + - description: Message + jsonPath: .status.conditions[0].message + name: Message + type: string + name: v1beta1 + schema: + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + properties: + ansibleLimit: + type: string + ansibleSkipTags: + type: string + ansibleTags: + type: string + nodeSets: + items: + type: string + type: array + required: + - nodeSets + type: object + status: + properties: + conditions: + items: + properties: + lastTransitionTime: + format: date-time + type: string + message: + type: string + reason: + type: string + severity: + type: string + status: + type: string + type: + type: string + required: + - lastTransitionTime + - status + - type + type: object + type: array + deployed: + type: boolean + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/config/crd/bases/dataplane.openstack.org_openstackdataplanenodesets.yaml b/config/crd/bases/dataplane.openstack.org_openstackdataplanenodesets.yaml index de03b3b32..36b6acdc2 100644 --- a/config/crd/bases/dataplane.openstack.org_openstackdataplanenodesets.yaml +++ b/config/crd/bases/dataplane.openstack.org_openstackdataplanenodesets.yaml @@ -191,20 +191,6 @@ spec: - ctlplaneInterface - deploymentSSHSecret type: object - deployStrategy: - properties: - ansibleLimit: - type: string - ansibleSkipTags: - type: string - ansibleTags: - type: string - deploy: - default: true - type: boolean - required: - - deploy - type: object env: items: properties: @@ -1035,10 +1021,6 @@ spec: type: array managementNetwork: type: string - networkAttachments: - items: - type: string - type: array networkConfig: properties: template: @@ -1070,820 +1052,820 @@ spec: - subnetName type: object type: array - nodes: - additionalProperties: + userData: + properties: + name: + type: string + namespace: + type: string + type: object + x-kubernetes-map-type: atomic + required: + - ansibleSSHPrivateKeySecret + type: object + nodes: + additionalProperties: + properties: + ansible: properties: - ansible: - properties: - ansibleHost: - type: string - ansiblePort: - type: integer - ansibleUser: + ansibleHost: + type: string + ansiblePort: + type: integer + ansibleUser: + type: string + ansibleVars: + x-kubernetes-preserve-unknown-fields: true + type: object + extraMounts: + items: + properties: + extraVolType: + type: string + mounts: + items: + properties: + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + subPath: + type: string + subPathExpr: + type: string + required: + - mountPath + - name + type: object + type: array + propagation: + items: type: string - ansibleVars: - x-kubernetes-preserve-unknown-fields: true - type: object - extraMounts: - items: - properties: - extraVolType: - type: string - mounts: - items: + type: array + volumes: + items: + properties: + awsElasticBlockStore: properties: - mountPath: + fsType: type: string - mountPropagation: + partition: + format: int32 + type: integer + readOnly: + type: boolean + volumeID: type: string - name: + required: + - volumeID + type: object + azureDisk: + properties: + cachingMode: + type: string + diskName: type: string + diskURI: + type: string + fsType: + type: string + kind: + type: string + readOnly: + type: boolean + required: + - diskName + - diskURI + type: object + azureFile: + properties: readOnly: type: boolean - subPath: + secretName: type: string - subPathExpr: + shareName: type: string required: - - mountPath - - name + - secretName + - shareName type: object - type: array - propagation: - items: - type: string - type: array - volumes: - items: + cephfs: properties: - awsElasticBlockStore: - properties: - fsType: - type: string - partition: - format: int32 - type: integer - readOnly: - type: boolean - volumeID: - type: string - required: - - volumeID - type: object - azureDisk: + monitors: + items: + type: string + type: array + path: + type: string + readOnly: + type: boolean + secretFile: + type: string + secretRef: properties: - cachingMode: - type: string - diskName: - type: string - diskURI: - type: string - fsType: - type: string - kind: + name: type: string - readOnly: - type: boolean - required: - - diskName - - diskURI type: object - azureFile: + x-kubernetes-map-type: atomic + user: + type: string + required: + - monitors + type: object + cinder: + properties: + fsType: + type: string + readOnly: + type: boolean + secretRef: properties: - readOnly: - type: boolean - secretName: - type: string - shareName: + name: type: string - required: - - secretName - - shareName type: object - cephfs: - properties: - monitors: - items: + x-kubernetes-map-type: atomic + volumeID: + type: string + required: + - volumeID + type: object + configMap: + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + key: type: string - type: array - path: - type: string - readOnly: - type: boolean - secretFile: - type: string - secretRef: - properties: - name: - type: string - type: object - x-kubernetes-map-type: atomic - user: - type: string - required: - - monitors - type: object - cinder: + mode: + format: int32 + type: integer + path: + type: string + required: + - key + - path + type: object + type: array + name: + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + csi: + properties: + driver: + type: string + fsType: + type: string + nodePublishSecretRef: properties: - fsType: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - x-kubernetes-map-type: atomic - volumeID: + name: type: string - required: - - volumeID type: object - configMap: - properties: - defaultMode: - format: int32 - type: integer - items: - items: + x-kubernetes-map-type: atomic + readOnly: + type: boolean + volumeAttributes: + additionalProperties: + type: string + type: object + required: + - driver + type: object + downwardAPI: + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + fieldRef: properties: - key: + apiVersion: type: string - mode: - format: int32 - type: integer - path: + fieldPath: type: string required: - - key - - path + - fieldPath type: object - type: array - name: - type: string - optional: - type: boolean - type: object - x-kubernetes-map-type: atomic - csi: - properties: - driver: - type: string - fsType: - type: string - nodePublishSecretRef: - properties: - name: - type: string - type: object - x-kubernetes-map-type: atomic - readOnly: - type: boolean - volumeAttributes: - additionalProperties: + x-kubernetes-map-type: atomic + mode: + format: int32 + type: integer + path: type: string - type: object - required: - - driver - type: object - downwardAPI: - properties: - defaultMode: - format: int32 - type: integer - items: - items: + resourceFieldRef: properties: - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - x-kubernetes-map-type: atomic - mode: - format: int32 - type: integer - path: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: type: string - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - x-kubernetes-map-type: atomic required: - - path + - resource type: object - type: array - type: object - emptyDir: - properties: - medium: - type: string - sizeLimit: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - ephemeral: + x-kubernetes-map-type: atomic + required: + - path + type: object + type: array + type: object + emptyDir: + properties: + medium: + type: string + sizeLimit: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + ephemeral: + properties: + volumeClaimTemplate: properties: - volumeClaimTemplate: + metadata: + type: object + spec: properties: - metadata: + accessModes: + items: + type: string + type: array + dataSource: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + required: + - kind + - name + type: object + x-kubernetes-map-type: atomic + dataSourceRef: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + namespace: + type: string + required: + - kind + - name type: object - spec: + resources: properties: - accessModes: + claims: items: - type: string + properties: + name: + type: string + required: + - name + type: object type: array - dataSource: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - x-kubernetes-map-type: atomic - dataSourceRef: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - namespace: - type: string - required: - - kind + x-kubernetes-list-map-keys: - name + x-kubernetes-list-type: map + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true type: object - resources: - properties: - claims: - items: - properties: - name: - type: string - required: - - name - type: object - type: array - x-kubernetes-list-map-keys: - - name - x-kubernetes-list-type: map - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true type: object - selector: - properties: - matchExpressions: - items: - properties: - key: - type: string - operator: - type: string - values: - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: + type: object + selector: + properties: + matchExpressions: + items: + properties: + key: type: string - type: object + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string type: object - x-kubernetes-map-type: atomic - storageClassName: - type: string - volumeMode: - type: string - volumeName: - type: string type: object - required: - - spec - type: object - type: object - fc: - properties: - fsType: - type: string - lun: - format: int32 - type: integer - readOnly: - type: boolean - targetWWNs: - items: - type: string - type: array - wwids: - items: - type: string - type: array - type: object - flexVolume: - properties: - driver: - type: string - fsType: - type: string - options: - additionalProperties: - type: string - type: object - readOnly: - type: boolean - secretRef: - properties: - name: + x-kubernetes-map-type: atomic + storageClassName: type: string - type: object - x-kubernetes-map-type: atomic - required: - - driver - type: object - flocker: - properties: - datasetName: - type: string - datasetUUID: - type: string - type: object - gcePersistentDisk: - properties: - fsType: - type: string - partition: - format: int32 - type: integer - pdName: - type: string - readOnly: - type: boolean - required: - - pdName - type: object - gitRepo: - properties: - directory: - type: string - repository: - type: string - revision: - type: string - required: - - repository - type: object - glusterfs: - properties: - endpoints: - type: string - path: - type: string - readOnly: - type: boolean - required: - - endpoints - - path - type: object - hostPath: - properties: - path: - type: string - type: - type: string - required: - - path - type: object - iscsi: - properties: - chapAuthDiscovery: - type: boolean - chapAuthSession: - type: boolean - fsType: - type: string - initiatorName: - type: string - iqn: - type: string - iscsiInterface: - type: string - lun: - format: int32 - type: integer - portals: - items: - type: string - type: array - readOnly: - type: boolean - secretRef: - properties: - name: + volumeMode: + type: string + volumeName: type: string type: object - x-kubernetes-map-type: atomic - targetPortal: - type: string required: - - iqn - - lun - - targetPortal + - spec type: object - name: + type: object + fc: + properties: + fsType: type: string - nfs: - properties: - path: - type: string - readOnly: - type: boolean - server: - type: string - required: - - path - - server - type: object - persistentVolumeClaim: - properties: - claimName: - type: string - readOnly: - type: boolean - required: - - claimName + lun: + format: int32 + type: integer + readOnly: + type: boolean + targetWWNs: + items: + type: string + type: array + wwids: + items: + type: string + type: array + type: object + flexVolume: + properties: + driver: + type: string + fsType: + type: string + options: + additionalProperties: + type: string type: object - photonPersistentDisk: + readOnly: + type: boolean + secretRef: properties: - fsType: - type: string - pdID: + name: type: string - required: - - pdID type: object - portworxVolume: + x-kubernetes-map-type: atomic + required: + - driver + type: object + flocker: + properties: + datasetName: + type: string + datasetUUID: + type: string + type: object + gcePersistentDisk: + properties: + fsType: + type: string + partition: + format: int32 + type: integer + pdName: + type: string + readOnly: + type: boolean + required: + - pdName + type: object + gitRepo: + properties: + directory: + type: string + repository: + type: string + revision: + type: string + required: + - repository + type: object + glusterfs: + properties: + endpoints: + type: string + path: + type: string + readOnly: + type: boolean + required: + - endpoints + - path + type: object + hostPath: + properties: + path: + type: string + type: + type: string + required: + - path + type: object + iscsi: + properties: + chapAuthDiscovery: + type: boolean + chapAuthSession: + type: boolean + fsType: + type: string + initiatorName: + type: string + iqn: + type: string + iscsiInterface: + type: string + lun: + format: int32 + type: integer + portals: + items: + type: string + type: array + readOnly: + type: boolean + secretRef: properties: - fsType: - type: string - readOnly: - type: boolean - volumeID: + name: type: string - required: - - volumeID type: object - projected: - properties: - defaultMode: - format: int32 - type: integer - sources: - items: + x-kubernetes-map-type: atomic + targetPortal: + type: string + required: + - iqn + - lun + - targetPortal + type: object + name: + type: string + nfs: + properties: + path: + type: string + readOnly: + type: boolean + server: + type: string + required: + - path + - server + type: object + persistentVolumeClaim: + properties: + claimName: + type: string + readOnly: + type: boolean + required: + - claimName + type: object + photonPersistentDisk: + properties: + fsType: + type: string + pdID: + type: string + required: + - pdID + type: object + portworxVolume: + properties: + fsType: + type: string + readOnly: + type: boolean + volumeID: + type: string + required: + - volumeID + type: object + projected: + properties: + defaultMode: + format: int32 + type: integer + sources: + items: + properties: + configMap: properties: - configMap: - properties: - items: - items: + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + required: + - key + - path + type: object + type: array + name: + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + downwardAPI: + properties: + items: + items: + properties: + fieldRef: properties: - key: + apiVersion: type: string - mode: - format: int32 - type: integer - path: + fieldPath: type: string required: - - key - - path + - fieldPath type: object - type: array - name: - type: string - optional: - type: boolean - type: object - x-kubernetes-map-type: atomic - downwardAPI: - properties: - items: - items: - properties: - fieldRef: - properties: - apiVersion: - type: string - fieldPath: - type: string - required: - - fieldPath - type: object - x-kubernetes-map-type: atomic - mode: - format: int32 - type: integer - path: - type: string - resourceFieldRef: - properties: - containerName: - type: string - divisor: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - type: string - required: - - resource - type: object - x-kubernetes-map-type: atomic - required: - - path - type: object - type: array - type: object - secret: - properties: - items: - items: + x-kubernetes-map-type: atomic + mode: + format: int32 + type: integer + path: + type: string + resourceFieldRef: properties: - key: + containerName: type: string - mode: - format: int32 - type: integer - path: + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: type: string required: - - key - - path + - resource type: object - type: array - name: - type: string - optional: - type: boolean - type: object - x-kubernetes-map-type: atomic - serviceAccountToken: - properties: - audience: - type: string - expirationSeconds: - format: int64 - type: integer - path: - type: string - required: - - path - type: object + x-kubernetes-map-type: atomic + required: + - path + type: object + type: array type: object - type: array - type: object - quobyte: - properties: - group: - type: string - readOnly: - type: boolean - registry: - type: string - tenant: - type: string - user: - type: string - volume: - type: string - required: - - registry - - volume - type: object - rbd: - properties: - fsType: - type: string - image: - type: string - keyring: - type: string - monitors: - items: - type: string - type: array - pool: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - x-kubernetes-map-type: atomic - user: - type: string - required: - - image - - monitors - type: object - scaleIO: - properties: - fsType: - type: string - gateway: - type: string - protectionDomain: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - x-kubernetes-map-type: atomic - sslEnabled: - type: boolean - storageMode: - type: string - storagePool: - type: string - system: - type: string - volumeName: - type: string - required: - - gateway - - secretRef - - system - type: object - secret: - properties: - defaultMode: - format: int32 - type: integer - items: - items: + secret: + properties: + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + required: + - key + - path + type: object + type: array + name: + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + serviceAccountToken: properties: - key: + audience: type: string - mode: - format: int32 + expirationSeconds: + format: int64 type: integer path: type: string required: - - key - path type: object - type: array - optional: - type: boolean - secretName: + type: object + type: array + type: object + quobyte: + properties: + group: + type: string + readOnly: + type: boolean + registry: + type: string + tenant: + type: string + user: + type: string + volume: + type: string + required: + - registry + - volume + type: object + rbd: + properties: + fsType: + type: string + image: + type: string + keyring: + type: string + monitors: + items: + type: string + type: array + pool: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: type: string type: object - storageos: + x-kubernetes-map-type: atomic + user: + type: string + required: + - image + - monitors + type: object + scaleIO: + properties: + fsType: + type: string + gateway: + type: string + protectionDomain: + type: string + readOnly: + type: boolean + secretRef: properties: - fsType: - type: string - readOnly: - type: boolean - secretRef: - properties: - name: - type: string - type: object - x-kubernetes-map-type: atomic - volumeName: - type: string - volumeNamespace: + name: type: string type: object - vsphereVolume: + x-kubernetes-map-type: atomic + sslEnabled: + type: boolean + storageMode: + type: string + storagePool: + type: string + system: + type: string + volumeName: + type: string + required: + - gateway + - secretRef + - system + type: object + secret: + properties: + defaultMode: + format: int32 + type: integer + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + required: + - key + - path + type: object + type: array + optional: + type: boolean + secretName: + type: string + type: object + storageos: + properties: + fsType: + type: string + readOnly: + type: boolean + secretRef: properties: - fsType: - type: string - storagePolicyID: - type: string - storagePolicyName: - type: string - volumePath: + name: type: string - required: - - volumePath type: object + x-kubernetes-map-type: atomic + volumeName: + type: string + volumeNamespace: + type: string + type: object + vsphereVolume: + properties: + fsType: + type: string + storagePolicyID: + type: string + storagePolicyName: + type: string + volumePath: + type: string required: - - name + - volumePath type: object - type: array - required: - - mounts - - volumes - type: object - type: array - hostName: + required: + - name + type: object + type: array + required: + - mounts + - volumes + type: object + type: array + hostName: + type: string + managementNetwork: + type: string + networkConfig: + properties: + template: type: string - managementNetwork: + type: object + networkData: + properties: + name: + type: string + namespace: type: string - networkConfig: - properties: - template: - type: string - type: object - networkData: - properties: - name: - type: string - namespace: - type: string - type: object - x-kubernetes-map-type: atomic - networks: - items: - properties: - defaultRoute: - type: boolean - fixedIP: - type: string - name: - pattern: ^[a-zA-Z0-9][a-zA-Z0-9\-_]*[a-zA-Z0-9]$ - type: string - subnetName: - pattern: ^[a-zA-Z0-9][a-zA-Z0-9\-_]*[a-zA-Z0-9]$ - type: string - required: - - name - - subnetName - type: object - type: array - userData: - properties: - name: - type: string - namespace: - type: string - type: object - x-kubernetes-map-type: atomic type: object - type: object - userData: - properties: - name: - type: string - namespace: - type: string - type: object - x-kubernetes-map-type: atomic - required: - - nodes + x-kubernetes-map-type: atomic + networks: + items: + properties: + defaultRoute: + type: boolean + fixedIP: + type: string + name: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9\-_]*[a-zA-Z0-9]$ + type: string + subnetName: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9\-_]*[a-zA-Z0-9]$ + type: string + required: + - name + - subnetName + type: object + type: array + userData: + properties: + name: + type: string + namespace: + type: string + type: object + x-kubernetes-map-type: atomic + type: object type: object preProvisioned: type: boolean @@ -1904,9 +1886,16 @@ spec: type: array required: - nodeTemplate + - nodes type: object status: properties: + CtlplaneSearchDomain: + type: string + DNSClusterAddresses: + items: + type: string + type: array conditions: items: properties: diff --git a/config/crd/kustomization.yaml b/config/crd/kustomization.yaml index d9837f7ad..f292bb167 100644 --- a/config/crd/kustomization.yaml +++ b/config/crd/kustomization.yaml @@ -4,6 +4,7 @@ resources: - bases/dataplane.openstack.org_openstackdataplanenodesets.yaml - bases/dataplane.openstack.org_openstackdataplaneservices.yaml +- bases/dataplane.openstack.org_openstackdataplanedeployments.yaml #+kubebuilder:scaffold:crdkustomizeresource patchesStrategicMerge: @@ -13,6 +14,7 @@ patchesStrategicMerge: #- patches/webhook_in_openstackdataplaneroles.yaml #- patches/webhook_in_openstackdataplanenodes.yaml #- patches/webhook_in_openstackdataplaneservices.yaml +#- patches/webhook_in_openstackdataplanedeployments.yaml #+kubebuilder:scaffold:crdkustomizewebhookpatch # [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix. @@ -21,6 +23,7 @@ patchesStrategicMerge: #- patches/cainjection_in_openstackdataplaneroles.yaml #- patches/cainjection_in_openstackdataplanenodes.yaml #- patches/cainjection_in_openstackdataplaneservices.yaml +#- patches/cainjection_in_openstackdataplanedeployments.yaml #+kubebuilder:scaffold:crdkustomizecainjectionpatch # the following config is for teaching kustomize how to do kustomization for CRDs. diff --git a/config/crd/patches/cainjection_in_openstackdataplanedeployments.yaml b/config/crd/patches/cainjection_in_openstackdataplanedeployments.yaml new file mode 100644 index 000000000..0411aef54 --- /dev/null +++ b/config/crd/patches/cainjection_in_openstackdataplanedeployments.yaml @@ -0,0 +1,7 @@ +# The following patch adds a directive for certmanager to inject CA into the CRD +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) + name: openstackdataplanedeployments.dataplane.openstack.org diff --git a/config/crd/patches/webhook_in_openstackdataplanedeployments.yaml b/config/crd/patches/webhook_in_openstackdataplanedeployments.yaml new file mode 100644 index 000000000..d12cf7ec8 --- /dev/null +++ b/config/crd/patches/webhook_in_openstackdataplanedeployments.yaml @@ -0,0 +1,16 @@ +# The following patch enables a conversion webhook for the CRD +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: openstackdataplanedeployments.dataplane.openstack.org +spec: + conversion: + strategy: Webhook + webhook: + clientConfig: + service: + namespace: system + name: webhook-service + path: /convert + conversionReviewVersions: + - v1 diff --git a/config/rbac/openstackdataplanedeployment_editor_role.yaml b/config/rbac/openstackdataplanedeployment_editor_role.yaml new file mode 100644 index 000000000..2a699d9f7 --- /dev/null +++ b/config/rbac/openstackdataplanedeployment_editor_role.yaml @@ -0,0 +1,31 @@ +# permissions for end users to edit openstackdataplanedeployments. +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + labels: + app.kubernetes.io/name: clusterrole + app.kubernetes.io/instance: openstackdataplanedeployment-editor-role + app.kubernetes.io/component: rbac + app.kubernetes.io/created-by: dataplane-operator + app.kubernetes.io/part-of: dataplane-operator + app.kubernetes.io/managed-by: kustomize + name: openstackdataplanedeployment-editor-role +rules: +- apiGroups: + - dataplane.openstack.org + resources: + - openstackdataplanedeployments + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - dataplane.openstack.org + resources: + - openstackdataplanedeployments/status + verbs: + - get diff --git a/config/rbac/openstackdataplanedeployment_viewer_role.yaml b/config/rbac/openstackdataplanedeployment_viewer_role.yaml new file mode 100644 index 000000000..7dfe913b6 --- /dev/null +++ b/config/rbac/openstackdataplanedeployment_viewer_role.yaml @@ -0,0 +1,27 @@ +# permissions for end users to view openstackdataplanedeployments. +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + labels: + app.kubernetes.io/name: clusterrole + app.kubernetes.io/instance: openstackdataplanedeployment-viewer-role + app.kubernetes.io/component: rbac + app.kubernetes.io/created-by: dataplane-operator + app.kubernetes.io/part-of: dataplane-operator + app.kubernetes.io/managed-by: kustomize + name: openstackdataplanedeployment-viewer-role +rules: +- apiGroups: + - dataplane.openstack.org + resources: + - openstackdataplanedeployments + verbs: + - get + - list + - watch +- apiGroups: + - dataplane.openstack.org + resources: + - openstackdataplanedeployments/status + verbs: + - get diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index 05df34e70..de33a0149 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -77,6 +77,32 @@ rules: - patch - update - watch +- apiGroups: + - dataplane.openstack.org + resources: + - openstackdataplanedeployments + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - dataplane.openstack.org + resources: + - openstackdataplanedeployments/finalizers + verbs: + - update +- apiGroups: + - dataplane.openstack.org + resources: + - openstackdataplanedeployments/status + verbs: + - get + - patch + - update - apiGroups: - dataplane.openstack.org resources: diff --git a/config/samples/dataplane_v1beta1_openstackdataplane_baremetal_with_ipam.yaml b/config/samples/dataplane_v1beta1_openstackdataplane_baremetal_with_ipam.yaml deleted file mode 120000 index 92b6662a9..000000000 --- a/config/samples/dataplane_v1beta1_openstackdataplane_baremetal_with_ipam.yaml +++ /dev/null @@ -1 +0,0 @@ -dataplane_v1beta1_openstackdataplanenodeset_baremetal_with_ipam.yaml \ No newline at end of file diff --git a/config/samples/dataplane_v1beta1_openstackdataplane_with_ipam.yaml b/config/samples/dataplane_v1beta1_openstackdataplane_with_ipam.yaml deleted file mode 120000 index b834a2f12..000000000 --- a/config/samples/dataplane_v1beta1_openstackdataplane_with_ipam.yaml +++ /dev/null @@ -1 +0,0 @@ -dataplane_v1beta1_openstackdataplanenodeset.yaml \ No newline at end of file diff --git a/config/samples/dataplane_v1beta1_openstackdataplanedeployment.yaml b/config/samples/dataplane_v1beta1_openstackdataplanedeployment.yaml new file mode 100644 index 000000000..3f7c3921d --- /dev/null +++ b/config/samples/dataplane_v1beta1_openstackdataplanedeployment.yaml @@ -0,0 +1,7 @@ +apiVersion: dataplane.openstack.org/v1beta1 +kind: OpenStackDataPlaneDeployment +metadata: + name: openstack-edpm +spec: + nodeSets: + - openstack-edpm diff --git a/config/samples/dataplane_v1beta1_openstackdataplanedeployment_baremetal_with_ipam.yaml b/config/samples/dataplane_v1beta1_openstackdataplanedeployment_baremetal_with_ipam.yaml new file mode 100644 index 000000000..a88134791 --- /dev/null +++ b/config/samples/dataplane_v1beta1_openstackdataplanedeployment_baremetal_with_ipam.yaml @@ -0,0 +1,7 @@ +apiVersion: dataplane.openstack.org/v1beta1 +kind: OpenStackDataPlaneDeployment +metadata: + name: openstack-edpm-ipam +spec: + nodeSets: + - openstack-edpm-ipam diff --git a/config/samples/dataplane_v1beta1_openstackdataplanenodeset.yaml b/config/samples/dataplane_v1beta1_openstackdataplanenodeset.yaml index 8061e0451..daa35bd4d 100644 --- a/config/samples/dataplane_v1beta1_openstackdataplanenodeset.yaml +++ b/config/samples/dataplane_v1beta1_openstackdataplanenodeset.yaml @@ -20,25 +20,22 @@ spec: - nova - telemetry preProvisioned: true - deployStrategy: - deploy: true + nodes: + edpm-compute-0: + hostName: edpm-compute-0 + ansible: + ansibleHost: 192.168.122.100 + ansibleVars: + ctlplane_ip: 192.168.122.100 + internal_api_ip: 172.17.0.100 + storage_ip: 172.18.0.100 + tenant_ip: 172.19.0.100 + fqdn_internal_api: edpm-compute-0.example.com nodeTemplate: ansibleSSHPrivateKeySecret: dataplane-ansible-ssh-private-key-secret - nodes: - edpm-compute-0: - hostName: edpm-compute-0 - ansible: - ansibleHost: 192.168.122.100 - ansibleUser: root - ansibleVars: - ctlplane_ip: 192.168.122.100 - internal_api_ip: 172.17.0.100 - storage_ip: 172.18.0.100 - tenant_ip: 172.19.0.100 - fqdn_internal_api: edpm-compute-0.example.com managementNetwork: ctlplane ansible: - ansibleUser: root + ansibleUser: cloud-admin ansiblePort: 22 ansibleVars: service_net_map: @@ -89,16 +86,9 @@ spec: # edpm_nodes_validation edpm_nodes_validation_validate_controllers_icmp: false edpm_nodes_validation_validate_gateway_icmp: false - edpm_ovn_metadata_agent_DEFAULT_transport_url: rabbit://default_user@rabbitmq.openstack.svc:5672 - edpm_ovn_metadata_agent_metadata_agent_ovn_ovn_sb_connection: tcp:10.217.5.121:6642 - edpm_ovn_metadata_agent_metadata_agent_DEFAULT_nova_metadata_host: 127.0.0.1 - edpm_ovn_metadata_agent_metadata_agent_DEFAULT_metadata_proxy_shared_secret: 12345678 - edpm_ovn_metadata_agent_DEFAULT_bind_host: 127.0.0.1 ctlplane_dns_nameservers: - 192.168.122.1 dns_search_domains: [] - edpm_ovn_dbs: - - 192.168.122.1 registry_url: quay.io/podified-antelope-centos9 image_tag: current-podified edpm_ovn_controller_agent_image: "{{ registry_url }}/openstack-ovn-controller:{{ image_tag }}" diff --git a/config/samples/dataplane_v1beta1_openstackdataplanenodeset_baremetal.yaml b/config/samples/dataplane_v1beta1_openstackdataplanenodeset_baremetal.yaml index 4b36c8595..297f95318 100644 --- a/config/samples/dataplane_v1beta1_openstackdataplanenodeset_baremetal.yaml +++ b/config/samples/dataplane_v1beta1_openstackdataplanenodeset_baremetal.yaml @@ -10,6 +10,7 @@ spec: - name: ANSIBLE_ENABLE_TASK_DEBUGGER value: "True" services: + - download-cache - configure-network - validate-network - install-os @@ -22,7 +23,6 @@ spec: deployStrategy: deploy: false baremetalSetTemplate: - deploymentSSHSecret: dataplane-ansible-ssh-private-key-secret bmhLabelSelector: app: openstack ctlplaneInterface: enp1s0 @@ -33,105 +33,101 @@ spec: - 192.168.111.1 dnsSearchDomains: - osptest.openstack.org - nodeTemplate: - ansibleSSHPrivateKeySecret: dataplane-ansible-ssh-private-key-secret - nodes: - edpm-compute-0: - hostName: edpm-compute-0 - ansible: - ansibleHost: 192.168.111.100 - ansibleVars: - ctlplane_ip: 192.168.111.100 - internal_api_ip: 172.17.0.100 - storage_ip: 172.18.0.100 - tenant_ip: 172.19.0.100 - fqdn_internal_api: edpm-compute-0.example.com - edpm-compute-1: - hostName: edpm-compute-1 - ansible: - ansibleHost: 192.168.111.101 - ansibleVars: - ctlplane_ip: 192.168.111.101 - internal_api_ip: 172.17.0.101 - storage_ip: 172.18.0.101 - tenant_ip: 172.19.0.101 - fqdn_internal_api: edpm-compute-1.example.com + nodes: + edpm-compute-0: + hostName: edpm-compute-0 + ansible: + ansibleHost: 192.168.111.100 + ansibleVars: + ctlplane_ip: 192.168.111.100 + internal_api_ip: 172.17.0.100 + storage_ip: 172.18.0.100 + tenant_ip: 172.19.0.100 + fqdn_internal_api: edpm-compute-0.example.com + edpm-compute-1: + hostName: edpm-compute-1 ansible: - ansibleUser: cloud-admin - ansiblePort: 22 + ansibleHost: 192.168.111.101 ansibleVars: - service_net_map: - nova_api_network: internal_api - nova_libvirt_network: internal_api - edpm_chrony_ntp_servers: - - pool.ntp.org - # edpm_network_config - # Default nic config template for a EDPM compute node - # These vars are edpm_network_config role vars - edpm_network_config_template: templates/single_nic_vlans/single_nic_vlans.j2 - edpm_network_config_hide_sensitive_logs: false + ctlplane_ip: 192.168.111.101 + internal_api_ip: 172.17.0.101 + storage_ip: 172.18.0.101 + tenant_ip: 172.19.0.101 + fqdn_internal_api: edpm-compute-1.example.com + nodeTemplate: + ansibleSSHPrivateKeySecret: dataplane-ansible-ssh-private-key-secret + ansible: + ansibleUser: cloud-admin + ansiblePort: 22 + ansibleVars: + service_net_map: + nova_api_network: internal_api + nova_libvirt_network: internal_api + edpm_chrony_ntp_servers: + - pool.ntp.org + # edpm_network_config + # Default nic config template for a EDPM compute node + # These vars are edpm_network_config role vars + edpm_network_config_template: templates/single_nic_vlans/single_nic_vlans.j2 + edpm_network_config_hide_sensitive_logs: false - # 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_subnet_cidr: 24 - ctlplane_gateway_ip: 192.168.111.1 - ctlplane_host_routes: - - ip_netmask: 0.0.0.0/0 - next_hop: 192.168.111.1 - external_mtu: 1500 - external_vlan_id: 44 - external_cidr: '24' - external_host_routes: [] - internal_api_mtu: 1500 - internal_api_vlan_id: 20 - internal_api_cidr: '24' - internal_api_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: internal_api - Storage: storage - Tenant: tenant + # 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_subnet_cidr: 24 + ctlplane_gateway_ip: 192.168.111.1 + ctlplane_host_routes: + - ip_netmask: 0.0.0.0/0 + next_hop: 192.168.111.1 + external_mtu: 1500 + external_vlan_id: 44 + external_cidr: '24' + external_host_routes: [] + internal_api_mtu: 1500 + internal_api_vlan_id: 20 + internal_api_cidr: '24' + internal_api_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: internal_api + Storage: storage + Tenant: tenant - # edpm_nodes_validation - edpm_nodes_validation_validate_controllers_icmp: false - edpm_nodes_validation_validate_gateway_icmp: false + # edpm_nodes_validation + edpm_nodes_validation_validate_controllers_icmp: false + edpm_nodes_validation_validate_gateway_icmp: false - edpm_ovn_metadata_agent_metadata_agent_DEFAULT_metadata_proxy_shared_secret: 12345678 - edpm_ovn_metadata_agent_DEFAULT_bind_host: 127.0.0.1 - ctlplane_dns_nameservers: - - 192.168.111.1 - dns_search_domains: [] + ctlplane_dns_nameservers: + - 192.168.111.1 + dns_search_domains: [] - registry_url: quay.io/podified-antelope-centos9 - image_tag: current-podified - edpm_ovn_controller_agent_image: "{{ registry_url }}/openstack-ovn-controller:{{ image_tag }}" - edpm_iscsid_image: "{{ registry_url }}/openstack-iscsid:{{ image_tag }}" - edpm_logrotate_crond_image: "{{ registry_url }}/openstack-cron:{{ image_tag }}" - edpm_nova_compute_container_image: "{{ registry_url }}/openstack-nova-compute:{{ image_tag }}" - edpm_nova_libvirt_container_image: "{{ registry_url }}/openstack-nova-libvirt:{{ image_tag }}" - edpm_ovn_metadata_agent_image: "{{ registry_url }}/openstack-neutron-metadata-agent-ovn:{{ image_tag }}" + registry_url: quay.io/podified-antelope-centos9 + image_tag: current-podified + edpm_ovn_controller_agent_image: "{{ registry_url }}/openstack-ovn-controller:{{ image_tag }}" + edpm_iscsid_image: "{{ registry_url }}/openstack-iscsid:{{ image_tag }}" + edpm_logrotate_crond_image: "{{ registry_url }}/openstack-cron:{{ image_tag }}" + edpm_nova_compute_container_image: "{{ registry_url }}/openstack-nova-compute:{{ image_tag }}" + edpm_nova_libvirt_container_image: "{{ registry_url }}/openstack-nova-libvirt:{{ image_tag }}" + edpm_ovn_metadata_agent_image: "{{ registry_url }}/openstack-neutron-metadata-agent-ovn:{{ image_tag }}" - 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.111.0/24'] - # SELinux module - edpm_selinux_mode: enforcing - deployStrategy: - deploy: false + 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.111.0/24'] + # SELinux module + edpm_selinux_mode: enforcing diff --git a/config/samples/dataplane_v1beta1_openstackdataplanenodeset_baremetal_with_ipam.yaml b/config/samples/dataplane_v1beta1_openstackdataplanenodeset_baremetal_with_ipam.yaml index 686f5e603..468fbc784 100644 --- a/config/samples/dataplane_v1beta1_openstackdataplanenodeset_baremetal_with_ipam.yaml +++ b/config/samples/dataplane_v1beta1_openstackdataplanenodeset_baremetal_with_ipam.yaml @@ -22,16 +22,15 @@ spec: deployStrategy: deploy: true baremetalSetTemplate: - deploymentSSHSecret: dataplane-ansible-ssh-private-key-secret bmhLabelSelector: app: openstack ctlplaneInterface: enp1s0 cloudUserName: cloud-admin + nodes: + edpm-compute-0: + hostName: edpm-compute-0 nodeTemplate: ansibleSSHPrivateKeySecret: dataplane-ansible-ssh-private-key-secret - nodes: - edpm-compute-0: - hostName: edpm-compute-0 networks: - name: CtlPlane subnetName: subnet1 @@ -73,13 +72,6 @@ spec: # edpm_nodes_validation edpm_nodes_validation_validate_controllers_icmp: false edpm_nodes_validation_validate_gateway_icmp: false - edpm_ovn_metadata_agent_DEFAULT_transport_url: rabbit://default_user@rabbitmq.openstack.svc:5672 - edpm_ovn_metadata_agent_metadata_agent_ovn_ovn_sb_connection: tcp:10.217.5.121:6642 - edpm_ovn_metadata_agent_metadata_agent_DEFAULT_nova_metadata_host: 127.0.0.1 - edpm_ovn_metadata_agent_metadata_agent_DEFAULT_metadata_proxy_shared_secret: 12345678 - edpm_ovn_metadata_agent_DEFAULT_bind_host: 127.0.0.1 - edpm_ovn_dbs: - - 192.168.111.1 registry_url: quay.io/podified-antelope-centos9 image_tag: current-podified edpm_ovn_controller_agent_image: "{{ registry_url }}/openstack-ovn-controller:{{ image_tag }}" diff --git a/config/samples/dataplane_v1beta1_openstackdataplanenodeset_ceph.yaml b/config/samples/dataplane_v1beta1_openstackdataplanenodeset_ceph.yaml index 9914b69a0..d03970eca 100644 --- a/config/samples/dataplane_v1beta1_openstackdataplanenodeset_ceph.yaml +++ b/config/samples/dataplane_v1beta1_openstackdataplanenodeset_ceph.yaml @@ -11,31 +11,29 @@ spec: value: "True" deployStrategy: deploy: false + nodes: + edpm-compute-0: + hostName: edpm-compute-0 + ansible: + ansibleHost: 192.168.122.100 + ansibleVars: + ctlplane_ip: 192.168.122.100 + internal_api_ip: 172.17.0.100 + storage_ip: 172.18.0.100 + tenant_ip: 172.19.0.100 + fqdn_internal_api: edpm-compute-0.example.com + edpm-compute-1: + hostName: edpm-compute-1 + ansible: + ansibleHost: 192.168.122.101 + ansibleVars: + ctlplane_ip: 192.168.122.101 + internal_api_ip: 172.17.0.101 + storage_ip: 172.18.0.101 + tenant_ip: 172.19.0.101 + fqdn_internal_api: edpm-compute-1.example.com nodeTemplate: ansibleSSHPrivateKeySecret: dataplane-ansible-ssh-private-key-secret - nodes: - edpm-compute-0: - hostName: edpm-compute-0 - ansible: - ansibleHost: 192.168.122.100 - ansibleVars: - ctlplane_ip: 192.168.122.100 - internal_api_ip: 172.17.0.100 - storage_ip: 172.18.0.100 - tenant_ip: 172.19.0.100 - fqdn_internal_api: edpm-compute-0.example.com - deployStrategy: - deploy: false - edpm-compute-1: - hostName: edpm-compute-1 - ansible: - ansibleHost: 192.168.122.101 - ansibleVars: - ctlplane_ip: 192.168.122.101 - internal_api_ip: 172.17.0.101 - storage_ip: 172.18.0.101 - tenant_ip: 172.19.0.101 - fqdn_internal_api: edpm-compute-1.example.com preProvisioned: true extraMounts: - extraVolType: Ceph @@ -99,18 +97,11 @@ spec: # edpm_nodes_validation edpm_nodes_validation_validate_controllers_icmp: false edpm_nodes_validation_validate_gateway_icmp: false - edpm_ovn_metadata_agent_DEFAULT_transport_url: rabbit://default_user@rabbitmq.openstack.svc:5672 - edpm_ovn_metadata_agent_metadata_agent_ovn_ovn_sb_connection: tcp:10.217.5.121:6642 - edpm_ovn_metadata_agent_metadata_agent_DEFAULT_nova_metadata_host: 127.0.0.1 - edpm_ovn_metadata_agent_metadata_agent_DEFAULT_metadata_proxy_shared_secret: 12345678 - edpm_ovn_metadata_agent_DEFAULT_bind_host: 127.0.0.1 edpm_chrony_ntp_servers: - clock.redhat.com ctlplane_dns_nameservers: - 192.168.122.1 dns_search_domains: [] - edpm_ovn_dbs: - - 192.168.24.1 gather_facts: false enable_debug: false # edpm firewall, change the allowed CIDR if needed diff --git a/config/samples/dataplane_v1beta1_openstackdataplanenodeset_customnetworks.yaml b/config/samples/dataplane_v1beta1_openstackdataplanenodeset_customnetworks.yaml index bfd4d5ccb..4586aa979 100644 --- a/config/samples/dataplane_v1beta1_openstackdataplanenodeset_customnetworks.yaml +++ b/config/samples/dataplane_v1beta1_openstackdataplanenodeset_customnetworks.yaml @@ -26,23 +26,21 @@ spec: - telemetry deployStrategy: deploy: false + nodes: + edpm-compute-0: + hostName: edpm-compute-0 + ansible: + ansibleHost: 192.168.1.5 + ansibleVars: + ctlplane_ip: 192.168.1.5 + internal_api_ip: 172.17.0.101 + storage_ip: 172.18.0.101 + tenant_ip: 172.19.0.101 + external_ip: 172.20.12.76 + fqdn_internal_api: edpm-compute-1.example.com + ansible_ssh_transfer_method: scp nodeTemplate: ansibleSSHPrivateKeySecret: dataplane-ansible-ssh-private-key-secret - nodes: - edpm-compute-0: - hostName: edpm-compute-0 - ansible: - ansibleHost: 192.168.1.5 - ansibleVars: - ctlplane_ip: 192.168.1.5 - internal_api_ip: 172.17.0.101 - storage_ip: 172.18.0.101 - tenant_ip: 172.19.0.101 - external_ip: 172.20.12.76 - fqdn_internal_api: edpm-compute-1.example.com - ansible_ssh_transfer_method: scp - ansibleUser: cloud-admin - managed: false managementNetwork: ctlplane ansible: ansibleUser: cloud-admin @@ -94,16 +92,9 @@ spec: # edpm_nodes_validation edpm_nodes_validation_validate_controllers_icmp: false edpm_nodes_validation_validate_gateway_icmp: false - edpm_ovn_metadata_agent_DEFAULT_transport_url: rabbit://default_user@rabbitmq.openstack.svc:5672 - edpm_ovn_metadata_agent_metadata_agent_ovn_ovn_sb_connection: tcp:10.217.5.121:6642 - edpm_ovn_metadata_agent_metadata_agent_DEFAULT_nova_metadata_host: 127.0.0.1 - edpm_ovn_metadata_agent_metadata_agent_DEFAULT_metadata_proxy_shared_secret: 12345678 - edpm_ovn_metadata_agent_DEFAULT_bind_host: 127.0.0.1 ctlplane_dns_nameservers: - 192.168.1.254 dns_search_domains: [] - edpm_ovn_dbs: - - 192.168.24.1 edpm_ovn_controller_agent_image: quay.io/podified-antelope-centos9/openstack-ovn-controller:current-podified edpm_iscsid_image: quay.io/podified-antelope-centos9/openstack-iscsid:current-podified edpm_logrotate_crond_image: quay.io/podified-antelope-centos9/openstack-cron:current-podified diff --git a/config/samples/dataplane_v1beta1_openstackdataplanenodeset_with_ipam.yaml b/config/samples/dataplane_v1beta1_openstackdataplanenodeset_with_ipam.yaml index c3e7aa747..4f7e8a1d5 100644 --- a/config/samples/dataplane_v1beta1_openstackdataplanenodeset_with_ipam.yaml +++ b/config/samples/dataplane_v1beta1_openstackdataplanenodeset_with_ipam.yaml @@ -3,7 +3,6 @@ kind: OpenStackDataPlaneNodeSet metadata: name: openstack-edpm-ipam spec: - ansibleSSHPrivateKeySecret: dataplane-ansible-ssh-private-key-secret env: - name: ANSIBLE_FORCE_COLOR value: "True" @@ -22,38 +21,39 @@ spec: - libvirt - nova - telemetry + nodes: + edpm-compute-0: + hostName: edpm-compute-0 + ansible: + ansibleHost: 192.168.122.100 + networks: + - name: CtlPlane + subnetName: subnet1 + defaultRoute: true + fixedIP: 192.168.122.100 + - name: InternalApi + subnetName: subnet1 + - name: Storage + subnetName: subnet1 + - name: Tenant + subnetName: subnet1 + edpm-compute-1: + hostName: edpm-compute-1 + ansible: + ansibleHost: 192.168.122.101 + networks: + - name: CtlPlane + subnetName: subnet1 + defaultRoute: true + fixedIP: 192.168.122.101 + - name: InternalApi + subnetName: subnet1 + - name: Storage + subnetName: subnet1 + - name: Tenant + subnetName: subnet1 nodeTemplate: - nodes: - edpm-compute-0: - hostName: edpm-compute-0 - ansible: - ansibleHost: 192.168.122.100 - networks: - - name: CtlPlane - subnetName: subnet1 - defaultRoute: true - fixedIP: 192.168.122.100 - - name: InternalApi - subnetName: subnet1 - - name: Storage - subnetName: subnet1 - - name: Tenant - subnetName: subnet1 - edpm-compute-1: - hostName: edpm-compute-1 - ansible: - ansibleHost: 192.168.122.101 - networks: - - name: CtlPlane - subnetName: subnet1 - defaultRoute: true - fixedIP: 192.168.122.101 - - name: InternalApi - subnetName: subnet1 - - name: Storage - subnetName: subnet1 - - name: Tenant - subnetName: subnet1 + ansibleSSHPrivateKeySecret: dataplane-ansible-ssh-private-key-secret managementNetwork: ctlplane ansible: ansibleUser: cloud-admin @@ -84,16 +84,6 @@ spec: # edpm_nodes_validation edpm_nodes_validation_validate_controllers_icmp: false edpm_nodes_validation_validate_gateway_icmp: false - edpm_ovn_metadata_agent_DEFAULT_transport_url: rabbit://default_user@rabbitmq.openstack.svc:5672 - edpm_ovn_metadata_agent_metadata_agent_ovn_ovn_sb_connection: tcp:10.217.5.121:6642 - edpm_ovn_metadata_agent_metadata_agent_DEFAULT_nova_metadata_host: 127.0.0.1 - edpm_ovn_metadata_agent_metadata_agent_DEFAULT_metadata_proxy_shared_secret: 12345678 - edpm_ovn_metadata_agent_DEFAULT_bind_host: 127.0.0.1 - ctlplane_dns_nameservers: - - 192.168.122.1 - dns_search_domains: [] - edpm_ovn_dbs: - - 192.168.122.1 registry_url: quay.io/podified-antelope-centos9 image_tag: current-podified edpm_ovn_controller_agent_image: "{{ registry_url }}/openstack-ovn-controller:{{ image_tag }}" diff --git a/config/samples/kustomization.yaml b/config/samples/kustomization.yaml index dfdf1cdd7..5833b432c 100644 --- a/config/samples/kustomization.yaml +++ b/config/samples/kustomization.yaml @@ -4,4 +4,5 @@ resources: - dataplane_v1beta1_openstackdataplanenodeset_ceph.yaml - dataplane_v1beta1_openstackdataplanenodeset_customnetworks.yaml - dataplane_v1beta1_openstackdataplaneservice.yaml + - dataplane_v1beta1_openstackdataplanedeployment.yaml #+kubebuilder:scaffold:manifestskustomizesamples diff --git a/config/services/dataplane_v1beta1_openstackdataplaneservice_ovn.yaml b/config/services/dataplane_v1beta1_openstackdataplaneservice_ovn.yaml index 99ea889c0..5839380f3 100644 --- a/config/services/dataplane_v1beta1_openstackdataplaneservice_ovn.yaml +++ b/config/services/dataplane_v1beta1_openstackdataplaneservice_ovn.yaml @@ -7,3 +7,6 @@ spec: playbook: osp.edpm.ovn configMaps: - ovncontroller-config + secrets: + - neutron-ovn-metadata-agent-neutron-config + - nova-metadata-neutron-config diff --git a/controllers/openstackdataplanedeployment_controller.go b/controllers/openstackdataplanedeployment_controller.go new file mode 100644 index 000000000..fd54f89f7 --- /dev/null +++ b/controllers/openstackdataplanedeployment_controller.go @@ -0,0 +1,263 @@ +/* +Copyright 2023. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package controllers + +import ( + "context" + "fmt" + "time" + + corev1 "k8s.io/api/core/v1" + k8s_errors "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/types" + "k8s.io/client-go/kubernetes" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/log" + + "github.com/go-logr/logr" + dataplanev1 "github.com/openstack-k8s-operators/dataplane-operator/api/v1beta1" + "github.com/openstack-k8s-operators/dataplane-operator/pkg/deployment" + condition "github.com/openstack-k8s-operators/lib-common/modules/common/condition" + "github.com/openstack-k8s-operators/lib-common/modules/common/helper" + "github.com/openstack-k8s-operators/lib-common/modules/common/util" + "github.com/openstack-k8s-operators/openstack-ansibleee-operator/api/v1alpha1" +) + +// OpenStackDataPlaneDeploymentReconciler reconciles a OpenStackDataPlaneDeployment object +type OpenStackDataPlaneDeploymentReconciler struct { + client.Client + Kclient kubernetes.Interface + Scheme *runtime.Scheme + Log logr.Logger +} + +//+kubebuilder:rbac:groups=dataplane.openstack.org,resources=openstackdataplanedeployments,verbs=get;list;watch;create;update;patch;delete +//+kubebuilder:rbac:groups=dataplane.openstack.org,resources=openstackdataplanedeployments/status,verbs=get;update;patch +//+kubebuilder:rbac:groups=dataplane.openstack.org,resources=openstackdataplanedeployments/finalizers,verbs=update +//+kubebuilder:rbac:groups=dataplane.openstack.org,resources=openstackdataplanenodesets,verbs=get;list;watch;create;update;patch;delete +//+kubebuilder:rbac:groups=dataplane.openstack.org,resources=openstackdataplanenodesets/status,verbs=get;update;patch +//+kubebuilder:rbac:groups=dataplane.openstack.org,resources=openstackdataplanenodesets/finalizers,verbs=update +//+kubebuilder:rbac:groups=dataplane.openstack.org,resources=openstackdataplaneservices,verbs=get;list;watch;create;update;patch;delete +//+kubebuilder:rbac:groups=dataplane.openstack.org,resources=openstackdataplaneservices/status,verbs=get;update;patch +//+kubebuilder:rbac:groups=dataplane.openstack.org,resources=openstackdataplaneservices/finalizers,verbs=update +//+kubebuilder:rbac:groups=ansibleee.openstack.org,resources=openstackansibleees,verbs=get;list;watch;create;update;patch;delete +//+kubebuilder:rbac:groups=baremetal.openstack.org,resources=openstackbaremetalsets,verbs=get;list;watch;create;update;patch;delete +//+kubebuilder:rbac:groups=core,resources=configmaps,verbs=get;list;watch;create;update;patch;delete; +//+kubebuilder:rbac:groups=core,resources=secrets,verbs=get;list;watch;create;update;patch;delete; +//+kubebuilder:rbac:groups=batch,resources=jobs,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=network.openstack.org,resources=ipsets,verbs=get;list;watch;create;update;patch;delete +//+kubebuilder:rbac:groups=network.openstack.org,resources=ipsets/status,verbs=get +//+kubebuilder:rbac:groups=network.openstack.org,resources=ipsets/finalizers,verbs=update +//+kubebuilder:rbac:groups=network.openstack.org,resources=netconfigs,verbs=get;list;watch +//+kubebuilder:rbac:groups=network.openstack.org,resources=dnsmasqs,verbs=get;list;watch +//+kubebuilder:rbac:groups=network.openstack.org,resources=dnsmasqs/status,verbs=get +//+kubebuilder:rbac:groups=network.openstack.org,resources=dnsdata,verbs=get;list;watch;create;update;patch;delete +//+kubebuilder:rbac:groups=network.openstack.org,resources=dnsdata/status,verbs=get +//+kubebuilder:rbac:groups=network.openstack.org,resources=dnsdata/finalizers,verbs=update +//+kubebuilder:rbac:groups=core,resources=services,verbs=get;list;watch;create;update;patch;delete; + +// Reconcile is part of the main kubernetes reconciliation loop which aims to +// move the current state of the cluster closer to the desired state. +func (r *OpenStackDataPlaneDeploymentReconciler) Reconcile(ctx context.Context, req ctrl.Request) (result ctrl.Result, _err error) { + + logger := log.FromContext(ctx) + logger.Info("Reconciling Deployment") + + // Fetch the OpenStackDataPlaneDeployment instance + instance := &dataplanev1.OpenStackDataPlaneDeployment{} + err := r.Client.Get(ctx, req.NamespacedName, instance) + if err != nil { + if k8s_errors.IsNotFound(err) { + // Request object not found, could have been deleted after reconcile request. + // Owned objects are automatically garbage collected. + // For additional cleanup logic use finalizers. Return and don't requeue. + return ctrl.Result{}, nil + } + // Error reading the object - requeue the request. + return ctrl.Result{}, err + } + + helper, _ := helper.NewHelper( + instance, + r.Client, + r.Kclient, + r.Scheme, + logger, + ) + if err != nil { + return ctrl.Result{}, err + } + + // Always patch the instance status when exiting this function so we can persist any changes. + defer func() { // update the Ready condition based on the sub conditions + if instance.Status.Conditions.AllSubConditionIsTrue() { + instance.Status.Conditions.MarkTrue( + condition.ReadyCondition, condition.ReadyMessage) + } else { + // something is not ready so reset the Ready condition + instance.Status.Conditions.MarkUnknown( + condition.ReadyCondition, condition.InitReason, condition.ReadyInitMessage) + // and recalculate it based on the state of the rest of the conditions + instance.Status.Conditions.Set( + instance.Status.Conditions.Mirror(condition.ReadyCondition)) + } + err := helper.PatchInstance(ctx, instance) + if err != nil { + logger.Error(err, "Error updating instance status conditions") + _err = err + return + } + }() + + // If the deploy is already done, return immediately. + if instance.Status.Deployed { + logger.Info("Already deployed", "instance.Status.Deployed", instance.Status.Deployed) + return ctrl.Result{}, nil + } + + // Initialize Status + if instance.Status.Conditions == nil { + instance.InitConditions() + // Register overall status immediately to have an early feedback e.g. + // in the cli + return ctrl.Result{}, nil + } + + // All setup tasks done + // Mark SetupReadyCondition=True + instance.Status.Conditions.MarkTrue(dataplanev1.SetupReadyCondition, condition.ReadyMessage) + + // Ensure NodeSets + nodeSets := dataplanev1.OpenStackDataPlaneNodeSetList{} + for _, nodeSet := range instance.Spec.NodeSets { + + // Fetch the OpenStackDataPlaneNodeSet instance + nodeSetInstance := &dataplanev1.OpenStackDataPlaneNodeSet{} + err := r.Client.Get( + ctx, + types.NamespacedName{ + Namespace: instance.GetNamespace(), + Name: nodeSet}, + nodeSetInstance) + if err != nil { + // NodeSet not found, force a requeue + if k8s_errors.IsNotFound(err) { + logger.Info("NodeSet not found", "NodeSet", nodeSet) + return ctrl.Result{RequeueAfter: time.Second * 15}, nil + } + // Error reading the object - requeue the request. + return ctrl.Result{}, err + } + nodeSets.Items = append(nodeSets.Items, *nodeSetInstance) + } + + // Check that all nodeSets are SetupReady + for _, nodeSet := range nodeSets.Items { + if !nodeSet.Status.Conditions.IsTrue(dataplanev1.SetupReadyCondition) { + logger.Info("NodeSet SetupReadyCondition is not True", "NodeSet", nodeSet.Name) + return ctrl.Result{RequeueAfter: time.Second * 15}, nil + } + } + + // All nodeSets successfully fetched. + // Mark InputReadyCondition=True + instance.Status.Conditions.MarkTrue(condition.InputReadyCondition, condition.ReadyMessage) + + // 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 { + + logger.Info(fmt.Sprintf("Deploying NodeSet: %s", nodeSet.Name)) + logger.Info("Set Status.Deployed to false", "instance", instance) + instance.Status.Deployed = false + logger.Info("Set DeploymentReadyCondition false", "instance", instance) + instance.Status.Conditions.Set(condition.FalseCondition( + condition.DeploymentReadyCondition, condition.RequestedReason, + condition.SeverityInfo, condition.DeploymentReadyRunningMessage)) + ansibleEESpec := nodeSet.GetAnsibleEESpec() + ansibleEESpec.AnsibleTags = instance.Spec.AnsibleTags + ansibleEESpec.AnsibleSkipTags = instance.Spec.AnsibleSkipTags + ansibleEESpec.AnsibleLimit = instance.Spec.AnsibleLimit + + nodeSetSecretInv := fmt.Sprintf("dataplanenodeset-%s", nodeSet.Name) + + if nodeSet.Status.DNSClusterAddresses != nil && nodeSet.Status.CtlplaneSearchDomain != "" { + ansibleEESpec.DNSConfig = &corev1.PodDNSConfig{ + Nameservers: nodeSet.Status.DNSClusterAddresses, + Searches: []string{nodeSet.Status.CtlplaneSearchDomain}, + } + } + + deployResult, err := deployment.Deploy( + ctx, helper, &nodeSet, instance, + nodeSetSecretInv, &instance.Status, ansibleEESpec, + nodeSet.Spec.Services) + + if err != nil { + util.LogErrorForObject(helper, err, fmt.Sprintf("OpenStackDeployment error for NodeSet %s", nodeSet.Name), instance) + haveError = true + instance.Status.Conditions.Set(condition.FalseCondition( + condition.ReadyCondition, + condition.ErrorReason, + condition.SeverityWarning, + dataplanev1.DataPlaneNodeSetErrorMessage, + err.Error())) + } + + if deployResult != nil { + shouldRequeue = true + } else { + logger.Info("OpenStackDeployment succeeded for NodeSet", "NodeSet", nodeSet.Name) + logger.Info("Set NodeSetDeploymentReadyCondition true", "nodeSet", nodeSet.Name) + instance.Status.Conditions.Set( + condition.TrueCondition( + condition.Type(fmt.Sprintf(dataplanev1.NodeSetDeploymentReadyCondition, nodeSet.Name)), + condition.DeploymentReadyMessage)) + } + } + + if haveError { + return ctrl.Result{}, err + } + + if shouldRequeue { + logger.Info("Not all NodeSets done for OpenStackDeployment") + return ctrl.Result{}, nil + } + + logger.Info("Set status deploy true", "instance", instance) + instance.Status.Deployed = true + logger.Info("Set DeploymentReadyCondition true", "instance", instance) + instance.Status.Conditions.Set(condition.TrueCondition(condition.DeploymentReadyCondition, condition.DeploymentReadyMessage)) + + return ctrl.Result{}, nil +} + +// SetupWithManager sets up the controller with the Manager. +func (r *OpenStackDataPlaneDeploymentReconciler) SetupWithManager(mgr ctrl.Manager) error { + return ctrl.NewControllerManagedBy(mgr). + For(&dataplanev1.OpenStackDataPlaneDeployment{}). + Owns(&v1alpha1.OpenStackAnsibleEE{}). + Complete(r) +} diff --git a/controllers/openstackdataplanenodeset_controller.go b/controllers/openstackdataplanenodeset_controller.go index 99008051b..274470b6e 100644 --- a/controllers/openstackdataplanenodeset_controller.go +++ b/controllers/openstackdataplanenodeset_controller.go @@ -174,41 +174,41 @@ func (r *OpenStackDataPlaneNodeSetReconciler) Reconcile(ctx context.Context, req if err != nil || !isReady { return ctrl.Result{}, err } + instance.Status.DNSClusterAddresses = dnsClusterAddresses + instance.Status.CtlplaneSearchDomain = ctlplaneSearchDomain ansibleSSHPrivateKeySecret := instance.Spec.NodeTemplate.AnsibleSSHPrivateKeySecret - if ansibleSSHPrivateKeySecret != "" { - var secretKeys = []string{} - secretKeys = append(secretKeys, AnsibleSSHPrivateKey) - if !instance.Spec.PreProvisioned { - secretKeys = append(secretKeys, AnsibleSSHAuthorizedKeys) - } - _, result, err = secret.VerifySecret( - ctx, - types.NamespacedName{Namespace: instance.Namespace, - Name: ansibleSSHPrivateKeySecret}, - secretKeys, - helper.GetClient(), - time.Second*5, - ) + var secretKeys = []string{} + secretKeys = append(secretKeys, AnsibleSSHPrivateKey) + if !instance.Spec.PreProvisioned { + secretKeys = append(secretKeys, AnsibleSSHAuthorizedKeys) + } + _, result, err = secret.VerifySecret( + ctx, + types.NamespacedName{Namespace: instance.Namespace, + Name: ansibleSSHPrivateKeySecret}, + secretKeys, + helper.GetClient(), + time.Second*5, + ) - if err != nil { - if (result != ctrl.Result{}) { - instance.Status.Conditions.MarkFalse( - condition.InputReadyCondition, - condition.RequestedReason, - condition.SeverityInfo, - dataplanev1.InputReadyWaitingMessage, - "secret/"+ansibleSSHPrivateKeySecret) - } else { - instance.Status.Conditions.MarkFalse( - condition.InputReadyCondition, - condition.RequestedReason, - condition.SeverityWarning, - err.Error()) - } - return result, err + if err != nil { + if (result != ctrl.Result{}) { + instance.Status.Conditions.MarkFalse( + condition.InputReadyCondition, + condition.RequestedReason, + condition.SeverityInfo, + dataplanev1.InputReadyWaitingMessage, + "secret/"+ansibleSSHPrivateKeySecret) + } else { + instance.Status.Conditions.MarkFalse( + condition.InputReadyCondition, + condition.RequestedReason, + condition.SeverityWarning, + err.Error()) } + return result, err } // all our input checks out so report InputReady @@ -216,7 +216,6 @@ func (r *OpenStackDataPlaneNodeSetReconciler) Reconcile(ctx context.Context, req // Reconcile BaremetalSet if required if !instance.Spec.PreProvisioned { - // Reset the NodeSetBareMetalProvisionReadyCondition to unknown instance.Status.Conditions.MarkUnknown(dataplanev1.NodeSetBareMetalProvisionReadyCondition, condition.InitReason, condition.InitReason) @@ -225,8 +224,6 @@ func (r *OpenStackDataPlaneNodeSetReconciler) Reconcile(ctx context.Context, req if err != nil || !isReady { return ctrl.Result{}, err } - } else { - instance.Status.Conditions.Remove(dataplanev1.NodeSetBareMetalProvisionReadyCondition) } // TODO: if the input hash changes or the nodes in the role is updated we should @@ -245,7 +242,7 @@ func (r *OpenStackDataPlaneNodeSetReconciler) Reconcile(ctx context.Context, req } // Generate NodeSet Inventory - roleSecret, err := deployment.GenerateNodeSetInventory(ctx, helper, instance, + _, err = deployment.GenerateNodeSetInventory(ctx, helper, instance, allIPSets, dnsAddresses) if err != nil { util.LogErrorForObject(helper, err, fmt.Sprintf("Unable to generate inventory for %s", instance.Name), instance) @@ -255,60 +252,72 @@ func (r *OpenStackDataPlaneNodeSetReconciler) Reconcile(ctx context.Context, req // all setup tasks complete, mark SetupReadyCondition True instance.Status.Conditions.MarkTrue(dataplanev1.SetupReadyCondition, condition.ReadyMessage) - // Trigger executions based on the OpenStackDataPlane Controller state. - r.Log.Info("NodeSet", "DeployStrategy", instance.Spec.DeployStrategy.Deploy, - "NodeSet.Namespace", instance.Namespace, "NodeSet.Name", instance.Name) - if instance.Spec.DeployStrategy.Deploy { - logger.Info(fmt.Sprintf("Deploying NodeSet: %s", instance.Name)) - logger.Info("Set Status.Deployed to false", "instance", instance) - instance.Status.Deployed = false - logger.Info("Set DeploymentReadyCondition false", "instance", instance) - instance.Status.Conditions.Set(condition.FalseCondition( - condition.DeploymentReadyCondition, condition.RequestedReason, - condition.SeverityInfo, condition.DeploymentReadyRunningMessage)) - ansibleEESpec := instance.GetAnsibleEESpec() - if dnsClusterAddresses != nil && ctlplaneSearchDomain != "" { - ansibleEESpec.DNSConfig = &corev1.PodDNSConfig{ - Nameservers: dnsClusterAddresses, - Searches: []string{ctlplaneSearchDomain}, - } - } - deployResult, err := deployment.Deploy( - ctx, helper, instance, ansibleSSHPrivateKeySecret, - roleSecret, &instance.Status, ansibleEESpec, - instance.Spec.Services, instance) - if err != nil { - util.LogErrorForObject(helper, err, fmt.Sprintf("Unable to deploy %s", instance.Name), instance) - instance.Status.Conditions.Set(condition.FalseCondition( - condition.ReadyCondition, - condition.ErrorReason, - condition.SeverityWarning, - dataplanev1.DataPlaneNodeSetErrorMessage, - err.Error())) - return ctrl.Result{}, err - } - if deployResult != nil { - result = *deployResult - return result, nil - } - logger.Info("Set status deploy true", "instance", instance) - instance.Status.Deployed = true - logger.Info("Set DeploymentReadyCondition true", "instance", instance) - instance.Status.Conditions.Set(condition.TrueCondition(condition.DeploymentReadyCondition, condition.DeploymentReadyMessage)) - - } - // Set DeploymentReadyCondition to False if it was unknown. - // Handles the case where the NodeSet is created with - // DeployStrategy.Deploy=false. + // Handles the case where the NodeSet is created, but not yet deployed. if instance.Status.Conditions.IsUnknown(condition.DeploymentReadyCondition) { logger.Info("Set DeploymentReadyCondition false") instance.Status.Conditions.Set(condition.FalseCondition(condition.DeploymentReadyCondition, condition.NotRequestedReason, condition.SeverityInfo, condition.DeploymentReadyInitMessage)) } + deployedDeploymentsForNodeSet, err := r.GetDeployedDeploymentsForNodeSet(instance.Name) + if err != nil { + logger.Error(err, "Unable to get deployed OpenStackDataPlaneDeployments.") + return ctrl.Result{}, err + } + if len(deployedDeploymentsForNodeSet.Items) > 0 { + logger.Info("Set NodeSet DeploymentReadyCondition true") + instance.Status.Conditions.MarkTrue(condition.DeploymentReadyCondition, condition.DeploymentReadyMessage) + } + return ctrl.Result{}, nil } +// GetDeployedDeploymentsForNodeSet - Get the OpenStackDataPlaneDeployment +// resources that have been deployed and are for the given +// OpenStackDataPlaneNodeSet. +func (r *OpenStackDataPlaneNodeSetReconciler) GetDeployedDeploymentsForNodeSet(nodeSetName string) (*dataplanev1.OpenStackDataPlaneDeploymentList, error) { + // Get all deployments + deployments := &dataplanev1.OpenStackDataPlaneDeploymentList{} + err := r.Client.List(context.Background(), deployments) + if err != nil { + r.Log.Error(err, "Unable to retrieve OpenStackDataPlaneDeployment CRs %v") + return deployments, nil + } + deployedDeploymentsForNodeSet := &dataplanev1.OpenStackDataPlaneDeploymentList{} + for _, deployment := range deployments.Items { + for _, nodeSet := range deployment.Spec.NodeSets { + if nodeSet == nodeSetName { + if deployment.Status.Conditions.IsTrue(condition.Type(fmt.Sprintf(dataplanev1.NodeSetDeploymentReadyCondition, nodeSetName))) { + deployedDeploymentsForNodeSet.Items = append(deployedDeploymentsForNodeSet.Items, deployment) + } + } + } + } + + return deployedDeploymentsForNodeSet, err +} + +// GetNodeSetsForDeployment - Get the OpenStackDataPlaneNodeSet +// resources for the given OpenStackDataPlaneDeployment +func (r *OpenStackDataPlaneNodeSetReconciler) GetNodeSetsForDeployment(namespace string, deployment *dataplanev1.OpenStackDataPlaneDeployment) (dataplanev1.OpenStackDataPlaneNodeSetList, error) { + nodeSets := dataplanev1.OpenStackDataPlaneNodeSetList{} + var err error + for _, nodeSetName := range deployment.Spec.NodeSets { + nodeSet := &dataplanev1.OpenStackDataPlaneNodeSet{} + namespacedName := client.ObjectKey{ + Namespace: namespace, + Name: nodeSetName} + err = r.Client.Get(context.Background(), namespacedName, nodeSet) + if err != nil { + r.Log.Error(err, "Unable to retrieve OpenStackDataPlaneNodeSet CR %v") + return nodeSets, nil + } + nodeSets.Items = append(nodeSets.Items, *nodeSet) + } + + return nodeSets, err +} + // SetupWithManager sets up the controller with the Manager. func (r *OpenStackDataPlaneNodeSetReconciler) SetupWithManager(mgr ctrl.Manager) error { reconcileFunction := handler.EnqueueRequestsFromMapFunc(func(o client.Object) []reconcile.Request { @@ -343,6 +352,25 @@ func (r *OpenStackDataPlaneNodeSetReconciler) SetupWithManager(mgr ctrl.Manager) return nil }) + deploymentWatcher := handler.EnqueueRequestsFromMapFunc(func(obj client.Object) []reconcile.Request { + var namespace string = obj.GetNamespace() + result := []reconcile.Request{} + + deployment := obj.(*dataplanev1.OpenStackDataPlaneDeployment) + nodeSets, err := r.GetNodeSetsForDeployment(namespace, deployment) + if err != nil { + r.Log.Error(err, "Unable to retrieve OpenStackDataPlaneNodeSets %w") + return nil + } + for _, nodeSet := range nodeSets.Items { + name := client.ObjectKey{ + Namespace: namespace, + Name: nodeSet.Name} + result = append(result, reconcile.Request{NamespacedName: name}) + } + return result + }) + return ctrl.NewControllerManagedBy(mgr). For(&dataplanev1.OpenStackDataPlaneNodeSet{}). Owns(&v1alpha1.OpenStackAnsibleEE{}). @@ -352,5 +380,7 @@ func (r *OpenStackDataPlaneNodeSetReconciler) SetupWithManager(mgr ctrl.Manager) Owns(&corev1.Secret{}). Watches(&source.Kind{Type: &infranetworkv1.DNSMasq{}}, reconcileFunction). + Watches(&source.Kind{Type: &dataplanev1.OpenStackDataPlaneDeployment{}}, + deploymentWatcher). Complete(r) } diff --git a/docs/composable_services.md b/docs/composable_services.md index 485ce53d8..6840b0ea8 100644 --- a/docs/composable_services.md +++ b/docs/composable_services.md @@ -37,8 +37,9 @@ The default list of services as they will appear on the `services` field on an - run-os - libvirt - nova + - ovn -If the `services` field is ommitted from the `OpenStackDataPlaneNodeSet` spec, +If the `services` field is omitted from the `OpenStackDataPlaneNodeSet` spec, then the above list will be used. The default list of services are reconciled during `NodeSet` reconciliation if the @@ -86,7 +87,7 @@ getting the list of `OpenStackDataPlaneService` resources. oc get openstackdataplaneservice -If no custom services have been defined, the default avaiable services are +If no custom services have been defined, the default available services are returned. NAME AGE @@ -99,6 +100,7 @@ returned. validate-network 8d libvirt 8d nova 8d + ovn 8d A service can be examined in more detail by looking at the YAML representation of the resource. @@ -236,7 +238,7 @@ service to execute for the `edpm-compute` `NodeSet`. ansible: ansibleHost: 172.20.12.67 ansibleSSHPrivateKeySecret: dataplane-ansible-ssh-private-key-secret - ansibleUser: root + ansibleUser: cloud-admin ansibleVars: ansible_ssh_transfer_method: scp ctlplane_ip: 172.20.12.67 diff --git a/docs/deploying.md b/docs/deploying.md index 2f592b957..f3c12ddf4 100644 --- a/docs/deploying.md +++ b/docs/deploying.md @@ -145,31 +145,6 @@ OpenStackDataPlaneServices](#create-openstackdataplaneservices) section. Common configurations that can be enabled with `ansibleVars` are also documented at [Common Configurations](common_configurations.md). -Some of the ansible variables will need to be set based on values from the -controlplane that is already deployed. This set of ansible variables and the -`oc` command that can be used to get their values are shown below. - -```console -export EDPM_OVN_METADATA_AGENT_TRANSPORT_URL=$(oc get secret rabbitmq-transport-url-neutron-neutron-transport -o json | jq -r .data.transport_url | base64 -d) -export EDPM_OVN_METADATA_AGENT_SB_CONNECTION=$(oc get ovndbcluster ovndbcluster-sb -o json | jq -r .status.dbAddress) -export EDPM_OVN_METADATA_AGENT_NOVA_METADATA_HOST=$(oc get svc nova-metadata-internal -o json |jq -r '.status.loadBalancer.ingress[0].ip') -export EDPM_OVN_METADATA_AGENT_PROXY_SHARED_SECRET=$(oc get secret osp-secret -o json | jq -r .data.MetadataSecret | base64 -d) -export EDPM_OVN_METADATA_AGENT_BIND_HOST=127.0.0.1 -export EDPM_OVN_DBS=$(oc get ovndbcluster ovndbcluster-sb -o json | jq -r '.status.networkAttachments."openstack/internalapi"') - -echo " -edpm_ovn_metadata_agent_DEFAULT_transport_url: ${EDPM_OVN_METADATA_AGENT_TRANSPORT_URL} -edpm_ovn_metadata_agent_metadata_agent_ovn_ovn_sb_connection: ${EDPM_OVN_METADATA_AGENT_SB_CONNECTION} -edpm_ovn_metadata_agent_metadata_agent_DEFAULT_nova_metadata_host: ${EDPM_OVN_METADATA_AGENT_NOVA_METADATA_HOST} -edpm_ovn_metadata_agent_metadata_agent_DEFAULT_metadata_proxy_shared_secret: ${EDPM_OVN_METADATA_AGENT_PROXY_SHARED_SECRET} -edpm_ovn_metadata_agent_DEFAULT_bind_host: ${EDPM_OVN_METADATA_AGENT_BIND_HOST} -edpm_ovn_dbs: ${EDPM_OVN_DBS} -" -``` - -Add the output to the `ansibleVars` field to configure the values on the -role. - Add nodes to the dataplane. Each node should have its `role` field set to the name of its role. Since we are using a single role in this example, that role name will be `edpm-compute`. Each node will also inherit values @@ -217,17 +192,8 @@ With the nodes and the controlplane specific variables added, the full # These vars are edpm_network_config role vars edpm_network_config_template: templates/single_nic_vlans/single_nic_vlans.j2 - # Variables set with values from the controlplane - edpm_ovn_metadata_agent_default_transport_url: rabbit://default_user@rabbitmq.openstack.svc:5672 - edpm_ovn_metadata_agent_metadata_agent_ovn_ovn_sb_connection: tcp:10.217.5.121:6642 - edpm_ovn_metadata_agent_metadata_agent_DEFAULT_nova_metadata_host: 127.0.0.1 - edpm_ovn_metadata_agent_metadata_agent_DEFAULT_metadata_proxy_shared_secret: 12345678 - edpm_ovn_metadata_agent_default_bind_host: 127.0.0.1 - edpm_ovn_dbs: - - 192.168.24.1 - # See config/samples/dataplane_v1beta1_openstackdataplanenodeset.yaml - # for the other most common ansible varialbes that need to be set. + # for the other most common ansible variables that need to be set. nodes: edpm-compute-0: diff --git a/docs/inheritance.md b/docs/inheritance.md index 7a80acabb..88c710384 100644 --- a/docs/inheritance.md +++ b/docs/inheritance.md @@ -31,7 +31,7 @@ spec: network: ctlplane nodeTemplate: ansiblePort: 22 - ansibleUser: root + ansibleUser: cloud-admin managed: false managementNetwork: ctlplane networkConfig: @@ -46,7 +46,7 @@ following from the `nodeTemplate` in node 1 and 2 above. ```yaml ansiblePort: 22 - ansibleUser: root + ansibleUser: cloud-admin managed: false managementNetwork: ctlplane networkConfig: diff --git a/docs/openstack_dataplanedeloyment.md b/docs/openstack_dataplanedeloyment.md new file mode 100644 index 000000000..afa34706a --- /dev/null +++ b/docs/openstack_dataplanedeloyment.md @@ -0,0 +1,136 @@ + +### Custom Resources + +* [OpenStackDataPlaneDeployment](#openstackdataplanedeployment) + +### Sub Resources + +* [AnsibleEESpec](#ansibleeespec) +* [AnsibleOpts](#ansibleopts) +* [NetworkConfigSection](#networkconfigsection) +* [NodeSection](#nodesection) +* [NodeTemplate](#nodetemplate) +* [OpenStackDataPlaneDeploymentList](#openstackdataplanedeploymentlist) +* [OpenStackDataPlaneDeploymentSpec](#openstackdataplanedeploymentspec) +* [OpenStackDataPlaneDeploymentStatus](#openstackdataplanedeploymentstatus) + +#### AnsibleEESpec + +AnsibleEESpec is a specification of the ansible EE attributes + +| Field | Description | Scheme | Required | +| ----- | ----------- | ------ | -------- | +| networkAttachments | NetworkAttachments is a list of NetworkAttachment resource names to pass to the ansibleee resource which allows to connect the ansibleee runner to the given network | []string | false | +| openStackAnsibleEERunnerImage | OpenStackAnsibleEERunnerImage image to use as the ansibleEE runner image | string | false | +| ansibleTags | AnsibleTags for ansible execution | string | false | +| ansibleLimit | AnsibleLimit for ansible execution | string | false | +| ansibleSkipTags | AnsibleSkipTags for ansible execution | string | false | +| extraMounts | ExtraMounts containing files which can be mounted into an Ansible Execution Pod | []storage.VolMounts | false | +| env | Env is a list containing the environment variables to pass to the pod | []corev1.EnvVar | false | +| dnsConfig | DNSConfig for setting dnsservers | *corev1.PodDNSConfig | false | + +[Back to Custom Resources](#custom-resources) + +#### AnsibleOpts + +AnsibleOpts defines a logical grouping of Ansible related configuration options. + +| Field | Description | Scheme | Required | +| ----- | ----------- | ------ | -------- | +| ansibleUser | AnsibleUser SSH user for Ansible connection | string | false | +| ansibleHost | AnsibleHost SSH host for Ansible connection | string | false | +| ansiblePort | AnsiblePort SSH port for Ansible connection | int | false | +| ansibleVars | AnsibleVars for configuring ansible | map[string]json.RawMessage | false | + +[Back to Custom Resources](#custom-resources) + +#### NetworkConfigSection + +NetworkConfigSection is a specification of the Network configuration details + +| Field | Description | Scheme | Required | +| ----- | ----------- | ------ | -------- | +| template | Template - Contains a Ansible j2 nic config template to use when applying node network configuration | string | false | + +[Back to Custom Resources](#custom-resources) + +#### NodeSection + +NodeSection defines the top level attributes inherited by nodes in the CR. + +| Field | Description | Scheme | Required | +| ----- | ----------- | ------ | -------- | +| hostName | HostName - node name | string | false | +| networkConfig | NetworkConfig - Network configuration details. Contains os-net-config related properties. | [NetworkConfigSection](#networkconfigsection) | true | +| networks | Networks - Instance networks | []infranetworkv1.IPSetNetwork | false | +| managementNetwork | ManagementNetwork - Name of network to use for management (SSH/Ansible) | string | false | +| ansible | Ansible is the group of Ansible related configuration options. | [AnsibleOpts](#ansibleopts) | false | +| extraMounts | ExtraMounts containing files which can be mounted into an Ansible Execution Pod | []storage.VolMounts | false | +| userData | UserData node specific user-data | *corev1.SecretReference | false | +| networkData | NetworkData node specific network-data | *corev1.SecretReference | false | + +[Back to Custom Resources](#custom-resources) + +#### NodeTemplate + +NodeTemplate is a specification of the node attributes that override top level attributes. + +| Field | Description | Scheme | Required | +| ----- | ----------- | ------ | -------- | +| ansibleSSHPrivateKeySecret | AnsibleSSHPrivateKeySecret Name of a private SSH key secret containing private SSH key for connecting to node. The named secret must be of the form: Secret.data.ssh-privatekey: | string | true | +| networkConfig | NetworkConfig - Network configuration details. Contains os-net-config related properties. | [NetworkConfigSection](#networkconfigsection) | false | +| networks | Networks - Instance networks | []infranetworkv1.IPSetNetwork | false | +| managementNetwork | ManagementNetwork - Name of network to use for management (SSH/Ansible) | string | false | +| ansible | Ansible is the group of Ansible related configuration options. | [AnsibleOpts](#ansibleopts) | false | +| extraMounts | ExtraMounts containing files which can be mounted into an Ansible Execution Pod | []storage.VolMounts | false | +| userData | UserData node specific user-data | *corev1.SecretReference | false | +| networkData | NetworkData node specific network-data | *corev1.SecretReference | false | + +[Back to Custom Resources](#custom-resources) + +#### OpenStackDataPlaneDeployment + +OpenStackDataPlaneDeployment is the Schema for the openstackdataplanedeployments API + +| Field | Description | Scheme | Required | +| ----- | ----------- | ------ | -------- | +| metadata | | metav1.ObjectMeta | false | +| spec | | [OpenStackDataPlaneDeploymentSpec](#openstackdataplanedeploymentspec) | false | +| status | | [OpenStackDataPlaneDeploymentStatus](#openstackdataplanedeploymentstatus) | false | + +[Back to Custom Resources](#custom-resources) + +#### OpenStackDataPlaneDeploymentList + +OpenStackDataPlaneDeploymentList contains a list of OpenStackDataPlaneDeployment + +| Field | Description | Scheme | Required | +| ----- | ----------- | ------ | -------- | +| metadata | | metav1.ListMeta | false | +| items | | [][OpenStackDataPlaneDeployment](#openstackdataplanedeployment) | true | + +[Back to Custom Resources](#custom-resources) + +#### OpenStackDataPlaneDeploymentSpec + +OpenStackDataPlaneDeploymentSpec defines the desired state of OpenStackDataPlaneDeployment + +| Field | Description | Scheme | Required | +| ----- | ----------- | ------ | -------- | +| nodeSets | NodeSets is the list of NodeSets deployed | []string | true | +| ansibleTags | AnsibleTags for ansible execution | string | false | +| ansibleLimit | AnsibleLimit for ansible execution | string | false | +| ansibleSkipTags | AnsibleSkipTags for ansible execution | string | false | + +[Back to Custom Resources](#custom-resources) + +#### OpenStackDataPlaneDeploymentStatus + +OpenStackDataPlaneDeploymentStatus defines the observed state of OpenStackDataPlaneDeployment + +| Field | Description | Scheme | Required | +| ----- | ----------- | ------ | -------- | +| conditions | Conditions | condition.Conditions | false | +| deployed | Deployed | bool | false | + +[Back to Custom Resources](#custom-resources) diff --git a/docs/openstack_dataplanenodeset.md b/docs/openstack_dataplanenodeset.md index e4d4f3824..8c05e6946 100644 --- a/docs/openstack_dataplanenodeset.md +++ b/docs/openstack_dataplanenodeset.md @@ -7,7 +7,6 @@ * [AnsibleEESpec](#ansibleeespec) * [AnsibleOpts](#ansibleopts) -* [DeployStrategySection](#deploystrategysection) * [NetworkConfigSection](#networkconfigsection) * [NodeSection](#nodesection) * [NodeTemplate](#nodetemplate) @@ -45,19 +44,6 @@ AnsibleOpts defines a logical grouping of Ansible related configuration options. [Back to Custom Resources](#custom-resources) -#### DeployStrategySection - -DeployStrategySection for fields controlling the deployment - -| Field | Description | Scheme | Required | -| ----- | ----------- | ------ | -------- | -| deploy | Deploy boolean to trigger ansible execution | bool | true | -| ansibleTags | AnsibleTags for ansible execution | string | false | -| ansibleLimit | AnsibleLimit for ansible execution | string | false | -| ansibleSkipTags | AnsibleSkipTags for ansible execution | string | false | - -[Back to Custom Resources](#custom-resources) - #### NetworkConfigSection NetworkConfigSection is a specification of the Network configuration details @@ -91,9 +77,7 @@ NodeTemplate is a specification of the node attributes that override top level a | Field | Description | Scheme | Required | | ----- | ----------- | ------ | -------- | -| ansibleSSHPrivateKeySecret | AnsibleSSHPrivateKeySecret Name of a private SSH key secret containing private SSH key for connecting to node. The named secret must be of the form: Secret.data.ssh-privatekey: | string | false | -| nodes | Nodes - Map of Node Names and node specific data. Values here override defaults in the upper level section. | map[string][NodeSection](#nodesection) | true | -| networkAttachments | NetworkAttachments is a list of NetworkAttachment resource names to pass to the ansibleee resource which allows to connect the ansibleee runner to the given network | []string | false | +| ansibleSSHPrivateKeySecret | AnsibleSSHPrivateKeySecret Name of a private SSH key secret containing private SSH key for connecting to node. The named secret must be of the form: Secret.data.ssh-privatekey: | string | true | | networkConfig | NetworkConfig - Network configuration details. Contains os-net-config related properties. | [NetworkConfigSection](#networkconfigsection) | false | | networks | Networks - Instance networks | []infranetworkv1.IPSetNetwork | false | | managementNetwork | ManagementNetwork - Name of network to use for management (SSH/Ansible) | string | false | @@ -135,9 +119,9 @@ OpenStackDataPlaneNodeSetSpec defines the desired state of OpenStackDataPlaneNod | ----- | ----------- | ------ | -------- | | baremetalSetTemplate | BaremetalSetTemplate Template for BaremetalSet for the NodeSet | baremetalv1.OpenStackBaremetalSetSpec | false | | nodeTemplate | NodeTemplate - node attributes specific to nodes defined by this resource. These attributes can be overriden at the individual node level, else take their defaults from valus in this section. | [NodeTemplate](#nodetemplate) | true | +| nodes | Nodes - Map of Node Names and node specific data. Values here override defaults in the upper level section. | map[string][NodeSection](#nodesection) | true | | preProvisioned | \n\nPreProvisioned - Whether the nodes are actually pre-provisioned (True) or should be preprovisioned (False) | bool | false | | env | Env is a list containing the environment variables to pass to the pod | []corev1.EnvVar | false | -| deployStrategy | DeployStrategy section to control how the node is deployed | [DeployStrategySection](#deploystrategysection) | false | | networkAttachments | NetworkAttachments is a list of NetworkAttachment resource names to pass to the ansibleee resource which allows to connect the ansibleee runner to the given network | []string | false | | services | Services list | []string | true | @@ -151,5 +135,7 @@ OpenStackDataPlaneNodeSetStatus defines the observed state of OpenStackDataPlane | ----- | ----------- | ------ | -------- | | conditions | Conditions | condition.Conditions | false | | deployed | Deployed | bool | false | +| DNSClusterAddresses | DNSClusterAddresses | []string | false | +| CtlplaneSearchDomain | CtlplaneSearchDomain | string | false | [Back to Custom Resources](#custom-resources) diff --git a/docs/openstack_dataplaneservice.md b/docs/openstack_dataplaneservice.md index b34a47644..92aa87241 100644 --- a/docs/openstack_dataplaneservice.md +++ b/docs/openstack_dataplaneservice.md @@ -7,7 +7,6 @@ * [AnsibleEESpec](#ansibleeespec) * [AnsibleOpts](#ansibleopts) -* [DeployStrategySection](#deploystrategysection) * [NetworkConfigSection](#networkconfigsection) * [NodeSection](#nodesection) * [NodeTemplate](#nodetemplate) @@ -46,19 +45,6 @@ AnsibleOpts defines a logical grouping of Ansible related configuration options. [Back to Custom Resources](#custom-resources) -#### DeployStrategySection - -DeployStrategySection for fields controlling the deployment - -| Field | Description | Scheme | Required | -| ----- | ----------- | ------ | -------- | -| deploy | Deploy boolean to trigger ansible execution | bool | true | -| ansibleTags | AnsibleTags for ansible execution | string | false | -| ansibleLimit | AnsibleLimit for ansible execution | string | false | -| ansibleSkipTags | AnsibleSkipTags for ansible execution | string | false | - -[Back to Custom Resources](#custom-resources) - #### NetworkConfigSection NetworkConfigSection is a specification of the Network configuration details @@ -92,9 +78,7 @@ NodeTemplate is a specification of the node attributes that override top level a | Field | Description | Scheme | Required | | ----- | ----------- | ------ | -------- | -| ansibleSSHPrivateKeySecret | AnsibleSSHPrivateKeySecret Name of a private SSH key secret containing private SSH key for connecting to node. The named secret must be of the form: Secret.data.ssh-privatekey: | string | false | -| nodes | Nodes - Map of Node Names and node specific data. Values here override defaults in the upper level section. | map[string][NodeSection](#nodesection) | true | -| networkAttachments | NetworkAttachments is a list of NetworkAttachment resource names to pass to the ansibleee resource which allows to connect the ansibleee runner to the given network | []string | false | +| ansibleSSHPrivateKeySecret | AnsibleSSHPrivateKeySecret Name of a private SSH key secret containing private SSH key for connecting to node. The named secret must be of the form: Secret.data.ssh-privatekey: | string | true | | networkConfig | NetworkConfig - Network configuration details. Contains os-net-config related properties. | [NetworkConfigSection](#networkconfigsection) | false | | networks | Networks - Instance networks | []infranetworkv1.IPSetNetwork | false | | managementNetwork | ManagementNetwork - Name of network to use for management (SSH/Ansible) | string | false | diff --git a/go.mod b/go.mod index a29ec5aa7..a5fad081e 100644 --- a/go.mod +++ b/go.mod @@ -11,23 +11,23 @@ require ( github.com/onsi/ginkgo/v2 v2.12.0 github.com/onsi/gomega v1.27.10 github.com/openstack-k8s-operators/dataplane-operator/api v0.0.0-20230724101130-2d6fe1f4706b - github.com/openstack-k8s-operators/infra-operator/apis v0.1.1-0.20230829092744-a3dd5edba332 - github.com/openstack-k8s-operators/lib-common/modules/ansible v0.1.1-0.20230824094610-976b18ca2875 - github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230824094610-976b18ca2875 - github.com/openstack-k8s-operators/lib-common/modules/storage v0.1.1-0.20230824094610-976b18ca2875 - github.com/openstack-k8s-operators/lib-common/modules/test v0.1.2-0.20230824094610-976b18ca2875 - github.com/openstack-k8s-operators/openstack-ansibleee-operator/api v0.1.1-0.20230831190723-ed3035c30b24 - github.com/openstack-k8s-operators/openstack-baremetal-operator/api v0.1.1-0.20230823035821-d980f270d836 + github.com/openstack-k8s-operators/infra-operator/apis v0.1.1-0.20230914145253-116f307c7875 + github.com/openstack-k8s-operators/lib-common/modules/ansible v0.1.1-0.20230913075424-2680ce4b6ad2 + github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230913075424-2680ce4b6ad2 + github.com/openstack-k8s-operators/lib-common/modules/storage v0.1.1-0.20230913075424-2680ce4b6ad2 + github.com/openstack-k8s-operators/lib-common/modules/test v0.1.2-0.20230913075424-2680ce4b6ad2 + github.com/openstack-k8s-operators/openstack-ansibleee-operator/api v0.1.1-0.20230913102927-2edee48d935a + github.com/openstack-k8s-operators/openstack-baremetal-operator/api v0.1.1-0.20230915055858-ecb378f804c9 gopkg.in/yaml.v3 v3.0.1 - k8s.io/api v0.26.7 - k8s.io/apimachinery v0.26.7 - k8s.io/client-go v0.26.7 + k8s.io/api v0.26.9 + k8s.io/apimachinery v0.26.9 + k8s.io/client-go v0.26.9 sigs.k8s.io/controller-runtime v0.14.6 ) require ( github.com/beorn7/perks v1.0.1 // indirect - github.com/cert-manager/cert-manager v1.11.4 // indirect + github.com/cert-manager/cert-manager v1.11.5 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/emicklei/go-restful/v3 v3.10.2 // indirect @@ -45,7 +45,7 @@ require ( github.com/google/go-cmp v0.5.9 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/pprof v0.0.0-20230510103437-eeec1cb781c3 // indirect - github.com/gophercloud/gophercloud v1.5.0 // indirect + github.com/gophercloud/gophercloud v1.6.0 // indirect github.com/imdario/mergo v0.3.16 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -57,9 +57,9 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/openshift/api v3.9.0+incompatible // indirect - github.com/openstack-k8s-operators/keystone-operator/api v0.1.0 // indirect - github.com/openstack-k8s-operators/lib-common/modules/openstack v0.1.0 // indirect - github.com/openstack-k8s-operators/mariadb-operator/api v0.1.0 // indirect + github.com/openstack-k8s-operators/keystone-operator/api v0.1.1-0.20230830083045-d73d07cca617 // indirect + github.com/openstack-k8s-operators/lib-common/modules/openstack v0.1.1-0.20230824094610-976b18ca2875 // indirect + github.com/openstack-k8s-operators/mariadb-operator/api v0.1.1-0.20230912174650-9fb4c4a76e55 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/prometheus/client_golang v1.14.0 // indirect github.com/prometheus/client_model v0.3.0 // indirect @@ -68,22 +68,22 @@ require ( github.com/spf13/pflag v1.0.5 // indirect go.uber.org/multierr v1.10.0 // indirect go.uber.org/zap v1.25.0 // indirect - golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect + golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect golang.org/x/mod v0.12.0 // indirect - golang.org/x/net v0.14.0 // indirect + golang.org/x/net v0.15.0 // indirect golang.org/x/oauth2 v0.8.0 // indirect - golang.org/x/sys v0.11.0 // indirect - golang.org/x/term v0.11.0 // indirect - golang.org/x/text v0.12.0 // indirect + golang.org/x/sys v0.12.0 // indirect + golang.org/x/term v0.12.0 // indirect + golang.org/x/text v0.13.0 // indirect golang.org/x/time v0.3.0 // indirect - golang.org/x/tools v0.12.0 // indirect + golang.org/x/tools v0.13.0 // indirect gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.30.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - k8s.io/apiextensions-apiserver v0.26.7 // indirect - k8s.io/component-base v0.26.7 // indirect + k8s.io/apiextensions-apiserver v0.26.9 // indirect + k8s.io/component-base v0.26.9 // indirect k8s.io/klog/v2 v2.100.1 // indirect k8s.io/kube-openapi v0.0.0-20230515203736-54b630e78af5 // indirect k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect diff --git a/go.sum b/go.sum index c44902e77..fddb44a04 100644 --- a/go.sum +++ b/go.sum @@ -48,8 +48,8 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cert-manager/cert-manager v1.11.4 h1:vifBFrR+pGE94o/jViITNxCZ2l/TGAqPbeQbdPDU9wI= -github.com/cert-manager/cert-manager v1.11.4/go.mod h1:ataBWLyUn2vVqGLud6JThOAVIbNKz72cZgnt7cBlajk= +github.com/cert-manager/cert-manager v1.11.5 h1:K2LurvwIE4hIhODQZnkOW6ljYe3lVMAliS/to+gI05o= +github.com/cert-manager/cert-manager v1.11.5/go.mod h1:zNOyoTEwdn9Rtj5Or2pjBY1Bqwtw4vBElP2fKSP8/g8= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= @@ -178,8 +178,8 @@ github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/gophercloud/gophercloud v1.5.0 h1:cDN6XFCLKiiqvYpjQLq9AiM7RDRbIC9450WpPH+yvXo= -github.com/gophercloud/gophercloud v1.5.0/go.mod h1:aAVqcocTSXh2vYFZ1JTvx4EQmfgzxRcNupUfxZbBNDM= +github.com/gophercloud/gophercloud v1.6.0 h1:JwJN1bauRnWPba5ueWs9IluONHteXPWjjK+MvfM4krY= +github.com/gophercloud/gophercloud v1.6.0/go.mod h1:aAVqcocTSXh2vYFZ1JTvx4EQmfgzxRcNupUfxZbBNDM= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -240,26 +240,26 @@ github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= github.com/openshift/api v0.0.0-20230414143018-3367bc7e6ac7 h1:rncLxJBpFGqBztyxCMwNRnMjhhIDOWHJowi6q8G6koI= github.com/openshift/api v0.0.0-20230414143018-3367bc7e6ac7/go.mod h1:ctXNyWanKEjGj8sss1KjjHQ3ENKFm33FFnS5BKaIPh4= -github.com/openstack-k8s-operators/infra-operator/apis v0.1.1-0.20230829092744-a3dd5edba332 h1:OxhwqONfFHQjJuJjK3HKTXTSo2oQwKa97s+T+vKspkY= -github.com/openstack-k8s-operators/infra-operator/apis v0.1.1-0.20230829092744-a3dd5edba332/go.mod h1:t1xmsiZDqM3wXcLMqgHp7/iilK8ozuOkydV4Vi2Qibk= -github.com/openstack-k8s-operators/keystone-operator/api v0.1.0 h1:p98vKnS4KzdgU/+vrVKFY3y9n9v1Z6cpo4JvbTNRxlM= -github.com/openstack-k8s-operators/keystone-operator/api v0.1.0/go.mod h1:LNJJdteQG4E2fhWDerE+f8S2/ephEJg8yBkH1eqYYOo= -github.com/openstack-k8s-operators/lib-common/modules/ansible v0.1.1-0.20230824094610-976b18ca2875 h1:4xko7EEkrVCzbNgWQ5BfJizOIpaqHHeZ44INk7eRzZk= -github.com/openstack-k8s-operators/lib-common/modules/ansible v0.1.1-0.20230824094610-976b18ca2875/go.mod h1:A9sWNibvjr1a9B/mpy4k6J9xkH11fnn0Dx/X1EZ3On8= -github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230824094610-976b18ca2875 h1:pj22n6PQy/XAmV5m6XaarMY6X1lvxAh16oVT5ZSVoNI= -github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230824094610-976b18ca2875/go.mod h1:Mqg9hyHpWPda62750vqmk5TajxP3zbYPDP1rtSH7mg0= -github.com/openstack-k8s-operators/lib-common/modules/openstack v0.1.0 h1:mMeJvCQfZmakssvMyHjzp/ngxKysETDj9GJYhRwydzg= -github.com/openstack-k8s-operators/lib-common/modules/openstack v0.1.0/go.mod h1:+paEFOL5IlJzhg9fy7/1+HSErVkWUgUj1ORLFwgvxnI= -github.com/openstack-k8s-operators/lib-common/modules/storage v0.1.1-0.20230824094610-976b18ca2875 h1:lC8Nw4PF2Lcqc7BJAdlBvYPyLqyaKa9R1e15dM9b3BY= -github.com/openstack-k8s-operators/lib-common/modules/storage v0.1.1-0.20230824094610-976b18ca2875/go.mod h1:lazDTPD8BYde2yyzZ3HbOfG51Sf87vSr4KXwpF57hDs= -github.com/openstack-k8s-operators/lib-common/modules/test v0.1.2-0.20230824094610-976b18ca2875 h1:Q23dbdnbcL5A54Ixb7oKVTRE24IcxiqizrZX7X43XOI= -github.com/openstack-k8s-operators/lib-common/modules/test v0.1.2-0.20230824094610-976b18ca2875/go.mod h1:8OaiM1IFco5jpr6fR/vAqoag+NpjUeTbN1YIviFP4SI= -github.com/openstack-k8s-operators/mariadb-operator/api v0.1.0 h1:oM0ZzFHHj+ioCc7NXHIO6+sy7I2yiN29DI9/jh4fe54= -github.com/openstack-k8s-operators/mariadb-operator/api v0.1.0/go.mod h1:m5XuZSa5Zt5uAw3WbJYOIkFAGXy01mybVekcKOq1qHI= -github.com/openstack-k8s-operators/openstack-ansibleee-operator/api v0.1.1-0.20230831190723-ed3035c30b24 h1:03bfkYtBT7vlmOnQr8gbfqP9SZyDARvkf8fcr1gb5Ac= -github.com/openstack-k8s-operators/openstack-ansibleee-operator/api v0.1.1-0.20230831190723-ed3035c30b24/go.mod h1:RhdYrL368TLjW8MmS7rLGEwgAaZrYt7fwKahmc4Axlc= -github.com/openstack-k8s-operators/openstack-baremetal-operator/api v0.1.1-0.20230823035821-d980f270d836 h1:pQ6I7ImuEmi84fMb1tZFAVPA75ShZN10WIrKaHKl3uQ= -github.com/openstack-k8s-operators/openstack-baremetal-operator/api v0.1.1-0.20230823035821-d980f270d836/go.mod h1:H8r8C3OLaWMze/io3LP8otMz07vmjBZKV4Fk4U9JH9s= +github.com/openstack-k8s-operators/infra-operator/apis v0.1.1-0.20230914145253-116f307c7875 h1:DUlCjbi3XxH66oL97MFZF5wgL28HdU+r8TkBZVw7WIc= +github.com/openstack-k8s-operators/infra-operator/apis v0.1.1-0.20230914145253-116f307c7875/go.mod h1:NgrvT3CKMu6fE8Nt1H79qHx11L3I7Bb2eItniM7c9ow= +github.com/openstack-k8s-operators/keystone-operator/api v0.1.1-0.20230830083045-d73d07cca617 h1:+Sz5kbF6QzXgKROXp3S+X22ZHdt68zvj1tBOu94OGKU= +github.com/openstack-k8s-operators/keystone-operator/api v0.1.1-0.20230830083045-d73d07cca617/go.mod h1:CmUe4tHh990eRUj6Ou8gD9JE0PQ38LGnUu3kaaP8K50= +github.com/openstack-k8s-operators/lib-common/modules/ansible v0.1.1-0.20230913075424-2680ce4b6ad2 h1:enVKn+oQxkYhEoedWxtIiOaOtrwe9Gr+rFKsMH0S54Q= +github.com/openstack-k8s-operators/lib-common/modules/ansible v0.1.1-0.20230913075424-2680ce4b6ad2/go.mod h1:A9sWNibvjr1a9B/mpy4k6J9xkH11fnn0Dx/X1EZ3On8= +github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230913075424-2680ce4b6ad2 h1:/ez+9PSwtucQ9v1I5X72xlP5UJztTMPH4M5gDAJAatc= +github.com/openstack-k8s-operators/lib-common/modules/common v0.1.1-0.20230913075424-2680ce4b6ad2/go.mod h1:bG2JdbaO4bR4u8rtXZ7MgmMELuEseTkL2BPgk9JBYmY= +github.com/openstack-k8s-operators/lib-common/modules/openstack v0.1.1-0.20230824094610-976b18ca2875 h1:aUlwELsLYWQ3FL+/nRG/1uGVNW86c3MhtLrHNVDd57k= +github.com/openstack-k8s-operators/lib-common/modules/openstack v0.1.1-0.20230824094610-976b18ca2875/go.mod h1:Vng+vqdTJUuZ+AEzSAaU0I7bn3qwYMMFEUHHhiH0440= +github.com/openstack-k8s-operators/lib-common/modules/storage v0.1.1-0.20230913075424-2680ce4b6ad2 h1:WqquubnK/hLqeZpTnNjjBCloo3HgvKhCrhEDNyQg21I= +github.com/openstack-k8s-operators/lib-common/modules/storage v0.1.1-0.20230913075424-2680ce4b6ad2/go.mod h1:UKzRiNlmYVIE7Ggc6+qd7MMrNBL20sgW46rhP+U0Ilc= +github.com/openstack-k8s-operators/lib-common/modules/test v0.1.2-0.20230913075424-2680ce4b6ad2 h1:TJpuax2pifQbOtsPv78DjoC+f/7+/3Tw+CdXBxxDxAs= +github.com/openstack-k8s-operators/lib-common/modules/test v0.1.2-0.20230913075424-2680ce4b6ad2/go.mod h1:fuKZmOKDEx/2f1+VLQyXF6iH9FX0ynbtyuvC/XjuJzg= +github.com/openstack-k8s-operators/mariadb-operator/api v0.1.1-0.20230912174650-9fb4c4a76e55 h1:iwa4MpjFHCl+qfiimlUwVm1BV+LGjbGYtXIwLe/QHwk= +github.com/openstack-k8s-operators/mariadb-operator/api v0.1.1-0.20230912174650-9fb4c4a76e55/go.mod h1:rh0jKCJYeHXVWfJnXl22AuaTRkYfHwmKuK6O3IeTG4A= +github.com/openstack-k8s-operators/openstack-ansibleee-operator/api v0.1.1-0.20230913102927-2edee48d935a h1:kNsXwIXDCzr0OrcPb8f/hOM8PgnKbLNoZgVhN1V869E= +github.com/openstack-k8s-operators/openstack-ansibleee-operator/api v0.1.1-0.20230913102927-2edee48d935a/go.mod h1:gCsHjYsZWdF8DOd4MH++2RZ+tF/VOuhhaVXWB7HrLCg= +github.com/openstack-k8s-operators/openstack-baremetal-operator/api v0.1.1-0.20230915055858-ecb378f804c9 h1:Q6CPgccNeA2zfLZnDFxYBa0nwlfnZm60kSDa/4TqucY= +github.com/openstack-k8s-operators/openstack-baremetal-operator/api v0.1.1-0.20230915055858-ecb378f804c9/go.mod h1:9cWHjNK7MyiWxCx9779Mcieal5N0NLn75yraIlTuI2s= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -355,8 +355,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -414,8 +414,8 @@ golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= -golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= +golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= +golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -477,12 +477,12 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.11.0 h1:F9tnn/DA/Im8nCwm+fX+1/eBwi4qFjRT++MhtVC4ZX0= -golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= +golang.org/x/term v0.12.0 h1:/ZfYdc3zq+q02Rv9vGqTeSItdzZTSNDmfTi0mBAuidU= +golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -491,8 +491,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= -golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -541,8 +541,8 @@ golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.12.0 h1:YW6HUoUmYBpwSgyaGaZq1fHjrBjX1rlpZ54T6mu2kss= -golang.org/x/tools v0.12.0/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM= +golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -664,16 +664,16 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.26.7 h1:Lf4iEBEJb5OFNmawtBfSZV/UNi9riSJ0t1qdhyZqI40= -k8s.io/api v0.26.7/go.mod h1:Vk9bMadzA49UHPmHB//lX7VRCQSXGoVwfLd3Sc1SSXI= -k8s.io/apiextensions-apiserver v0.26.7 h1:L7ImW831auK1ZQBtNJPaG5qyrFxeISEBlgfZJfnaIPk= -k8s.io/apiextensions-apiserver v0.26.7/go.mod h1:3DbZBfS3kO7/Jaj7qqzcBtPcKP0/KcklyAnk8zc+fs4= -k8s.io/apimachinery v0.26.7 h1:590jSBwaSHCAFCqltaEogY/zybFlhGsnLteLpuF2wig= -k8s.io/apimachinery v0.26.7/go.mod h1:qYzLkrQ9lhrZRh0jNKo2cfvf/R1/kQONnSiyB7NUJU0= -k8s.io/client-go v0.26.7 h1:hyU9aKHlwVOykgyxzGYkrDSLCc4+mimZVyUJjPyUn1E= -k8s.io/client-go v0.26.7/go.mod h1:okYjy0jtq6sdeztALDvCh24tg4opOQS1XNvsJlERDAo= -k8s.io/component-base v0.26.7 h1:uqsOyZh0Zqoaup8tmHa491D/CvgFdGUs+X2H/inNUKM= -k8s.io/component-base v0.26.7/go.mod h1:CZe1HTmX/DQdeBrb9XYOXzs96jXth8ZbFvhLMsoJLUg= +k8s.io/api v0.26.9 h1:s8Y+G1u2JM55b90+Yo2RVb3PGT/hkWNVPN4idPERxJg= +k8s.io/api v0.26.9/go.mod h1:W/W4fEWRVzPD36820LlVUQfNBiSbiq0VPWRFJKwzmUg= +k8s.io/apiextensions-apiserver v0.26.9 h1:aJqWRuBj9i9J6tIDniqUDYM5QCRajTKXK/GO+zEccGQ= +k8s.io/apiextensions-apiserver v0.26.9/go.mod h1:L1uysxOP2kC1vkZTlHGUlUl5WSpa7e4GHJmGEZY7yLg= +k8s.io/apimachinery v0.26.9 h1:5yAV9cFR7Z4gIorKcAjWnx4uxtxiFsERwq4Pvmx0CCg= +k8s.io/apimachinery v0.26.9/go.mod h1:qYzLkrQ9lhrZRh0jNKo2cfvf/R1/kQONnSiyB7NUJU0= +k8s.io/client-go v0.26.9 h1:TGWi/6guEjIgT0Hg871Gsmx0qFuoGyGFjlFedrk7It0= +k8s.io/client-go v0.26.9/go.mod h1:tU1FZS0bwAmAFyPYpZycUQrQnUMzQ5MHloop7EbX6ow= +k8s.io/component-base v0.26.9 h1:qQVdQgyEIUe8EUkB3EEuQ9l5sgVlG2KgOB519yWEBGw= +k8s.io/component-base v0.26.9/go.mod h1:3WmW9lH9tbjpuvpAc22cPF/6C3VxCjMxkOU1j2mpzr8= k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20230515203736-54b630e78af5 h1:azYPdzztXxPSa8wb+hksEKayiz0o+PPisO/d+QhWnoo= diff --git a/main.go b/main.go index 543e7b522..82e904473 100644 --- a/main.go +++ b/main.go @@ -41,6 +41,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/config" dataplanev1 "github.com/openstack-k8s-operators/dataplane-operator/api/v1beta1" + dataplanev1beta1 "github.com/openstack-k8s-operators/dataplane-operator/api/v1beta1" "github.com/openstack-k8s-operators/dataplane-operator/controllers" //+kubebuilder:scaffold:imports ) @@ -58,6 +59,7 @@ func init() { utilruntime.Must(networkv1.AddToScheme(scheme)) utilruntime.Must(baremetalv1.AddToScheme(scheme)) utilruntime.Must(infranetworkv1.AddToScheme(scheme)) + utilruntime.Must(dataplanev1beta1.AddToScheme(scheme)) //+kubebuilder:scaffold:scheme } @@ -135,6 +137,16 @@ func main() { } checker = mgr.GetWebhookServer().StartedChecker() } + + if err = (&controllers.OpenStackDataPlaneDeploymentReconciler{ + Client: mgr.GetClient(), + Scheme: mgr.GetScheme(), + Kclient: kclient, + Log: ctrl.Log.WithName("controllers").WithName("OpenStackDataPlaneDeployment"), + }).SetupWithManager(mgr); err != nil { + setupLog.Error(err, "unable to create controller", "controller", "OpenStackDataPlaneDeployment") + os.Exit(1) + } //+kubebuilder:scaffold:builder if err := mgr.AddHealthzCheck("healthz", checker); err != nil { diff --git a/pkg/deployment/baremetal.go b/pkg/deployment/baremetal.go index 5da9255a1..392d2dc44 100644 --- a/pkg/deployment/baremetal.go +++ b/pkg/deployment/baremetal.go @@ -51,7 +51,7 @@ func DeployBaremetalSet( utils.LogForObject(helper, "Reconciling BaremetalSet", instance) _, err := controllerutil.CreateOrPatch(ctx, helper.GetClient(), baremetalSet, func() error { instance.Spec.BaremetalSetTemplate.DeepCopyInto(&baremetalSet.Spec) - for nodeName, node := range instance.Spec.NodeTemplate.Nodes { + for nodeName, node := range instance.Spec.Nodes { hostName := node.HostName ipSet, ok := ipSets[nodeName] instanceSpec := baremetalSet.Spec.BaremetalHosts[hostName] diff --git a/pkg/deployment/deployment.go b/pkg/deployment/deployment.go index d59bd736c..45c06be57 100644 --- a/pkg/deployment/deployment.go +++ b/pkg/deployment/deployment.go @@ -35,23 +35,18 @@ import ( "github.com/openstack-k8s-operators/lib-common/modules/storage" ansibleeev1alpha1 "github.com/openstack-k8s-operators/openstack-ansibleee-operator/api/v1alpha1" corev1 "k8s.io/api/core/v1" - "sigs.k8s.io/controller-runtime/pkg/client" ) -// deployFuncDef so we can pass a function to ConditionalDeploy -type deployFuncDef func(context.Context, *helper.Helper, client.Object, string, string, dataplanev1.AnsibleEESpec, dataplanev1.OpenStackDataPlaneService) error - // Deploy function encapsulating primary deloyment handling func Deploy( ctx context.Context, helper *helper.Helper, - obj client.Object, - sshKeySecret string, + nodeSet *dataplanev1.OpenStackDataPlaneNodeSet, + deployment *dataplanev1.OpenStackDataPlaneDeployment, inventorySecret string, - status *dataplanev1.OpenStackDataPlaneNodeSetStatus, + status *dataplanev1.OpenStackDataPlaneDeploymentStatus, aeeSpec dataplanev1.AnsibleEESpec, services []string, - nodeSet *dataplanev1.OpenStackDataPlaneNodeSet, ) (*ctrl.Result, error) { log := helper.GetLogger() @@ -60,7 +55,6 @@ func Deploy( var readyMessage string var readyWaitingMessage string var readyErrorMessage string - var deployFunc deployFuncDef var deployName string var deployLabel string @@ -76,18 +70,17 @@ func Deploy( if err != nil { return &ctrl.Result{}, err } - deployFunc = DeployService deployName = foundService.Name deployLabel = foundService.Spec.Label - readyCondition = condition.Type(fmt.Sprintf(dataplanev1.ServiceReadyCondition, service)) - readyWaitingMessage = fmt.Sprintf(dataplanev1.ServiceReadyWaitingMessage, deployName) - readyMessage = fmt.Sprintf(dataplanev1.ServiceReadyMessage, deployName) - readyErrorMessage = dataplanev1.ServiceErrorMessage + readyCondition = condition.Type(fmt.Sprintf(dataplanev1.NodeSetServiceDeploymentReadyCondition, nodeSet.Name, service)) + readyWaitingMessage = fmt.Sprintf(dataplanev1.NodeSetServiceDeploymentReadyWaitingMessage, nodeSet.Name, deployName) + readyMessage = fmt.Sprintf(dataplanev1.NodeSetServiceDeploymentReadyMessage, nodeSet.Name, deployName) + readyErrorMessage = fmt.Sprintf(dataplanev1.NodeSetServiceDeploymentErrorMessage, nodeSet.Name, deployName) aeeSpec.OpenStackAnsibleEERunnerImage = foundService.Spec.OpenStackAnsibleEERunnerImage // Reset ExtraMounts to its original value, and then add in service // specific mounts. - aeeSpec.ExtraMounts = []storage.VolMounts{} + aeeSpec.ExtraMounts = make([]storage.VolMounts, len(aeeSpecMounts)) copy(aeeSpec.ExtraMounts, aeeSpecMounts) aeeSpec, err = addServiceExtraMounts(ctx, helper, aeeSpec, foundService) @@ -97,15 +90,14 @@ func Deploy( err = ConditionalDeploy( ctx, helper, - obj, - sshKeySecret, + nodeSet, + deployment, inventorySecret, status, readyCondition, readyMessage, readyWaitingMessage, readyErrorMessage, - deployFunc, deployName, deployLabel, aeeSpec, @@ -120,6 +112,7 @@ func Deploy( } if err != nil || !status.Conditions.IsTrue(readyCondition) { + log.Info(fmt.Sprintf("Condition %s not ready", readyCondition)) return &ctrl.Result{}, err } log.Info(fmt.Sprintf("Condition %s ready", readyCondition)) @@ -133,15 +126,14 @@ func Deploy( func ConditionalDeploy( ctx context.Context, helper *helper.Helper, - obj client.Object, - sshKeySecret string, + nodeSet *dataplanev1.OpenStackDataPlaneNodeSet, + deployment *dataplanev1.OpenStackDataPlaneDeployment, inventorySecret string, - status *dataplanev1.OpenStackDataPlaneNodeSetStatus, + status *dataplanev1.OpenStackDataPlaneDeploymentStatus, readyCondition condition.Type, readyMessage string, readyWaitingMessage string, readyErrorMessage string, - deployFunc deployFuncDef, deployName string, deployLabel string, aeeSpec dataplanev1.AnsibleEESpec, @@ -153,9 +145,16 @@ func ConditionalDeploy( if status.Conditions.IsUnknown(readyCondition) { log.Info(fmt.Sprintf("%s Unknown, starting %s", readyCondition, deployName)) - err = deployFunc(ctx, helper, obj, sshKeySecret, inventorySecret, aeeSpec, foundService) + err = DeployService( + ctx, + helper, + deployment, + nodeSet.Spec.NodeTemplate.AnsibleSSHPrivateKeySecret, + inventorySecret, + aeeSpec, + foundService) if err != nil { - util.LogErrorForObject(helper, err, fmt.Sprintf("Unable to %s for %s", deployName, obj.GetName()), obj) + util.LogErrorForObject(helper, err, fmt.Sprintf("Unable to %s for %s", deployName, nodeSet.Name), nodeSet) return err } @@ -165,13 +164,12 @@ func ConditionalDeploy( condition.SeverityInfo, readyWaitingMessage)) - log.Info(fmt.Sprintf("Condition %s unknown", readyCondition)) return nil } if status.Conditions.IsFalse(readyCondition) { - ansibleEE, err := dataplaneutil.GetAnsibleExecution(ctx, helper, obj, deployLabel) + ansibleEE, err := dataplaneutil.GetAnsibleExecution(ctx, helper, deployment, deployLabel) if err != nil && k8s_errors.IsNotFound(err) { log.Info(fmt.Sprintf("%s OpenStackAnsibleEE not yet found", readyCondition)) return nil diff --git a/pkg/deployment/inventory.go b/pkg/deployment/inventory.go index 7aa9874be..fee15efbb 100644 --- a/pkg/deployment/inventory.go +++ b/pkg/deployment/inventory.go @@ -47,7 +47,7 @@ func GenerateNodeSetInventory(ctx context.Context, helper *helper.Helper, return "", err } - for nodeName, node := range instance.Spec.NodeTemplate.Nodes { + for nodeName, node := range instance.Spec.Nodes { host := roleNameGroup.AddHost(nodeName) var dnsSearchDomains []string @@ -191,16 +191,16 @@ func populateInventoryFromIPAM( // getAnsibleUser returns the string value from the template unless it is set in the node func getAnsibleUser(instance *dataplanev1.OpenStackDataPlaneNodeSet, nodeName string) string { - if instance.Spec.NodeTemplate.Nodes[nodeName].Ansible.AnsibleUser != "" { - return instance.Spec.NodeTemplate.Nodes[nodeName].Ansible.AnsibleUser + if instance.Spec.Nodes[nodeName].Ansible.AnsibleUser != "" { + return instance.Spec.Nodes[nodeName].Ansible.AnsibleUser } return instance.Spec.NodeTemplate.Ansible.AnsibleUser } // getAnsiblePort returns the string value from the template unless it is set in the node func getAnsiblePort(instance *dataplanev1.OpenStackDataPlaneNodeSet, nodeName string) string { - if instance.Spec.NodeTemplate.Nodes[nodeName].Ansible.AnsiblePort > 0 { - return strconv.Itoa(instance.Spec.NodeTemplate.Nodes[nodeName].Ansible.AnsiblePort) + if instance.Spec.Nodes[nodeName].Ansible.AnsiblePort > 0 { + return strconv.Itoa(instance.Spec.Nodes[nodeName].Ansible.AnsiblePort) } return strconv.Itoa(instance.Spec.NodeTemplate.Ansible.AnsiblePort) } @@ -209,24 +209,24 @@ func getAnsiblePort(instance *dataplanev1.OpenStackDataPlaneNodeSet, nodeName st func getAnsibleManagementNetwork( instance *dataplanev1.OpenStackDataPlaneNodeSet, nodeName string) string { - if instance.Spec.NodeTemplate.Nodes[nodeName].ManagementNetwork != "" { - return instance.Spec.NodeTemplate.Nodes[nodeName].ManagementNetwork + if instance.Spec.Nodes[nodeName].ManagementNetwork != "" { + return instance.Spec.Nodes[nodeName].ManagementNetwork } return instance.Spec.NodeTemplate.ManagementNetwork } // getAnsibleNetworkConfig returns a JSON string value from the template unless it is set in the node func getAnsibleNetworkConfig(instance *dataplanev1.OpenStackDataPlaneNodeSet, nodeName string) dataplanev1.NetworkConfigSection { - if instance.Spec.NodeTemplate.Nodes[nodeName].NetworkConfig.Template != "" { - return instance.Spec.NodeTemplate.Nodes[nodeName].NetworkConfig + if instance.Spec.Nodes[nodeName].NetworkConfig.Template != "" { + return instance.Spec.Nodes[nodeName].NetworkConfig } return instance.Spec.NodeTemplate.NetworkConfig } // getAnsibleNetworks returns a JSON string mapping fixedIP and/or network name to their valules func getAnsibleNetworks(instance *dataplanev1.OpenStackDataPlaneNodeSet, nodeName string) []infranetworkv1.IPSetNetwork { - if len(instance.Spec.NodeTemplate.Nodes[nodeName].Networks) > 0 { - return instance.Spec.NodeTemplate.Nodes[nodeName].Networks + if len(instance.Spec.Nodes[nodeName].Networks) > 0 { + return instance.Spec.Nodes[nodeName].Networks } return instance.Spec.NodeTemplate.Networks } @@ -256,7 +256,7 @@ func getAnsibleVars( nodeSet[key] = v } - for key, val := range instance.Spec.NodeTemplate.Nodes[nodeName].Ansible.AnsibleVars { + for key, val := range instance.Spec.Nodes[nodeName].Ansible.AnsibleVars { var v interface{} nodeYamlError = yaml.Unmarshal(val, &v) if nodeYamlError != nil { diff --git a/pkg/deployment/ipam.go b/pkg/deployment/ipam.go index eb945cab5..a104f19c3 100644 --- a/pkg/deployment/ipam.go +++ b/pkg/deployment/ipam.go @@ -71,7 +71,7 @@ func createOrPatchDNSData(ctx context.Context, helper *helper.Helper, var allDNSRecords []infranetworkv1.DNSHost var ctlplaneSearchDomain string // Build DNSData CR - for nodeName, node := range instance.Spec.NodeTemplate.Nodes { + for nodeName, node := range instance.Spec.Nodes { nets := node.Networks if len(nets) == 0 { nets = instance.Spec.NodeTemplate.Networks @@ -127,7 +127,7 @@ func EnsureDNSData(ctx context.Context, helper *helper.Helper, allIPSets map[string]infranetworkv1.IPSet) ([]string, []string, string, bool, error) { // Verify dnsmasq CR exists - dnsAddresses, dnsClusterAddresses, isReady, err := checkDNSService( + dnsAddresses, dnsClusterAddresses, isReady, err := CheckDNSService( ctx, helper, instance) if err != nil || !isReady || dnsAddresses == nil { @@ -210,7 +210,7 @@ func reserveIPs(ctx context.Context, helper *helper.Helper, allIPSets := make(map[string]infranetworkv1.IPSet) // CreateOrPatch IPSets - for nodeName, node := range instance.Spec.NodeTemplate.Nodes { + for nodeName, node := range instance.Spec.Nodes { nets := node.Networks if len(nets) == 0 { @@ -242,8 +242,8 @@ func reserveIPs(ctx context.Context, helper *helper.Helper, return allIPSets, nil } -// checkDNSService checks if DNS is configured and ready -func checkDNSService(ctx context.Context, helper *helper.Helper, +// CheckDNSService checks if DNS is configured and ready +func CheckDNSService(ctx context.Context, helper *helper.Helper, instance client.Object) ([]string, []string, bool, error) { dnsmasqList := &infranetworkv1.DNSMasqList{} listOpts := []client.ListOption{ diff --git a/pkg/deployment/kube_service.go b/pkg/deployment/kube_service.go index 139fd189e..60437a672 100644 --- a/pkg/deployment/kube_service.go +++ b/pkg/deployment/kube_service.go @@ -43,8 +43,8 @@ func CreateKubeServices( return err } - addresses := make([]string, len(nodeSet.Spec.NodeTemplate.Nodes)) - for _, item := range nodeSet.Spec.NodeTemplate.Nodes { + addresses := make([]string, len(nodeSet.Spec.Nodes)) + for _, item := range nodeSet.Spec.Nodes { addresses = append(addresses, item.Ansible.AnsibleHost) } diff --git a/tests/functional/base_test.go b/tests/functional/base_test.go index 8bbbc0e61..f28e053be 100644 --- a/tests/functional/base_test.go +++ b/tests/functional/base_test.go @@ -21,31 +21,41 @@ func CreateDataplaneNodeSet(name types.NamespacedName, spec dataplanev1.OpenStac func DefaultDataPlaneNodeSetSpec() dataplanev1.OpenStackDataPlaneNodeSetSpec { return dataplanev1.OpenStackDataPlaneNodeSetSpec{ - DeployStrategy: dataplanev1.DeployStrategySection{ - Deploy: false, - }, PreProvisioned: false, NodeTemplate: dataplanev1.NodeTemplate{ AnsibleSSHPrivateKeySecret: "dataplane-ansible-ssh-private-key-secret", - Nodes: map[string]dataplanev1.NodeSection{ - "edpm-compute-node-set": { - HostName: "edpm-bm-compute-1", - }, + }, + Nodes: map[string]dataplanev1.NodeSection{ + "edpm-compute-node-set": { + HostName: "edpm-bm-compute-1", }, }, } } +func CreateDataplaneDeployment(name types.NamespacedName, spec dataplanev1.OpenStackDataPlaneDeploymentSpec) *dataplanev1.OpenStackDataPlaneDeployment { + instance := DefaultDataplaneDeploymentTemplate(name, spec) + err := k8sClient.Create(ctx, instance) + Expect(err).NotTo(HaveOccurred()) + + return instance +} + +func DefaultDataPlaneDeploymentSpec() dataplanev1.OpenStackDataPlaneDeploymentSpec { + return dataplanev1.OpenStackDataPlaneDeploymentSpec{ + NodeSets: []string{ + "edpm-compute-nodeset", + }, + } +} + func DefaultDataPlaneNoNodeSetSpec() dataplanev1.OpenStackDataPlaneNodeSetSpec { return dataplanev1.OpenStackDataPlaneNodeSetSpec{ - DeployStrategy: dataplanev1.DeployStrategySection{ - Deploy: false, - }, PreProvisioned: true, NodeTemplate: dataplanev1.NodeTemplate{ AnsibleSSHPrivateKeySecret: "dataplane-ansible-ssh-private-key-secret", - Nodes: map[string]dataplanev1.NodeSection{}, }, + Nodes: map[string]dataplanev1.NodeSection{}, } } @@ -63,6 +73,29 @@ func DefaultDataplaneNodeSetTemplate(name types.NamespacedName, spec dataplanev1 } } +func DefaultDataplaneDeploymentTemplate(name types.NamespacedName, spec dataplanev1.OpenStackDataPlaneDeploymentSpec) *dataplanev1.OpenStackDataPlaneDeployment { + return &dataplanev1.OpenStackDataPlaneDeployment{ + TypeMeta: metav1.TypeMeta{ + APIVersion: "dataplane.openstack.org/v1beta1", + Kind: "OpenStackDataPlaneDeployment", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: name.Name, + Namespace: name.Namespace, + }, + Spec: spec, + } +} + +func GetDataplaneDeployment(name types.NamespacedName) *dataplanev1.OpenStackDataPlaneDeployment { + instance := &dataplanev1.OpenStackDataPlaneDeployment{} + gomega.Eventually(func(g gomega.Gomega) error { + g.Expect(k8sClient.Get(ctx, name, instance)).Should(Succeed()) + return nil + }, timeout, interval).Should(Succeed()) + return instance +} + func GetDataplaneNodeSet(name types.NamespacedName) *dataplanev1.OpenStackDataPlaneNodeSet { instance := &dataplanev1.OpenStackDataPlaneNodeSet{} gomega.Eventually(func(g gomega.Gomega) error { @@ -94,3 +127,8 @@ func DataplaneConditionGetter(name types.NamespacedName) condition.Conditions { instance := GetDataplaneNodeSet(name) return instance.Status.Conditions } + +func DataplaneDeploymentConditionGetter(name types.NamespacedName) condition.Conditions { + instance := GetDataplaneDeployment(name) + return instance.Status.Conditions +} diff --git a/tests/functional/openstackdataplanedeployment_controller_test.go b/tests/functional/openstackdataplanedeployment_controller_test.go new file mode 100644 index 000000000..5a0d927d1 --- /dev/null +++ b/tests/functional/openstackdataplanedeployment_controller_test.go @@ -0,0 +1,65 @@ +package functional + +import ( + "os" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + dataplanev1 "github.com/openstack-k8s-operators/dataplane-operator/api/v1beta1" + "github.com/openstack-k8s-operators/lib-common/modules/common/condition" + . "github.com/openstack-k8s-operators/lib-common/modules/common/test/helpers" + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/types" +) + +var _ = Describe("Dataplane Deployment Test", func() { + var dataplaneDeploymentName types.NamespacedName + var dataplaneNodeSetName types.NamespacedName + var dataplaneSSHSecretName types.NamespacedName + + BeforeEach(func() { + dataplaneDeploymentName = types.NamespacedName{ + Name: "edpm-deployment", + Namespace: namespace, + } + dataplaneNodeSetName = types.NamespacedName{ + Name: "edpm-compute-nodeset", + Namespace: namespace, + } + dataplaneSSHSecretName = types.NamespacedName{ + Namespace: namespace, + Name: "dataplane-ansible-ssh-private-key-secret", + } + err := os.Setenv("OPERATOR_SERVICES", "../../config/services") + Expect(err).NotTo(HaveOccurred()) + }) + + When("A dataplaneDeployment is created with matching NodeSet", func() { + BeforeEach(func() { + DeferCleanup(th.DeleteInstance, CreateDataplaneNodeSet(dataplaneNodeSetName, DefaultDataPlaneNoNodeSetSpec())) + DeferCleanup(th.DeleteInstance, CreateDataplaneDeployment(dataplaneDeploymentName, DefaultDataPlaneDeploymentSpec())) + CreateSSHSecret(dataplaneSSHSecretName) + }) + + It("should have conditions set", func() { + th.ExpectCondition( + dataplaneDeploymentName, + ConditionGetterFunc(DataplaneDeploymentConditionGetter), + condition.ReadyCondition, + corev1.ConditionFalse, + ) + th.ExpectCondition( + dataplaneDeploymentName, + ConditionGetterFunc(DataplaneDeploymentConditionGetter), + condition.InputReadyCondition, + corev1.ConditionTrue, + ) + th.ExpectCondition( + dataplaneDeploymentName, + ConditionGetterFunc(DataplaneDeploymentConditionGetter), + dataplanev1.SetupReadyCondition, + corev1.ConditionTrue, + ) + }) + }) +}) diff --git a/tests/functional/openstackdataplanenodeset_controller_test.go b/tests/functional/openstackdataplanenodeset_controller_test.go index 13249381e..dc58f4cf8 100644 --- a/tests/functional/openstackdataplanenodeset_controller_test.go +++ b/tests/functional/openstackdataplanenodeset_controller_test.go @@ -27,7 +27,7 @@ import ( "k8s.io/apimachinery/pkg/types" ) -var _ = Describe("Dataplane Role Test", func() { +var _ = Describe("Dataplane NodeSet Test", func() { var dataplaneNodeSetName types.NamespacedName var dataplaneSecretName types.NamespacedName var dataplaneSSHSecretName types.NamespacedName @@ -53,10 +53,6 @@ var _ = Describe("Dataplane Role Test", func() { BeforeEach(func() { DeferCleanup(th.DeleteInstance, CreateDataplaneNodeSet(dataplaneNodeSetName, DefaultDataPlaneNoNodeSetSpec())) }) - It("should have the Spec fields initialized", func() { - dataplaneNodeSetInstance := GetDataplaneNodeSet(dataplaneNodeSetName) - Expect(dataplaneNodeSetInstance.Spec.DeployStrategy.Deploy).Should(BeFalse()) - }) It("should have the Status fields initialized", func() { dataplaneNodeSetInstance := GetDataplaneNodeSet(dataplaneNodeSetName) @@ -82,12 +78,6 @@ var _ = Describe("Dataplane Role Test", func() { dataplanev1.SetupReadyCondition, corev1.ConditionFalse, ) - th.ExpectCondition( - dataplaneNodeSetName, - ConditionGetterFunc(DataplaneConditionGetter), - condition.DeploymentReadyCondition, - corev1.ConditionUnknown, - ) }) It("Should not have created a Secret", func() { @@ -106,5 +96,13 @@ var _ = Describe("Dataplane Role Test", func() { Expect(secret.Data["inventory"]).Should( ContainSubstring("edpm-compute-nodeset")) }) + It("Should set Input ready", func() { + th.ExpectCondition( + dataplaneNodeSetName, + ConditionGetterFunc(DataplaneConditionGetter), + condition.InputReadyCondition, + corev1.ConditionTrue, + ) + }) }) }) diff --git a/tests/functional/suite_test.go b/tests/functional/suite_test.go index ee19262d5..72115328a 100644 --- a/tests/functional/suite_test.go +++ b/tests/functional/suite_test.go @@ -154,7 +154,15 @@ var _ = BeforeSuite(func() { Client: k8sManager.GetClient(), Scheme: k8sManager.GetScheme(), Kclient: kclient, - Log: ctrl.Log.WithName("controllers").WithName("DataplaneRole"), + Log: ctrl.Log.WithName("controllers").WithName("DataplaneNodeSet"), + }).SetupWithManager(k8sManager) + Expect(err).ToNot(HaveOccurred()) + + err = (&controllers.OpenStackDataPlaneDeploymentReconciler{ + Client: k8sManager.GetClient(), + Scheme: k8sManager.GetScheme(), + Kclient: kclient, + Log: ctrl.Log.WithName("controllers").WithName("DataplaneDeployment"), }).SetupWithManager(k8sManager) Expect(err).ToNot(HaveOccurred()) diff --git a/tests/kuttl/tests/dataplane-create-test/00-assert.yaml b/tests/kuttl/tests/dataplane-create-test/00-assert.yaml index d82204111..f948f8d3d 100644 --- a/tests/kuttl/tests/dataplane-create-test/00-assert.yaml +++ b/tests/kuttl/tests/dataplane-create-test/00-assert.yaml @@ -3,17 +3,27 @@ kind: OpenStackDataPlaneNodeSet metadata: name: openstack-edpm spec: - deployStrategy: - deploy: false env: - name: ANSIBLE_FORCE_COLOR value: "True" - name: ANSIBLE_ENABLE_TASK_DEBUGGER value: "True" + nodes: + edpm-compute-0: + ansible: + ansibleHost: 192.168.122.100 + ansibleUser: cloud-admin + ansibleVars: + ctlplane_ip: 192.168.122.100 + fqdn_internal_api: edpm-compute-0.example.com + internal_api_ip: 172.17.0.100 + storage_ip: 172.18.0.100 + tenant_ip: 172.19.0.100 + hostName: edpm-compute-0 nodeTemplate: ansible: ansiblePort: 22 - ansibleUser: root + ansibleUser: cloud-admin ansibleVars: ctlplane_dns_nameservers: - 192.168.122.1 @@ -39,15 +49,8 @@ spec: image_tag }}' edpm_ovn_controller_agent_image: '{{ registry_url }}/openstack-ovn-controller:{{ image_tag }}' - edpm_ovn_dbs: - - 192.168.122.1 - edpm_ovn_metadata_agent_DEFAULT_bind_host: 127.0.0.1 - edpm_ovn_metadata_agent_DEFAULT_transport_url: rabbit://default_user@rabbitmq.openstack.svc:5672 edpm_ovn_metadata_agent_image: '{{ registry_url }}/openstack-neutron-metadata-agent-ovn:{{ image_tag }}' - edpm_ovn_metadata_agent_metadata_agent_DEFAULT_metadata_proxy_shared_secret: 12345678 - edpm_ovn_metadata_agent_metadata_agent_DEFAULT_nova_metadata_host: 127.0.0.1 - edpm_ovn_metadata_agent_metadata_agent_ovn_ovn_sb_connection: tcp:10.217.5.121:6642 edpm_selinux_mode: enforcing edpm_sshd_allowed_ranges: - 192.168.122.0/24 @@ -88,18 +91,6 @@ spec: tenant_vlan_id: 22 ansibleSSHPrivateKeySecret: dataplane-ansible-ssh-private-key-secret managementNetwork: ctlplane - nodes: - edpm-compute-0: - ansible: - ansibleHost: 192.168.122.100 - ansibleUser: root - ansibleVars: - ctlplane_ip: 192.168.122.100 - fqdn_internal_api: edpm-compute-0.example.com - internal_api_ip: 172.17.0.100 - storage_ip: 172.18.0.100 - tenant_ip: 172.19.0.100 - hostName: edpm-compute-0 preProvisioned: true services: - download-cache @@ -115,12 +106,10 @@ status: conditions: - message: Deployment not started reason: NotRequested - severity: Info status: "False" type: Ready - message: Deployment not started reason: NotRequested - severity: Info status: "False" type: DeploymentReady - message: Input data complete diff --git a/tests/kuttl/tests/dataplane-create-test/00-dataplane-create.yaml b/tests/kuttl/tests/dataplane-create-test/00-dataplane-create.yaml index bba99dfcd..2e1aa1512 100644 --- a/tests/kuttl/tests/dataplane-create-test/00-dataplane-create.yaml +++ b/tests/kuttl/tests/dataplane-create-test/00-dataplane-create.yaml @@ -21,23 +21,23 @@ spec: preProvisioned: true deployStrategy: deploy: false + nodes: + edpm-compute-0: + hostName: edpm-compute-0 + ansible: + ansibleHost: 192.168.122.100 + ansibleUser: cloud-admin + ansibleVars: + ctlplane_ip: 192.168.122.100 + internal_api_ip: 172.17.0.100 + storage_ip: 172.18.0.100 + tenant_ip: 172.19.0.100 + fqdn_internal_api: edpm-compute-0.example.com nodeTemplate: ansibleSSHPrivateKeySecret: dataplane-ansible-ssh-private-key-secret - nodes: - edpm-compute-0: - hostName: edpm-compute-0 - ansible: - ansibleHost: 192.168.122.100 - ansibleUser: root - ansibleVars: - ctlplane_ip: 192.168.122.100 - internal_api_ip: 172.17.0.100 - storage_ip: 172.18.0.100 - tenant_ip: 172.19.0.100 - fqdn_internal_api: edpm-compute-0.example.com managementNetwork: ctlplane ansible: - ansibleUser: root + ansibleUser: cloud-admin ansiblePort: 22 ansibleVars: service_net_map: @@ -88,16 +88,9 @@ spec: # edpm_nodes_validation edpm_nodes_validation_validate_controllers_icmp: false edpm_nodes_validation_validate_gateway_icmp: false - edpm_ovn_metadata_agent_DEFAULT_transport_url: rabbit://default_user@rabbitmq.openstack.svc:5672 - edpm_ovn_metadata_agent_metadata_agent_ovn_ovn_sb_connection: tcp:10.217.5.121:6642 - edpm_ovn_metadata_agent_metadata_agent_DEFAULT_nova_metadata_host: 127.0.0.1 - edpm_ovn_metadata_agent_metadata_agent_DEFAULT_metadata_proxy_shared_secret: 12345678 - edpm_ovn_metadata_agent_DEFAULT_bind_host: 127.0.0.1 ctlplane_dns_nameservers: - 192.168.122.1 dns_search_domains: [] - edpm_ovn_dbs: - - 192.168.122.1 registry_url: quay.io/podified-antelope-centos9 image_tag: current-podified edpm_ovn_controller_agent_image: "{{ registry_url }}/openstack-ovn-controller:{{ image_tag }}" diff --git a/tests/kuttl/tests/dataplane-deploy-no-nodes-test/00-assert.yaml b/tests/kuttl/tests/dataplane-deploy-no-nodes-test/00-assert.yaml index 858fe511e..bacddef84 100644 --- a/tests/kuttl/tests/dataplane-deploy-no-nodes-test/00-assert.yaml +++ b/tests/kuttl/tests/dataplane-deploy-no-nodes-test/00-assert.yaml @@ -4,6 +4,7 @@ metadata: name: edpm-compute-no-nodes namespace: openstack spec: + preProvisioned: true services: - download-cache - configure-network @@ -14,26 +15,22 @@ spec: - ovn - libvirt - nova - deployStrategy: - deploy: false env: - name: ANSIBLE_FORCE_COLOR value: "True" - name: ANSIBLE_ENABLE_TASK_DEBUGGER value: "True" + nodes: {} nodeTemplate: ansibleSSHPrivateKeySecret: dataplane-ansible-ssh-private-key-secret - nodes: {} status: conditions: - message: Deployment not started reason: NotRequested - severity: Info status: "False" type: Ready - message: Deployment not started reason: NotRequested - severity: Info status: "False" type: DeploymentReady - message: Input data complete diff --git a/tests/kuttl/tests/dataplane-deploy-no-nodes-test/00-dataplane-create.yaml b/tests/kuttl/tests/dataplane-deploy-no-nodes-test/00-dataplane-create.yaml index a73951acd..f69e57aa0 100644 --- a/tests/kuttl/tests/dataplane-deploy-no-nodes-test/00-dataplane-create.yaml +++ b/tests/kuttl/tests/dataplane-deploy-no-nodes-test/00-dataplane-create.yaml @@ -12,6 +12,20 @@ metadata: 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 +--- apiVersion: dataplane.openstack.org/v1beta1 kind: OpenStackDataPlaneNodeSet metadata: @@ -28,13 +42,11 @@ spec: - ovn - libvirt - nova - deployStrategy: - deploy: false env: - name: ANSIBLE_FORCE_COLOR value: "True" - name: ANSIBLE_ENABLE_TASK_DEBUGGER value: "True" + nodes: {} nodeTemplate: ansibleSSHPrivateKeySecret: dataplane-ansible-ssh-private-key-secret - nodes: {} diff --git a/tests/kuttl/tests/dataplane-deploy-no-nodes-test/01-assert.yaml b/tests/kuttl/tests/dataplane-deploy-no-nodes-test/01-assert.yaml index d14ad2d53..213b6b131 100644 --- a/tests/kuttl/tests/dataplane-deploy-no-nodes-test/01-assert.yaml +++ b/tests/kuttl/tests/dataplane-deploy-no-nodes-test/01-assert.yaml @@ -14,16 +14,14 @@ spec: - ovn - libvirt - nova - deployStrategy: - deploy: true env: - name: ANSIBLE_FORCE_COLOR value: "True" - name: ANSIBLE_ENABLE_TASK_DEBUGGER value: "True" + nodes: {} nodeTemplate: ansibleSSHPrivateKeySecret: dataplane-ansible-ssh-private-key-secret - nodes: {} status: conditions: - message: Setup complete @@ -42,43 +40,6 @@ status: reason: Ready status: "True" type: SetupReady - - message: configure-network service ready - reason: Ready - status: "True" - type: configure-network service ready - - message: configure-os service ready - reason: Ready - status: "True" - type: configure-os service ready - - message: download-cache service ready - reason: Ready - status: "True" - type: download-cache service ready - - message: install-os service ready - reason: Ready - status: "True" - type: install-os service ready - - message: libvirt service ready - reason: Ready - status: "True" - type: libvirt service ready - - message: nova service ready - reason: Ready - status: "True" - type: nova service ready - - message: ovn service ready - reason: Ready - status: "True" - type: ovn service ready - - message: run-os service ready - reason: Ready - status: "True" - type: run-os service ready - - message: validate-network service ready - reason: Ready - status: "True" - type: validate-network service ready - deployed: true --- apiVersion: ansibleee.openstack.org/v1alpha1 kind: OpenStackAnsibleEE @@ -89,7 +50,7 @@ metadata: - apiVersion: dataplane.openstack.org/v1beta1 blockOwnerDeletion: true controller: true - kind: OpenStackDataPlaneNodeSet + kind: OpenStackDataPlaneDeployment name: edpm-compute-no-nodes spec: backoffLimit: 6 @@ -145,7 +106,7 @@ metadata: - apiVersion: dataplane.openstack.org/v1beta1 blockOwnerDeletion: true controller: true - kind: OpenStackDataPlaneNodeSet + kind: OpenStackDataPlaneDeployment name: edpm-compute-no-nodes spec: backoffLimit: 6 @@ -201,7 +162,7 @@ metadata: - apiVersion: dataplane.openstack.org/v1beta1 blockOwnerDeletion: true controller: true - kind: OpenStackDataPlaneNodeSet + kind: OpenStackDataPlaneDeployment name: edpm-compute-no-nodes spec: backoffLimit: 6 @@ -257,7 +218,7 @@ metadata: - apiVersion: dataplane.openstack.org/v1beta1 blockOwnerDeletion: true controller: true - kind: OpenStackDataPlaneNodeSet + kind: OpenStackDataPlaneDeployment name: edpm-compute-no-nodes spec: backoffLimit: 6 @@ -314,7 +275,7 @@ metadata: - apiVersion: dataplane.openstack.org/v1beta1 blockOwnerDeletion: true controller: true - kind: OpenStackDataPlaneNodeSet + kind: OpenStackDataPlaneDeployment name: edpm-compute-no-nodes spec: backoffLimit: 6 @@ -370,7 +331,7 @@ metadata: - apiVersion: dataplane.openstack.org/v1beta1 blockOwnerDeletion: true controller: true - kind: OpenStackDataPlaneNodeSet + kind: OpenStackDataPlaneDeployment name: edpm-compute-no-nodes spec: backoffLimit: 6 @@ -427,7 +388,7 @@ metadata: - apiVersion: dataplane.openstack.org/v1beta1 blockOwnerDeletion: true controller: true - kind: OpenStackDataPlaneNodeSet + kind: OpenStackDataPlaneDeployment name: edpm-compute-no-nodes spec: backoffLimit: 6 @@ -443,6 +404,28 @@ spec: path: ovsdb-config name: ovncontroller-config name: ovncontroller-config-0 + - mounts: + - mountPath: /var/lib/openstack/configs/ovn/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/ovn/05-nova-metadata.conf + name: nova-metadata-neutron-config-0 + subPath: 05-nova-metadata.conf + volumes: + - secret: + items: + - key: 05-nova-metadata.conf + path: 05-nova-metadata.conf + secretName: nova-metadata-neutron-config + name: nova-metadata-neutron-config-0 - mounts: - mountPath: /runner/env/ssh_key name: ssh-key @@ -494,7 +477,7 @@ metadata: - apiVersion: dataplane.openstack.org/v1beta1 blockOwnerDeletion: true controller: true - kind: OpenStackDataPlaneNodeSet + kind: OpenStackDataPlaneDeployment name: edpm-compute-no-nodes spec: backoffLimit: 6 diff --git a/tests/kuttl/tests/dataplane-deploy-no-nodes-test/01-dataplane-deploy.yaml b/tests/kuttl/tests/dataplane-deploy-no-nodes-test/01-dataplane-deploy.yaml index d68d07b60..0669e5642 100644 --- a/tests/kuttl/tests/dataplane-deploy-no-nodes-test/01-dataplane-deploy.yaml +++ b/tests/kuttl/tests/dataplane-deploy-no-nodes-test/01-dataplane-deploy.yaml @@ -1,7 +1,7 @@ apiVersion: dataplane.openstack.org/v1beta1 -kind: OpenStackDataPlaneNodeSet +kind: OpenStackDataPlaneDeployment metadata: name: edpm-compute-no-nodes spec: - deployStrategy: - deploy: true + nodeSets: + - edpm-compute-no-nodes diff --git a/tests/kuttl/tests/dataplane-extramounts/00-assert.yaml b/tests/kuttl/tests/dataplane-extramounts/00-assert.yaml new file mode 100644 index 000000000..e2fdb5f63 --- /dev/null +++ b/tests/kuttl/tests/dataplane-extramounts/00-assert.yaml @@ -0,0 +1,69 @@ +--- +apiVersion: dataplane.openstack.org/v1beta1 +kind: OpenStackDataPlaneNodeSet +metadata: + name: edpm-extramounts +spec: + preProvisioned: true + services: + - test-service + nodes: {} + nodeTemplate: + extraMounts: + - extraVolType: edpm-ansible + mounts: + - mountPath: /usr/share/ansible/collections/ansible_collections/osp/edpm + name: edpm-ansible + volumes: + - name: edpm-ansible + persistentVolumeClaim: + claimName: edpm-ansible + readOnly: true +--- +apiVersion: ansibleee.openstack.org/v1alpha1 +kind: OpenStackAnsibleEE +metadata: + name: test-service-edpm-extramounts + namespace: openstack + ownerReferences: + - apiVersion: dataplane.openstack.org/v1beta1 + blockOwnerDeletion: true + controller: true + kind: OpenStackDataPlaneDeployment + name: edpm-extramounts +spec: + extraMounts: + - extraVolType: edpm-ansible + mounts: + - mountPath: /usr/share/ansible/collections/ansible_collections/osp/edpm + name: edpm-ansible + volumes: + - name: edpm-ansible + persistentVolumeClaim: + claimName: edpm-ansible + readOnly: true + - mounts: + - mountPath: /runner/env/ssh_key + name: ssh-key + subPath: ssh_key + - mountPath: /runner/inventory/hosts + name: inventory + subPath: inventory + - mountPath: /runner/network/nic-config-template + name: inventory + subPath: network + 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 + - key: network + path: network + secretName: dataplanenodeset-edpm-extramounts diff --git a/tests/kuttl/tests/dataplane-extramounts/00-dataplane-create.yaml b/tests/kuttl/tests/dataplane-extramounts/00-dataplane-create.yaml new file mode 100644 index 000000000..9b0d25549 --- /dev/null +++ b/tests/kuttl/tests/dataplane-extramounts/00-dataplane-create.yaml @@ -0,0 +1,39 @@ +apiVersion: dataplane.openstack.org/v1beta1 +kind: OpenStackDataPlaneService +metadata: + name: test-service +spec: + label: test-service + playbook: test.yml +--- +apiVersion: dataplane.openstack.org/v1beta1 +kind: OpenStackDataPlaneNodeSet +metadata: + name: edpm-extramounts +spec: + preProvisioned: true + deployStrategy: + deploy: true + services: + - test-service + nodes: {} + nodeTemplate: + ansibleSSHPrivateKeySecret: dataplane-ansible-ssh-private-key-secret + extraMounts: + - extraVolType: edpm-ansible + mounts: + - mountPath: /usr/share/ansible/collections/ansible_collections/osp/edpm + name: edpm-ansible + volumes: + - name: edpm-ansible + persistentVolumeClaim: + claimName: edpm-ansible + readOnly: true +--- +apiVersion: dataplane.openstack.org/v1beta1 +kind: OpenStackDataPlaneDeployment +metadata: + name: edpm-extramounts +spec: + nodeSets: + - edpm-extramounts diff --git a/tests/kuttl/tests/dataplane-service-config/00-assert.yaml b/tests/kuttl/tests/dataplane-service-config/00-assert.yaml index f9f5c6fbb..e376880fd 100644 --- a/tests/kuttl/tests/dataplane-service-config/00-assert.yaml +++ b/tests/kuttl/tests/dataplane-service-config/00-assert.yaml @@ -8,7 +8,7 @@ metadata: - apiVersion: dataplane.openstack.org/v1beta1 blockOwnerDeletion: true controller: true - kind: OpenStackDataPlaneNodeSet + kind: OpenStackDataPlaneDeployment name: edpm-compute-no-nodes spec: debug: false diff --git a/tests/kuttl/tests/dataplane-service-config/00-create.yaml b/tests/kuttl/tests/dataplane-service-config/00-create.yaml index 73e7ff94b..b75dbf3d9 100644 --- a/tests/kuttl/tests/dataplane-service-config/00-create.yaml +++ b/tests/kuttl/tests/dataplane-service-config/00-create.yaml @@ -51,15 +51,21 @@ metadata: name: edpm-compute-no-nodes spec: preProvisioned: true - deployStrategy: - deploy: true env: - name: ANSIBLE_FORCE_COLOR value: "True" - name: ANSIBLE_ENABLE_TASK_DEBUGGER value: "True" + nodes: {} nodeTemplate: ansibleSSHPrivateKeySecret: dataplane-ansible-ssh-private-key-secret - nodes: {} services: - kuttl-service +--- +apiVersion: dataplane.openstack.org/v1beta1 +kind: OpenStackDataPlaneDeployment +metadata: + name: edpm-compute-no-nodes +spec: + nodeSets: + - edpm-compute-no-nodes diff --git a/tests/kuttl/tests/dataplane-service-custom-image/00-assert.yaml b/tests/kuttl/tests/dataplane-service-custom-image/00-assert.yaml index 38f1541cd..7c6418de0 100644 --- a/tests/kuttl/tests/dataplane-service-custom-image/00-assert.yaml +++ b/tests/kuttl/tests/dataplane-service-custom-image/00-assert.yaml @@ -5,26 +5,22 @@ metadata: name: edpm-no-nodes-custom-service spec: preProvisioned: true - deployStrategy: - deploy: true services: - custom-image-service + nodes: {} nodeTemplate: - nodes: {} ansible: ansibleUser: cloud-admin ansiblePort: 22 ansibleSSHPrivateKeySecret: dataplane-ansible-ssh-private-key-secret status: conditions: - - message: custom-image-service service not yet ready - reason: Requested - severity: Info + - message: Deployment not started + reason: NotRequested status: "False" type: Ready - - message: Deployment in progress - reason: Requested - severity: Info + - message: Deployment not started + reason: NotRequested status: "False" type: DeploymentReady - message: Input data complete @@ -35,23 +31,18 @@ status: reason: Ready status: "True" type: SetupReady - - message: custom-image-service service not yet ready - reason: Requested - severity: Info - status: "False" - type: custom-image-service service ready --- apiVersion: ansibleee.openstack.org/v1alpha1 kind: OpenStackAnsibleEE metadata: - name: dp-custom-image-service-edpm-no-nodes-custom-service + name: dp-custom-image-service-edpm-compute-no-nodes namespace: openstack ownerReferences: - apiVersion: dataplane.openstack.org/v1beta1 blockOwnerDeletion: true controller: true - kind: OpenStackDataPlaneNodeSet - name: edpm-no-nodes-custom-service + kind: OpenStackDataPlaneDeployment + name: edpm-compute-no-nodes spec: backoffLimit: 6 extraMounts: diff --git a/tests/kuttl/tests/dataplane-service-custom-image/00-dataplane-create.yaml b/tests/kuttl/tests/dataplane-service-custom-image/00-dataplane-create.yaml index e1d3e3a5a..5fe844e61 100644 --- a/tests/kuttl/tests/dataplane-service-custom-image/00-dataplane-create.yaml +++ b/tests/kuttl/tests/dataplane-service-custom-image/00-dataplane-create.yaml @@ -20,13 +20,19 @@ metadata: name: edpm-no-nodes-custom-service spec: preProvisioned: true - deployStrategy: - deploy: true services: - custom-image-service + nodes: {} nodeTemplate: - nodes: {} ansible: ansibleUser: cloud-admin ansiblePort: 22 ansibleSSHPrivateKeySecret: dataplane-ansible-ssh-private-key-secret +--- +apiVersion: dataplane.openstack.org/v1beta1 +kind: OpenStackDataPlaneDeployment +metadata: + name: edpm-compute-no-nodes +spec: + nodeSets: + - edpm-no-nodes-custom-service diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index af9c052b8..75d5a9379 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -1,24 +1,4 @@ --- -- job: - name: dataplane-operator-crc-podified-edpm-baremetal - parent: cifmw-crc-podified-edpm-baremetal - irrelevant-files: &openstack_if - - ^tests/.*$ - - docs - - containers/ci - - .github/workflows - - .ci-operator.yaml - - .dockerignore - - .gitignore - - .golangci.yaml - - .pre-commit-config.yaml - - LICENSE - - OWNERS* - - PROJECT - - .*/*.md - - kuttl-test.yaml - - renovate.json - - job: name: dataplane-operator-docs-preview parent: cifmw-doc diff --git a/zuul.d/projects.yaml b/zuul.d/projects.yaml index 8f0519139..a75b5f836 100644 --- a/zuul.d/projects.yaml +++ b/zuul.d/projects.yaml @@ -4,8 +4,5 @@ github-check: jobs: - dataplane-operator-docs-preview - - openstack-k8s-operators-content-provider - - podified-multinode-edpm-deployment-crc: &content_provider - dependencies: - - openstack-k8s-operators-content-provider - - dataplane-operator-crc-podified-edpm-baremetal: *content_provider + templates: + - podified-multinode-edpm-baremetal-pipeline