Skip to content

Commit

Permalink
[Feature] Improve CRD Management and deprecate CRD Chart (#1247)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajanikow authored Feb 21, 2023
1 parent e709c07 commit 2bf6769
Show file tree
Hide file tree
Showing 47 changed files with 1,561 additions and 619 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- (Feature) Optional Action
- (Maintenance) Add & Enable YAML Linter
- (Feature) Optional ResignLeadership Action
- (Feature) Improve CRD Management and deprecate CRD Chart

## [1.2.24](https://github.com/arangodb/kube-arangodb/tree/1.2.24) (2023-01-25)
- (Bugfix) Fix deployment creation on ARM64
Expand Down
29 changes: 27 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,20 @@ endef
.PHONY: manifests
manifests:

$(eval $(call manifest-generator, crd, kube-arangodb-crd))
.PHONY: manifests-crd-file
manifests-crd-file:
@echo Building manifests for CRD - $(MANIFESTPATHCRD)
@echo -n > $(MANIFESTPATHCRD)
@$(foreach FILE,$(CRDS),echo '---\n# File: chart/kube-arangodb/crds/$(FILE).yaml' >> $(MANIFESTPATHCRD) && \
cat '$(ROOT)/chart/kube-arangodb/crds/$(FILE).yaml' >> $(MANIFESTPATHCRD) && \
echo '\n' >> $(MANIFESTPATHCRD);)
manifests: manifests-crd-file

.PHONY: manifests-crd-kustomize
manifests-crd-kustomize: manifests-crd-file
@echo Building manifests for CRD - $(KUSTOMIZEPATHCRD)
@cp "$(MANIFESTPATHCRD)" "$(KUSTOMIZEPATHCRD)"
manifests: manifests-crd-kustomize

$(eval $(call manifest-generator, deployment, kube-arangodb, \
--set "operator.features.deployment=true" \
Expand Down Expand Up @@ -481,6 +494,7 @@ run-unit-tests: $(SOURCES)
$(REPOPATH)/pkg/apis/storage/... \
$(REPOPATH)/pkg/deployment/... \
$(REPOPATH)/pkg/storage \
$(REPOPATH)/pkg/crd/... \
$(REPOPATH)/pkg/util/... \
$(REPOPATH)/pkg/handlers/...

Expand Down Expand Up @@ -526,6 +540,8 @@ tools-min: update-vendor
tools: tools-min
@echo ">> Fetching gci"
@GOBIN=$(GOPATH)/bin go install github.com/daixiang0/gci@v0.3.0
@echo ">> Fetching yamlfmt"
@GOBIN=$(GOPATH)/bin go install github.com/UltiRequiem/yamlfmt@v1.3.0
@echo ">> Downloading protobuf compiler..."
@curl -L ${PROTOC_URL} -o $(GOPATH)/protoc.zip
@echo ">> Unzipping protobuf compiler..."
Expand Down Expand Up @@ -612,7 +628,7 @@ check-enterprise:
check-community:
@$(MAKE) _check RELEASE_MODE=community

_check:
_check: sync-crds
@$(MAKE) fmt yamlfmt license-verify linter run-unit-tests bin

generate: generate-internal generate-proto fmt
Expand All @@ -628,3 +644,12 @@ generate-proto:

.PHONY: fix
fix: license-range fmt license yamlfmt

CRDS:=apps-job \
backups-backup backups-backuppolicy \
database-clustersynchronization database-deployment database-member database-task \
replication-deploymentreplication

.PHONY: sync-crds
sync-crds:
@cp $(foreach FILE,$(CRDS),"$(ROOT)/chart/kube-arangodb/crds/$(FILE).yaml" ) "$(ROOT)/pkg/crd/crds/"
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ Only use this procedure for a new install of the operator. See below for
upgrades.

```bash
# The following will install the custom resources required by the operators.
helm install https://github.com/arangodb/kube-arangodb/releases/download/1.2.24/kube-arangodb-crd-1.2.24.tgz
# The following will install the operator for `ArangoDeployment` &
# `ArangoDeploymentReplication` resources.
helm install https://github.com/arangodb/kube-arangodb/releases/download/1.2.24/kube-arangodb-1.2.24.tgz
Expand All @@ -136,7 +134,6 @@ list` output:
```
% helm list
NAME REVISION UPDATED STATUS CHART APP VERSION NAMESPACE
steely-mule 1 Sun Mar 31 21:11:07 2019 DEPLOYED kube-arangodb-crd-0.3.9 default
vetoed-ladybird 1 Mon Apr 8 11:36:58 2019 DEPLOYED kube-arangodb-0.3.10-preview default
```

Expand Down Expand Up @@ -200,8 +197,6 @@ Only use this procedure for a new install of the operator. See below for
upgrades.

```bash
# The following will install the custom resources required by the operators.
helm install https://github.com/arangodb/kube-arangodb/releases/download/1.2.24/kube-arangodb-crd-1.2.24.tgz --set "operator.image=arangodb/kube-arangodb-enterprise:1.2.24"
# The following will install the operator for `ArangoDeployment` &
# `ArangoDeploymentReplication` resources.
helm install https://github.com/arangodb/kube-arangodb/releases/download/1.2.24/kube-arangodb-1.2.24.tgz --set "operator.image=arangodb/kube-arangodb-enterprise:1.2.24"
Expand All @@ -225,7 +220,6 @@ list` output:
```
% helm list
NAME REVISION UPDATED STATUS CHART APP VERSION NAMESPACE
steely-mule 1 Sun Mar 31 21:11:07 2019 DEPLOYED kube-arangodb-crd-0.3.9 default
vetoed-ladybird 1 Mon Apr 8 11:36:58 2019 DEPLOYED kube-arangodb-0.3.10-preview default
```

Expand Down
2 changes: 1 addition & 1 deletion chart/kube-arangodb-crd/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: kube-arangodb-crd
version: 1.2.24
description: "ArangoDB Kubernetes Custom Resource Definitions"
description: "ArangoDB Kubernetes Custom Resource Definitions (Deprecated)"
tillerVersion: ">2.7"
appVersion: 3.5.0
29 changes: 29 additions & 0 deletions chart/kube-arangodb/crds/apps-job.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: arangojobs.apps.arangodb.com
spec:
group: apps.arangodb.com
names:
kind: ArangoJob
listKind: ArangoJobList
plural: arangojobs
singular: arangojob
shortNames:
- arangojob
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
type: object
x-kubernetes-preserve-unknown-fields: true
served: true
storage: true
additionalPrinterColumns:
- jsonPath: .spec.arangoDeploymentName
description: Deployment name
name: ArangoDeploymentName
type: string
subresources:
status: {}
103 changes: 103 additions & 0 deletions chart/kube-arangodb/crds/backups-backup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: arangobackups.backup.arangodb.com
spec:
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
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: {}
- 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: {}
62 changes: 62 additions & 0 deletions chart/kube-arangodb/crds/backups-backuppolicy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: arangobackuppolicies.backup.arangodb.com
spec:
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
description: Scheduled
name: Scheduled
type: string
- jsonPath: .status.message
priority: 1
description: Message of the ArangoBackupPolicy object
name: Message
type: string
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: {}
33 changes: 33 additions & 0 deletions chart/kube-arangodb/crds/database-clustersynchronization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: arangoclustersynchronizations.database.arangodb.com
spec:
group: database.arangodb.com
names:
kind: ArangoClusterSynchronization
listKind: ArangoClusterSynchronizationList
plural: arangoclustersynchronizations
singular: arangoclustersynchronization
shortNames:
- arangoclustersync
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
type: object
x-kubernetes-preserve-unknown-fields: true
served: true
storage: true
subresources:
status: {}
- name: v2alpha1
schema:
openAPIV3Schema:
type: object
x-kubernetes-preserve-unknown-fields: true
served: true
storage: false
subresources:
status: {}
39 changes: 39 additions & 0 deletions chart/kube-arangodb/crds/database-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: arangodeployments.database.arangodb.com
spec:
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: {}
File renamed without changes.
Loading

0 comments on commit 2bf6769

Please sign in to comment.