diff --git a/ansible/templates/awxbackup_crd.yml.j2 b/ansible/templates/awxbackup_crd.yml.j2 index 698bfbee..a8257fb6 100644 --- a/ansible/templates/awxbackup_crd.yml.j2 +++ b/ansible/templates/awxbackup_crd.yml.j2 @@ -25,6 +25,8 @@ spec: properties: spec: type: object + required: + - deployment_name properties: deployment_name: description: Name of the deployment to be backed up @@ -44,5 +46,3 @@ spec: postgres_label_selector: description: Label selector used to identify postgres pod for backing up data type: string - oneOf: - - required: ["deployment_name"] diff --git a/ansible/templates/awxrestore_crd.yml.j2 b/ansible/templates/awxrestore_crd.yml.j2 index d98e512a..7388b445 100644 --- a/ansible/templates/awxrestore_crd.yml.j2 +++ b/ansible/templates/awxrestore_crd.yml.j2 @@ -26,6 +26,12 @@ spec: spec: type: object properties: + backup_source: + description: Backup source + type: string + enum: + - CR + - PVC deployment_name: description: Name of the deployment to be restored to type: string @@ -44,5 +50,3 @@ spec: postgres_label_selector: description: Label selector used to identify postgres pod for backing up data type: string - oneOf: - - required: ["deployment_name", "backup_pvc_namespace"] diff --git a/deploy/awx-operator.yaml b/deploy/awx-operator.yaml index a7a9e189..4bf84ac0 100644 --- a/deploy/awx-operator.yaml +++ b/deploy/awx-operator.yaml @@ -415,6 +415,8 @@ spec: properties: spec: type: object + required: + - deployment_name properties: deployment_name: description: Name of the deployment to be backed up @@ -434,8 +436,6 @@ spec: postgres_label_selector: description: Label selector used to identify postgres pod for backing up data type: string - oneOf: - - required: ["deployment_name"] --- apiVersion: apiextensions.k8s.io/v1 @@ -465,6 +465,12 @@ spec: spec: type: object properties: + backup_source: + description: Backup source + type: string + enum: + - CR + - PVC deployment_name: description: Name of the deployment to be restored to type: string @@ -483,8 +489,6 @@ spec: postgres_label_selector: description: Label selector used to identify postgres pod for backing up data type: string - oneOf: - - required: ["deployment_name", "backup_pvc_namespace"] --- apiVersion: rbac.authorization.k8s.io/v1 diff --git a/deploy/crds/awxbackup_v1beta1_crd.yaml b/deploy/crds/awxbackup_v1beta1_crd.yaml index 698bfbee..a8257fb6 100644 --- a/deploy/crds/awxbackup_v1beta1_crd.yaml +++ b/deploy/crds/awxbackup_v1beta1_crd.yaml @@ -25,6 +25,8 @@ spec: properties: spec: type: object + required: + - deployment_name properties: deployment_name: description: Name of the deployment to be backed up @@ -44,5 +46,3 @@ spec: postgres_label_selector: description: Label selector used to identify postgres pod for backing up data type: string - oneOf: - - required: ["deployment_name"] diff --git a/deploy/crds/awxrestore_v1beta1_crd.yaml b/deploy/crds/awxrestore_v1beta1_crd.yaml index d98e512a..7388b445 100644 --- a/deploy/crds/awxrestore_v1beta1_crd.yaml +++ b/deploy/crds/awxrestore_v1beta1_crd.yaml @@ -26,6 +26,12 @@ spec: spec: type: object properties: + backup_source: + description: Backup source + type: string + enum: + - CR + - PVC deployment_name: description: Name of the deployment to be restored to type: string @@ -44,5 +50,3 @@ spec: postgres_label_selector: description: Label selector used to identify postgres pod for backing up data type: string - oneOf: - - required: ["deployment_name", "backup_pvc_namespace"] diff --git a/deploy/olm-catalog/awx-operator/manifests/awx-operator.clusterserviceversion.yaml b/deploy/olm-catalog/awx-operator/manifests/awx-operator.clusterserviceversion.yaml index 175433e6..4ea3e91b 100644 --- a/deploy/olm-catalog/awx-operator/manifests/awx-operator.clusterserviceversion.yaml +++ b/deploy/olm-catalog/awx-operator/manifests/awx-operator.clusterserviceversion.yaml @@ -38,6 +38,96 @@ spec: apiservicedefinitions: {} customresourcedefinitions: owned: + - kind: AWXBackup + name: awxbackups.awx.ansible.com + version: v1beta1 + displayName: AWX Backup + specDescriptors: + - displayName: Deployment name + path: deployment_name + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - displayName: Backup persistent volume claim + path: backup_pvc + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - urn:alm:descriptor:com.tectonic.ui:advanced + - displayName: Backup persistent volume claim namespace + path: backup_pvc_namespace + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - urn:alm:descriptor:com.tectonic.ui:advanced + - displayName: Backup PVC storage requirements + path: backup_storage_requirements + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - urn:alm:descriptor:com.tectonic.ui:advanced + - displayName: Backup PVC storage class + path: backup_storage_class + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - urn:alm:descriptor:com.tectonic.ui:advanced + - displayName: Database backup label selector + path: postgres_label_selector + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:advanced + - urn:alm:descriptor:com.tectonic.ui:hidden + statusDescriptors: + - displayName: Backup claim + description: The persistent volume claim name used during backup + path: backupClaim + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - displayName: Backup directory + description: The directory data is backed up to on the PVC + path: backupDirectory + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - kind: AWXRestore + name: awxrestores.awx.ansible.com + version: v1beta1 + displayName: AWX Restore + specDescriptors: + - displayName: Backup source to restore ? + path: backup_source + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:select:CR + - urn:alm:descriptor:com.tectonic.ui:select:PVC + - displayName: Backup name + path: backup_name + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - urn:alm:descriptor:com.tectonic.ui:fieldDependency:backup_source:CR + - displayName: Deployment name + path: deployment_name + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - urn:alm:descriptor:com.tectonic.ui:fieldDependency:backup_source:PVC + - displayName: Backup persistent volume claim + path: backup_pvc + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - urn:alm:descriptor:com.tectonic.ui:fieldDependency:backup_source:PVC + - displayName: Backup persistent volume claim namespace + path: backup_pvc_namespace + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - urn:alm:descriptor:com.tectonic.ui:fieldDependency:backup_source:PVC + - displayName: Backup directory in the persistent volume claim + path: backup_dir + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - urn:alm:descriptor:com.tectonic.ui:fieldDependency:backup_source:PVC + - displayName: Database restore label selector + path: postgres_label_selector + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:hidden + statusDescriptors: + - displayName: Restore status + description: The state of the restore + path: towerRestoreComplete + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text - description: A AWX Instance displayName: AWX kind: AWX diff --git a/deploy/olm-catalog/awx-operator/manifests/awx.ansible.com_awxbackups_crd.yaml b/deploy/olm-catalog/awx-operator/manifests/awx.ansible.com_awxbackups_crd.yaml new file mode 100644 index 00000000..47ff3b31 --- /dev/null +++ b/deploy/olm-catalog/awx-operator/manifests/awx.ansible.com_awxbackups_crd.yaml @@ -0,0 +1,55 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + name: awxbackups.awx.ansible.com +spec: + group: awx.ansible.com + names: + kind: AWXBackup + listKind: AWXBackupList + plural: awxbackups + singular: awxbackup + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + description: Schema validation for the AWXBackup CRD + properties: + spec: + required: + - deployment_name + properties: + backup_pvc: + description: Name of the PVC to be used for storing the backup + type: string + backup_pvc_namespace: + description: Namespace PVC is in + type: string + backup_storage_class: + description: Storage class to use when creating PVC for backup + type: string + backup_storage_requirements: + description: Storage requirements for the PostgreSQL container + type: string + deployment_name: + description: Name of the deployment to be backed up + type: string + postgres_label_selector: + description: Label selector used to identify postgres pod for backing + up data + type: string + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: null diff --git a/deploy/olm-catalog/awx-operator/manifests/awx.ansible.com_awxrestores_crd.yaml b/deploy/olm-catalog/awx-operator/manifests/awx.ansible.com_awxrestores_crd.yaml new file mode 100644 index 00000000..b09fe42d --- /dev/null +++ b/deploy/olm-catalog/awx-operator/manifests/awx.ansible.com_awxrestores_crd.yaml @@ -0,0 +1,61 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + name: awxrestores.awx.ansible.com +spec: + group: awx.ansible.com + names: + kind: AWXRestore + listKind: AWXRestoreList + plural: awxrestores + singular: awxrestore + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + description: Schema validation for the AWXRestore CRD + properties: + spec: + properties: + backup_source: + description: Backup source + type: string + enum: + - CR + - PVC + backup_dir: + description: Backup directory name, set as a status found on the awxbackup + object (backupDirectory) + type: string + backup_name: + description: AWXBackup object name + type: string + backup_pvc: + description: Name of the PVC to be restored from, set as a status + found on the awxbackup object (backupClaim) + type: string + backup_pvc_namespace: + description: Namespace the PVC is in + type: string + deployment_name: + description: Name of the deployment to be restored to + type: string + postgres_label_selector: + description: Label selector used to identify postgres pod for backing + up data + type: string + type: object + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: null