Skip to content

Commit 0b606b0

Browse files
authored
Merge pull request #287 from arangodb/bug-fix/extra-crd-yaml
Bug fix/extra crd yaml
2 parents 5f786f6 + 9acd89d commit 0b606b0

File tree

9 files changed

+42
-2
lines changed

9 files changed

+42
-2
lines changed

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ ifndef MANIFESTSUFFIX
5252
MANIFESTSUFFIX := -dev
5353
endif
5454
endif
55+
MANIFESTPATHCRD := manifests/arango-crd$(MANIFESTSUFFIX).yaml
5556
MANIFESTPATHDEPLOYMENT := manifests/arango-deployment$(MANIFESTSUFFIX).yaml
5657
MANIFESTPATHDEPLOYMENTREPLICATION := manifests/arango-deployment-replication$(MANIFESTSUFFIX).yaml
5758
MANIFESTPATHSTORAGE := manifests/arango-storage$(MANIFESTSUFFIX).yaml
@@ -236,6 +237,7 @@ endif
236237

237238
.PHONY: manifests
238239
manifests: $(GOBUILDDIR)
240+
echo Building manifests
239241
GOPATH=$(GOBUILDDIR) go run $(ROOTDIR)/tools/manifests/manifest_builder.go \
240242
--output-suffix=$(MANIFESTSUFFIX) \
241243
--image=$(OPERATORIMAGE) \
@@ -299,6 +301,7 @@ ifneq ($(DEPLOYMENTNAMESPACE), default)
299301
$(ROOTDIR)/scripts/kube_delete_namespace.sh $(DEPLOYMENTNAMESPACE)
300302
kubectl create namespace $(DEPLOYMENTNAMESPACE)
301303
endif
304+
kubectl apply -f $(MANIFESTPATHCRD)
302305
kubectl apply -f $(MANIFESTPATHSTORAGE)
303306
kubectl apply -f $(MANIFESTPATHDEPLOYMENT)
304307
kubectl apply -f $(MANIFESTPATHDEPLOYMENTREPLICATION)
@@ -403,9 +406,11 @@ delete-operator:
403406
kubectl delete -f $(MANIFESTPATHDEPLOYMENT) --ignore-not-found
404407
kubectl delete -f $(MANIFESTPATHDEPLOYMENTREPLICATION) --ignore-not-found
405408
kubectl delete -f $(MANIFESTPATHSTORAGE) --ignore-not-found
409+
kubectl delete -f $(MANIFESTPATHCRD) --ignore-not-found
406410

407411
.PHONY: redeploy-operator
408412
redeploy-operator: delete-operator manifests
413+
kubectl apply -f $(MANIFESTPATHCRD)
409414
kubectl apply -f $(MANIFESTPATHSTORAGE)
410415
kubectl apply -f $(MANIFESTPATHDEPLOYMENT)
411416
kubectl apply -f $(MANIFESTPATHDEPLOYMENTREPLICATION)

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ it is intended to be.
3939
## Installation of latest release using Helm
4040

4141
```bash
42+
# The following will install the custom resources required by the operators.
43+
helm install https://github.com/arangodb/kube-arangodb/releases/download/0.3.2/kube-arangodb-crd.tgz
4244
# The following will install the operator for `ArangoDeployment` &
4345
# `ArangoDeplomentReplication` resources.
4446
helm install https://github.com/arangodb/kube-arangodb/releases/download/0.3.1/kube-arangodb.tgz
@@ -49,6 +51,7 @@ helm install https://github.com/arangodb/kube-arangodb/releases/download/0.3.1/k
4951
## Installation of latest release using Kubectl
5052

5153
```bash
54+
kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/0.3.2/manifests/arango-crd.yaml
5255
kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/0.3.1/manifests/arango-deployment.yaml
5356
# To use `ArangoLocalStorage`, also run
5457
kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/0.3.1/manifests/arango-storage.yaml

