From 35c9ffa56dfb9d19ea5310d73b074090b3f458fb Mon Sep 17 00:00:00 2001 From: ajanikow <12255597+ajanikow@users.noreply.github.com> Date: Wed, 11 Nov 2020 23:49:33 +0000 Subject: [PATCH] Migrate CRD to V1 --- CHANGELOG.md | 1 + .../templates/backup-policy.yaml | 85 +++++++++------ chart/kube-arangodb-crd/templates/backup.yaml | 100 +++++++++++++----- .../templates/deployment-replications.yaml | 52 +++++---- .../templates/deployment.yaml | 54 ++++++---- .../templates/deployment-operator/role.yaml | 2 +- .../role.yaml | 2 +- 7 files changed, 198 insertions(+), 98 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5080f0145..79fbefa3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Change Log ## [master](https://github.com/arangodb/kube-arangodb/tree/master) (N/A) +- Migrate CRD to apiextensions.k8s.io/v1 ## [1.1.2](https://github.com/arangodb/kube-arangodb/tree/1.1.2) (2020-11-11) - Fix Bootstrap phase and move it under Plan diff --git a/chart/kube-arangodb-crd/templates/backup-policy.yaml b/chart/kube-arangodb-crd/templates/backup-policy.yaml index 34b6a829d..c79c3988a 100644 --- a/chart/kube-arangodb-crd/templates/backup-policy.yaml +++ b/chart/kube-arangodb-crd/templates/backup-policy.yaml @@ -1,45 +1,68 @@ -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - name: arangobackuppolicies.backup.arangodb.com - labels: - app.kubernetes.io/name: {{ template "kube-arangodb-crd.name" . }} - helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/instance: {{ .Release.Name }} - release: {{ .Release.Name }} + name: arangobackuppolicies.backup.arangodb.com + labels: + app.kubernetes.io/name: {{ template "kube-arangodb-crd.name" . }} + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + release: {{ .Release.Name }} spec: - group: backup.arangodb.com - additionalPrinterColumns: - - JSONPath: .spec.schedule + group: backup.arangodb.com + names: + kind: ArangoBackupPolicy + listKind: ArangoBackupPolicyList + plural: arangobackuppolicies + shortNames: + - arangobackuppolicy + - arangobp + singular: arangobackuppolicy + scope: Namespaced + versions: + - name: v1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + additionalPrinterColumns: + - jsonPath: .spec.schedule description: Schedule name: Schedule type: string - - JSONPath: .status.scheduled + - jsonPath: .status.scheduled description: Scheduled name: Scheduled type: string - - JSONPath: .status.message + - jsonPath: .status.message priority: 1 description: Message of the ArangoBackupPolicy object name: Message type: string - names: - kind: ArangoBackupPolicy - listKind: ArangoBackupPolicyList - plural: arangobackuppolicies - shortNames: - - arangobackuppolicy - - arangobp - singular: arangobackuppolicy - scope: Namespaced - subresources: + subresources: + status: {} + - name: v1alpha + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: false + additionalPrinterColumns: + - jsonPath: .spec.schedule + description: Schedule + name: Schedule + type: string + - jsonPath: .status.scheduled + description: Scheduled + name: Scheduled + type: string + - jsonPath: .status.message + priority: 1 + description: Message of the ArangoBackupPolicy object + name: Message + type: string + subresources: status: {} - version: v1 - versions: - - name: v1 - served: true - storage: true - - name: v1alpha - served: true - storage: false diff --git a/chart/kube-arangodb-crd/templates/backup.yaml b/chart/kube-arangodb-crd/templates/backup.yaml index 904fd9519..e607425b5 100644 --- a/chart/kube-arangodb-crd/templates/backup.yaml +++ b/chart/kube-arangodb-crd/templates/backup.yaml @@ -1,4 +1,4 @@ -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: arangobackups.backup.arangodb.com @@ -9,57 +9,101 @@ metadata: app.kubernetes.io/instance: {{ .Release.Name }} release: {{ .Release.Name }} spec: - group: backup.arangodb.com - additionalPrinterColumns: - - JSONPath: .spec.policyName + group: backup.arangodb.com + names: + kind: ArangoBackup + listKind: ArangoBackupList + plural: arangobackups + shortNames: + - arangobackup + singular: arangobackup + scope: Namespaced + versions: + - name: v1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + additionalPrinterColumns: + - jsonPath: .spec.policyName description: Policy name name: Policy type: string - - JSONPath: .spec.deployment.name + - jsonPath: .spec.deployment.name description: Deployment name name: Deployment type: string - - JSONPath: .status.backup.version + - jsonPath: .status.backup.version description: Backup Version name: Version type: string - - JSONPath: .status.backup.createdAt + - jsonPath: .status.backup.createdAt description: Backup Creation Timestamp name: Created type: string - - JSONPath: .status.backup.sizeInBytes + - jsonPath: .status.backup.sizeInBytes description: Backup Size in Bytes name: Size type: integer format: byte - - JSONPath: .status.backup.numberOfDBServers + - jsonPath: .status.backup.numberOfDBServers description: Backup Number of the DB Servers name: DBServers type: integer - - JSONPath: .status.state + - jsonPath: .status.state description: The actual state of the ArangoBackup name: State type: string - - JSONPath: .status.message + - jsonPath: .status.message priority: 1 description: Message of the ArangoBackup object name: Message type: string - names: - kind: ArangoBackup - listKind: ArangoBackupList - plural: arangobackups - shortNames: - - arangobackup - singular: arangobackup - scope: Namespaced - subresources: + subresources: + status: {} + - name: v1alpha + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: false + additionalPrinterColumns: + - jsonPath: .spec.policyName + description: Policy name + name: Policy + type: string + - jsonPath: .spec.deployment.name + description: Deployment name + name: Deployment + type: string + - jsonPath: .status.backup.version + description: Backup Version + name: Version + type: string + - jsonPath: .status.backup.createdAt + description: Backup Creation Timestamp + name: Created + type: string + - jsonPath: .status.backup.sizeInBytes + description: Backup Size in Bytes + name: Size + type: integer + format: byte + - jsonPath: .status.backup.numberOfDBServers + description: Backup Number of the DB Servers + name: DBServers + type: integer + - jsonPath: .status.state + description: The actual state of the ArangoBackup + name: State + type: string + - jsonPath: .status.message + priority: 1 + description: Message of the ArangoBackup object + name: Message + type: string + subresources: status: {} - version: v1 - versions: - - name: v1 - served: true - storage: true - - name: v1alpha - served: true - storage: false \ No newline at end of file diff --git a/chart/kube-arangodb-crd/templates/deployment-replications.yaml b/chart/kube-arangodb-crd/templates/deployment-replications.yaml index 597bc981a..1e309ff53 100644 --- a/chart/kube-arangodb-crd/templates/deployment-replications.yaml +++ b/chart/kube-arangodb-crd/templates/deployment-replications.yaml @@ -1,4 +1,4 @@ -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: arangodeploymentreplications.replication.database.arangodb.com @@ -9,20 +9,36 @@ metadata: app.kubernetes.io/instance: {{ .Release.Name }} release: {{ .Release.Name }} spec: - group: replication.database.arangodb.com - names: - kind: ArangoDeploymentReplication - listKind: ArangoDeploymentReplicationList - plural: arangodeploymentreplications - shortNames: - - arangorepl - singular: arangodeploymentreplication - scope: Namespaced - version: v1 - versions: - - name: v1 - served: true - storage: true - - name: v1alpha - served: true - storage: false \ No newline at end of file + group: replication.database.arangodb.com + names: + kind: ArangoDeploymentReplication + listKind: ArangoDeploymentReplicationList + plural: arangodeploymentreplications + shortNames: + - arangorepl + singular: arangodeploymentreplication + scope: Namespaced + versions: + - name: v1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + - name: v1alpha + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: false + - name: v2alpha1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: false + subresources: + status: {} diff --git a/chart/kube-arangodb-crd/templates/deployment.yaml b/chart/kube-arangodb-crd/templates/deployment.yaml index d9fe646d1..2f5e3b4ee 100644 --- a/chart/kube-arangodb-crd/templates/deployment.yaml +++ b/chart/kube-arangodb-crd/templates/deployment.yaml @@ -1,4 +1,4 @@ -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: arangodeployments.database.arangodb.com @@ -9,21 +9,37 @@ metadata: app.kubernetes.io/instance: {{ .Release.Name }} release: {{ .Release.Name }} spec: - group: database.arangodb.com - names: - kind: ArangoDeployment - listKind: ArangoDeploymentList - plural: arangodeployments - shortNames: - - arangodb - - arango - singular: arangodeployment - scope: Namespaced - version: v1 - versions: - - name: v1 - served: true - storage: true - - name: v1alpha - served: true - storage: false \ No newline at end of file + group: database.arangodb.com + names: + kind: ArangoDeployment + listKind: ArangoDeploymentList + plural: arangodeployments + shortNames: + - arangodb + - arango + singular: arangodeployment + scope: Namespaced + versions: + - name: v1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: true + - name: v1alpha + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: false + - name: v2alpha1 + schema: + openAPIV3Schema: + type: object + x-kubernetes-preserve-unknown-fields: true + served: true + storage: false + subresources: + status: {} \ No newline at end of file diff --git a/chart/kube-arangodb/templates/deployment-operator/role.yaml b/chart/kube-arangodb/templates/deployment-operator/role.yaml index 9d5d8cd15..edf9b6648 100644 --- a/chart/kube-arangodb/templates/deployment-operator/role.yaml +++ b/chart/kube-arangodb/templates/deployment-operator/role.yaml @@ -14,7 +14,7 @@ metadata: release: {{ .Release.Name }} rules: - apiGroups: ["database.arangodb.com"] - resources: ["arangodeployments"] + resources: ["arangodeployments", "arangodeployments/status"] verbs: ["*"] - apiGroups: [""] resources: ["pods", "services", "endpoints", "persistentvolumeclaims", "events", "secrets", "serviceaccounts"] diff --git a/chart/kube-arangodb/templates/deployment-replications-operator/role.yaml b/chart/kube-arangodb/templates/deployment-replications-operator/role.yaml index ffd22b0a2..c8cf8f993 100644 --- a/chart/kube-arangodb/templates/deployment-replications-operator/role.yaml +++ b/chart/kube-arangodb/templates/deployment-replications-operator/role.yaml @@ -14,7 +14,7 @@ metadata: release: {{ .Release.Name }} rules: - apiGroups: ["replication.database.arangodb.com"] - resources: ["arangodeploymentreplications"] + resources: ["arangodeploymentreplications", "arangodeploymentreplications/status"] verbs: ["*"] - apiGroups: ["database.arangodb.com"] resources: ["arangodeployments"]