Skip to content

Commit 2bf6769

Browse files
authored
[Feature] Improve CRD Management and deprecate CRD Chart (#1247)
1 parent e709c07 commit 2bf6769

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1561
-619
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
- (Feature) Optional Action
1414
- (Maintenance) Add & Enable YAML Linter
1515
- (Feature) Optional ResignLeadership Action
16+
- (Feature) Improve CRD Management and deprecate CRD Chart
1617

1718
## [1.2.24](https://github.com/arangodb/kube-arangodb/tree/1.2.24) (2023-01-25)
1819
- (Bugfix) Fix deployment creation on ARM64

Makefile

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,20 @@ endef
397397
.PHONY: manifests
398398
manifests:
399399

400-
$(eval $(call manifest-generator, crd, kube-arangodb-crd))
400+
.PHONY: manifests-crd-file
401+
manifests-crd-file:
402+
@echo Building manifests for CRD - $(MANIFESTPATHCRD)
403+
@echo -n > $(MANIFESTPATHCRD)
404+
@$(foreach FILE,$(CRDS),echo '---\n# File: chart/kube-arangodb/crds/$(FILE).yaml' >> $(MANIFESTPATHCRD) && \
405+
cat '$(ROOT)/chart/kube-arangodb/crds/$(FILE).yaml' >> $(MANIFESTPATHCRD) && \
406+
echo '\n' >> $(MANIFESTPATHCRD);)
407+
manifests: manifests-crd-file
408+
409+
.PHONY: manifests-crd-kustomize
410+
manifests-crd-kustomize: manifests-crd-file
411+
@echo Building manifests for CRD - $(KUSTOMIZEPATHCRD)
412+
@cp "$(MANIFESTPATHCRD)" "$(KUSTOMIZEPATHCRD)"
413+
manifests: manifests-crd-kustomize
401414

402415
$(eval $(call manifest-generator, deployment, kube-arangodb, \
403416
--set "operator.features.deployment=true" \
@@ -481,6 +494,7 @@ run-unit-tests: $(SOURCES)
481494
$(REPOPATH)/pkg/apis/storage/... \
482495
$(REPOPATH)/pkg/deployment/... \
483496
$(REPOPATH)/pkg/storage \
497+
$(REPOPATH)/pkg/crd/... \
484498
$(REPOPATH)/pkg/util/... \
485499
$(REPOPATH)/pkg/handlers/...
486500

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

615-
_check:
631+
_check: sync-crds
616632
@$(MAKE) fmt yamlfmt license-verify linter run-unit-tests bin
617633

618634
generate: generate-internal generate-proto fmt
@@ -628,3 +644,12 @@ generate-proto:
628644

629645
.PHONY: fix
630646
fix: license-range fmt license yamlfmt
647+
648+
CRDS:=apps-job \
649+
backups-backup backups-backuppolicy \
650+
database-clustersynchronization database-deployment database-member database-task \
651+
replication-deploymentreplication
652+
653+
.PHONY: sync-crds
654+
sync-crds:
655+
@cp $(foreach FILE,$(CRDS),"$(ROOT)/chart/kube-arangodb/crds/$(FILE).yaml" ) "$(ROOT)/pkg/crd/crds/"

README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,6 @@ Only use this procedure for a new install of the operator. See below for
111111
upgrades.
112112

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

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

202199
```bash
203-
# The following will install the custom resources required by the operators.
204-
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"
205200
# The following will install the operator for `ArangoDeployment` &
206201
# `ArangoDeploymentReplication` resources.
207202
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"
@@ -225,7 +220,6 @@ list` output:
225220
```
226221
% helm list
227222
NAME REVISION UPDATED STATUS CHART APP VERSION NAMESPACE
228-
steely-mule 1 Sun Mar 31 21:11:07 2019 DEPLOYED kube-arangodb-crd-0.3.9 default
229223
vetoed-ladybird 1 Mon Apr 8 11:36:58 2019 DEPLOYED kube-arangodb-0.3.10-preview default
230224
```
231225

chart/kube-arangodb-crd/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: kube-arangodb-crd
22
version: 1.2.24
3-
description: "ArangoDB Kubernetes Custom Resource Definitions"
3+
description: "ArangoDB Kubernetes Custom Resource Definitions (Deprecated)"
44
tillerVersion: ">2.7"
55
appVersion: 3.5.0
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
apiVersion: apiextensions.k8s.io/v1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
name: arangojobs.apps.arangodb.com
5+
spec:
6+
group: apps.arangodb.com
7+
names:
8+
kind: ArangoJob
9+
listKind: ArangoJobList
10+
plural: arangojobs
11+
singular: arangojob
12+
shortNames:
13+
- arangojob
14+
scope: Namespaced
15+
versions:
16+
- name: v1
17+
schema:
18+
openAPIV3Schema:
19+
type: object
20+
x-kubernetes-preserve-unknown-fields: true
21+
served: true
22+
storage: true
23+
additionalPrinterColumns:
24+
- jsonPath: .spec.arangoDeploymentName
25+
description: Deployment name
26+
name: ArangoDeploymentName
27+
type: string
28+
subresources:
29+
status: {}
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
apiVersion: apiextensions.k8s.io/v1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
name: arangobackups.backup.arangodb.com
5+
spec:
6+
group: backup.arangodb.com
7+
names:
8+
kind: ArangoBackup
9+
listKind: ArangoBackupList
10+
plural: arangobackups
11+
shortNames:
12+
- arangobackup
13+
singular: arangobackup
14+
scope: Namespaced
15+
versions:
16+
- name: v1
17+
schema:
18+
openAPIV3Schema:
19+
type: object
20+
x-kubernetes-preserve-unknown-fields: true
21+
served: true
22+
storage: true
23+
additionalPrinterColumns:
24+
- jsonPath: .spec.policyName
25+
description: Policy name
26+
name: Policy
27+
type: string
28+
- jsonPath: .spec.deployment.name
29+
description: Deployment name
30+
name: Deployment
31+
type: string
32+
- jsonPath: .status.backup.version
33+
description: Backup Version
34+
name: Version
35+
type: string
36+
- jsonPath: .status.backup.createdAt
37+
description: Backup Creation Timestamp
38+
name: Created
39+
type: string
40+
- jsonPath: .status.backup.sizeInBytes
41+
description: Backup Size in Bytes
42+
name: Size
43+
type: integer
44+
format: byte
45+
- jsonPath: .status.backup.numberOfDBServers
46+
description: Backup Number of the DB Servers
47+
name: DBServers
48+
type: integer
49+
- jsonPath: .status.state
50+
description: The actual state of the ArangoBackup
51+
name: State
52+
type: string
53+
- jsonPath: .status.message
54+
priority: 1
55+
description: Message of the ArangoBackup object
56+
name: Message
57+
type: string
58+
subresources:
59+
status: {}
60+
- name: v1alpha
61+
schema:
62+
openAPIV3Schema:
63+
type: object
64+
x-kubernetes-preserve-unknown-fields: true
65+
served: true
66+
storage: false
67+
additionalPrinterColumns:
68+
- jsonPath: .spec.policyName
69+
description: Policy name
70+
name: Policy
71+
type: string
72+
- jsonPath: .spec.deployment.name
73+
description: Deployment name
74+
name: Deployment
75+
type: string
76+
- jsonPath: .status.backup.version
77+
description: Backup Version
78+
name: Version
79+
type: string
80+
- jsonPath: .status.backup.createdAt
81+
description: Backup Creation Timestamp
82+
name: Created
83+
type: string
84+
- jsonPath: .status.backup.sizeInBytes
85+
description: Backup Size in Bytes
86+
name: Size
87+
type: integer
88+
format: byte
89+
- jsonPath: .status.backup.numberOfDBServers
90+
description: Backup Number of the DB Servers
91+
name: DBServers
92+
type: integer
93+
- jsonPath: .status.state
94+
description: The actual state of the ArangoBackup
95+
name: State
96+
type: string
97+
- jsonPath: .status.message
98+
priority: 1
99+
description: Message of the ArangoBackup object
100+
name: Message
101+
type: string
102+
subresources:
103+
status: {}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
apiVersion: apiextensions.k8s.io/v1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
name: arangobackuppolicies.backup.arangodb.com
5+
spec:
6+
group: backup.arangodb.com
7+
names:
8+
kind: ArangoBackupPolicy
9+
listKind: ArangoBackupPolicyList
10+
plural: arangobackuppolicies
11+
shortNames:
12+
- arangobackuppolicy
13+
- arangobp
14+
singular: arangobackuppolicy
15+
scope: Namespaced
16+
versions:
17+
- name: v1
18+
schema:
19+
openAPIV3Schema:
20+
type: object
21+
x-kubernetes-preserve-unknown-fields: true
22+
served: true
23+
storage: true
24+
additionalPrinterColumns:
25+
- jsonPath: .spec.schedule
26+
description: Schedule
27+
name: Schedule
28+
type: string
29+
- jsonPath: .status.scheduled
30+
description: Scheduled
31+
name: Scheduled
32+
type: string
33+
- jsonPath: .status.message
34+
priority: 1
35+
description: Message of the ArangoBackupPolicy object
36+
name: Message
37+
type: string
38+
subresources:
39+
status: {}
40+
- name: v1alpha
41+
schema:
42+
openAPIV3Schema:
43+
type: object
44+
x-kubernetes-preserve-unknown-fields: true
45+
served: true
46+
storage: false
47+
additionalPrinterColumns:
48+
- jsonPath: .spec.schedule
49+
description: Schedule
50+
name: Schedule
51+
type: string
52+
- jsonPath: .status.scheduled
53+
description: Scheduled
54+
name: Scheduled
55+
type: string
56+
- jsonPath: .status.message
57+
priority: 1
58+
description: Message of the ArangoBackupPolicy object
59+
name: Message
60+
type: string
61+
subresources:
62+
status: {}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
apiVersion: apiextensions.k8s.io/v1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
name: arangoclustersynchronizations.database.arangodb.com
5+
spec:
6+
group: database.arangodb.com
7+
names:
8+
kind: ArangoClusterSynchronization
9+
listKind: ArangoClusterSynchronizationList
10+
plural: arangoclustersynchronizations
11+
singular: arangoclustersynchronization
12+
shortNames:
13+
- arangoclustersync
14+
scope: Namespaced
15+
versions:
16+
- name: v1
17+
schema:
18+
openAPIV3Schema:
19+
type: object
20+
x-kubernetes-preserve-unknown-fields: true
21+
served: true
22+
storage: true
23+
subresources:
24+
status: {}
25+
- name: v2alpha1
26+
schema:
27+
openAPIV3Schema:
28+
type: object
29+
x-kubernetes-preserve-unknown-fields: true
30+
served: true
31+
storage: false
32+
subresources:
33+
status: {}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
apiVersion: apiextensions.k8s.io/v1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
name: arangodeployments.database.arangodb.com
5+
spec:
6+
group: database.arangodb.com
7+
names:
8+
kind: ArangoDeployment
9+
listKind: ArangoDeploymentList
10+
plural: arangodeployments
11+
shortNames:
12+
- arangodb
13+
- arango
14+
singular: arangodeployment
15+
scope: Namespaced
16+
versions:
17+
- name: v1
18+
schema:
19+
openAPIV3Schema:
20+
type: object
21+
x-kubernetes-preserve-unknown-fields: true
22+
served: true
23+
storage: true
24+
- name: v1alpha
25+
schema:
26+
openAPIV3Schema:
27+
type: object
28+
x-kubernetes-preserve-unknown-fields: true
29+
served: true
30+
storage: false
31+
- name: v2alpha1
32+
schema:
33+
openAPIV3Schema:
34+
type: object
35+
x-kubernetes-preserve-unknown-fields: true
36+
served: true
37+
storage: false
38+
subresources:
39+
status: {}

0 commit comments

Comments
 (0)