docs/Manual/Deployment/Kubernetes/Usage.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ run (replace `<version>` with the version of the operator that you want to insta
1414

1515
```bash
1616
export URLPREFIX=https://github.com/arangodb/kube-arangodb/releases/download/<version>
17+
helm install $URLPREFIX/kube-arangodb-crd.tgz
1718
helm install $URLPREFIX/kube-arangodb.tgz
1819
```
1920

@@ -40,6 +41,7 @@ run (replace `<version>` with the version of the operator that you want to insta
4041

4142
```bash
4243
export URLPREFIX=https://raw.githubusercontent.com/arangodb/kube-arangodb/<version>/manifests
44+
kubectl apply -f $URLPREFIX/arango-crd.yaml
4345
kubectl apply -f $URLPREFIX/arango-deployment.yaml
4446
```
4547

manifests/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ arango-deployment-dev.yaml
22
arango-deployment-replication-dev.yaml
33
arango-storage-dev.yaml
44
arango-test-dev.yaml
5+
arango-crd-dev.yaml
File renamed without changes.

scripts/patch_readme.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ function replaceInFile {
2525

2626

2727
f=README.md
28+
replaceInFile "s@^kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/.*/manifests/arango-crd.yaml\$@kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/${VERSION}/manifests/arango-crd.yaml@g" ${f}
2829
replaceInFile "s@^kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/.*/manifests/arango-deployment.yaml\$@kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/${VERSION}/manifests/arango-deployment.yaml@g" ${f}
2930
replaceInFile "s@^kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/.*/manifests/arango-deployment-replication.yaml\$@kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/${VERSION}/manifests/arango-deployment-replication.yaml@g" ${f}
3031
replaceInFile "s@^kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/.*/manifests/arango-storage.yaml\$@kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/${VERSION}/manifests/arango-storage.yaml@g" ${f}
3132

33+
replaceInFile "s@^helm install https://github.com/arangodb/kube-arangodb/releases/download/.*/kube-arangodb-crd.tgz\$@helm install https://github.com/arangodb/kube-arangodb/releases/download/${VERSION}/kube-arangodb-crd.tgz@g" ${f}
3234
replaceInFile "s@^helm install https://github.com/arangodb/kube-arangodb/releases/download/.*/kube-arangodb.tgz\$@helm install https://github.com/arangodb/kube-arangodb/releases/download/${VERSION}/kube-arangodb.tgz@g" ${f}
3335
replaceInFile "s@^helm install https://github.com/arangodb/kube-arangodb/releases/download/.*/kube-arangodb-storage.tgz\$@helm install https://github.com/arangodb/kube-arangodb/releases/download/${VERSION}/kube-arangodb-storage.tgz@g" ${f}

tools/manifests/manifest_builder.go

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,16 @@ var (
5555
RBAC bool
5656
AllowChaos bool
5757
}
58+
crdTemplateNames = []Template{
59+
Template{Name: "deployment.yaml"},
60+
Template{Name: "deployment-replication.yaml"},
61+
}
5862
deploymentTemplateNames = []Template{
59-
Template{Name: "crd.yaml"},
6063
Template{Name: "rbac.yaml", Predicate: hasRBAC},
6164
Template{Name: "deployment.yaml"},
6265
Template{Name: "service.yaml"},
6366
}
6467
deploymentReplicationTemplateNames = []Template{
65-
Template{Name: "crd.yaml"},
6668
Template{Name: "rbac.yaml", Predicate: hasRBAC},
6769
Template{Name: "deployment-replication.yaml"},
6870
Template{Name: "service.yaml"},
@@ -119,6 +121,15 @@ description: |
119121
Kube-ArangoDB-Storage is a cluster-wide operator used to provision PersistentVolumes on disks attached locally to Nodes
120122
home: https://arangodb.com
121123
`
124+
kubeArangoDBCRDChartTemplate = `
125+
apiVersion: v1
126+
name: kube-arangodb-crd
127+
version: "{{ .Version }}"
128+
description: |
129+
Kube-ArangoDB-crd contains the custom resource definitions for ArangoDeployment and ArangoDeploymentReplication resources.
130+
home: https://arangodb.com
131+
`
132+
122133
kubeArangoDBValuesTemplate = `
123134
# Image containing the kube-arangodb operators
124135
Image: {{ .Image | quote }}
@@ -155,6 +166,8 @@ Storage:
155166
ServiceAccountName: {{ .Storage.Operator.ServiceAccountName | quote }}
156167
ServiceType: {{ .Storage.Operator.ServiceType | quote }}
157168
`
169+
kubeArangoDBCRDValuesTemplate = ``
170+
158171
kubeArangoDBNotesText = `
159172
kube-arangodb has been deployed successfully!
160173
@@ -180,11 +193,23 @@ You can now deploy an ArangoLocalStorage resource.
180193
181194
See https://docs.arangodb.com/devel/Manual/Deployment/Kubernetes/StorageResource.html
182195
for further instructions.
196+
`
197+
kubeArangoDBCRDNotesText = `
198+
kube-arangodb-crd has been deployed successfully!
199+
200+
Your release is named '{{ .Release.Name }}'.
201+
202+
You can now continue install kube-arangodb chart.
183203
`
184204
)
185205

186206
var (
187207
chartTemplateGroups = map[string]chartTemplates{
208+
"kube-arangodb-crd": chartTemplates{
209+
"Chart.yaml": kubeArangoDBCRDChartTemplate,
210+
"values.yaml": kubeArangoDBCRDValuesTemplate,
211+
"templates/NOTES.txt": kubeArangoDBCRDNotesText,
212+
},
188213
"kube-arangodb": chartTemplates{
189214
"Chart.yaml": kubeArangoDBChartTemplate,
190215
"values.yaml": kubeArangoDBValuesTemplate,
@@ -272,6 +297,7 @@ func main() {
272297

273298
// Prepare templates to include
274299
templateInfoSet := map[string]TemplateGroup{
300+
"crd": TemplateGroup{ChartName: "kube-arangodb-crd", Templates: crdTemplateNames},
275301
"deployment": TemplateGroup{ChartName: "kube-arangodb", Templates: deploymentTemplateNames},
276302
"deployment-replication": TemplateGroup{ChartName: "kube-arangodb", Templates: deploymentReplicationTemplateNames},
277303
"storage": TemplateGroup{ChartName: "kube-arangodb-storage", Templates: storageTemplateNames},

tools/release/release.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ var (
4848
binaries = map[string]string{
4949
"kube-arangodb.tgz": "charts/kube-arangodb.tgz",
5050
"kube-arangodb-storage.tgz": "charts/kube-arangodb-storage.tgz",
51+
"kube-arangodb-crd.tgz": "charts/kube-arangodb-crd.tgz",
5152
}
5253
)
5354

0 commit comments

Comments
 (0)