diff --git a/Makefile b/Makefile index d327403f5..fc29fc759 100644 --- a/Makefile +++ b/Makefile @@ -52,6 +52,7 @@ ifndef MANIFESTSUFFIX MANIFESTSUFFIX := -dev endif endif +MANIFESTPATHCRD := manifests/arango-crd$(MANIFESTSUFFIX).yaml MANIFESTPATHDEPLOYMENT := manifests/arango-deployment$(MANIFESTSUFFIX).yaml MANIFESTPATHDEPLOYMENTREPLICATION := manifests/arango-deployment-replication$(MANIFESTSUFFIX).yaml MANIFESTPATHSTORAGE := manifests/arango-storage$(MANIFESTSUFFIX).yaml @@ -236,6 +237,7 @@ endif .PHONY: manifests manifests: $(GOBUILDDIR) + echo Building manifests GOPATH=$(GOBUILDDIR) go run $(ROOTDIR)/tools/manifests/manifest_builder.go \ --output-suffix=$(MANIFESTSUFFIX) \ --image=$(OPERATORIMAGE) \ @@ -299,6 +301,7 @@ ifneq ($(DEPLOYMENTNAMESPACE), default) $(ROOTDIR)/scripts/kube_delete_namespace.sh $(DEPLOYMENTNAMESPACE) kubectl create namespace $(DEPLOYMENTNAMESPACE) endif + kubectl apply -f $(MANIFESTPATHCRD) kubectl apply -f $(MANIFESTPATHSTORAGE) kubectl apply -f $(MANIFESTPATHDEPLOYMENT) kubectl apply -f $(MANIFESTPATHDEPLOYMENTREPLICATION) @@ -403,9 +406,11 @@ delete-operator: kubectl delete -f $(MANIFESTPATHDEPLOYMENT) --ignore-not-found kubectl delete -f $(MANIFESTPATHDEPLOYMENTREPLICATION) --ignore-not-found kubectl delete -f $(MANIFESTPATHSTORAGE) --ignore-not-found + kubectl delete -f $(MANIFESTPATHCRD) --ignore-not-found .PHONY: redeploy-operator redeploy-operator: delete-operator manifests + kubectl apply -f $(MANIFESTPATHCRD) kubectl apply -f $(MANIFESTPATHSTORAGE) kubectl apply -f $(MANIFESTPATHDEPLOYMENT) kubectl apply -f $(MANIFESTPATHDEPLOYMENTREPLICATION) diff --git a/README.md b/README.md index c09c48cdd..e867589af 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,8 @@ it is intended to be. ## Installation of latest release using Helm ```bash +# The following will install the custom resources required by the operators. +helm install https://github.com/arangodb/kube-arangodb/releases/download/0.3.2/kube-arangodb-crd.tgz # The following will install the operator for `ArangoDeployment` & # `ArangoDeplomentReplication` resources. 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 ## Installation of latest release using Kubectl ```bash +kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/0.3.2/manifests/arango-crd.yaml kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/0.3.1/manifests/arango-deployment.yaml # To use `ArangoLocalStorage`, also run kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/0.3.1/manifests/arango-storage.yaml diff --git a/docs/Manual/Deployment/Kubernetes/Usage.md b/docs/Manual/Deployment/Kubernetes/Usage.md index dac960c3b..12b2d2944 100644 --- a/docs/Manual/Deployment/Kubernetes/Usage.md +++ b/docs/Manual/Deployment/Kubernetes/Usage.md @@ -14,6 +14,7 @@ run (replace `` with the version of the operator that you want to insta ```bash export URLPREFIX=https://github.com/arangodb/kube-arangodb/releases/download/ +helm install $URLPREFIX/kube-arangodb-crd.tgz helm install $URLPREFIX/kube-arangodb.tgz ``` @@ -40,6 +41,7 @@ run (replace `` with the version of the operator that you want to insta ```bash export URLPREFIX=https://raw.githubusercontent.com/arangodb/kube-arangodb//manifests +kubectl apply -f $URLPREFIX/arango-crd.yaml kubectl apply -f $URLPREFIX/arango-deployment.yaml ``` diff --git a/manifests/.gitignore b/manifests/.gitignore index 0c8b9cdf1..7f3592412 100644 --- a/manifests/.gitignore +++ b/manifests/.gitignore @@ -2,3 +2,4 @@ arango-deployment-dev.yaml arango-deployment-replication-dev.yaml arango-storage-dev.yaml arango-test-dev.yaml +arango-crd-dev.yaml diff --git a/manifests/templates/deployment-replication/crd.yaml b/manifests/templates/crd/deployment-replication.yaml similarity index 100% rename from manifests/templates/deployment-replication/crd.yaml rename to manifests/templates/crd/deployment-replication.yaml diff --git a/manifests/templates/deployment/crd.yaml b/manifests/templates/crd/deployment.yaml similarity index 100% rename from manifests/templates/deployment/crd.yaml rename to manifests/templates/crd/deployment.yaml diff --git a/scripts/patch_readme.sh b/scripts/patch_readme.sh index 97a802323..73aaa4228 100755 --- a/scripts/patch_readme.sh +++ b/scripts/patch_readme.sh @@ -25,9 +25,11 @@ function replaceInFile { f=README.md +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} 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} 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} 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} +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} 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} 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} diff --git a/tools/manifests/manifest_builder.go b/tools/manifests/manifest_builder.go index b170bb994..5a6df54b2 100644 --- a/tools/manifests/manifest_builder.go +++ b/tools/manifests/manifest_builder.go @@ -55,14 +55,16 @@ var ( RBAC bool AllowChaos bool } + crdTemplateNames = []Template{ + Template{Name: "deployment.yaml"}, + Template{Name: "deployment-replication.yaml"}, + } deploymentTemplateNames = []Template{ - Template{Name: "crd.yaml"}, Template{Name: "rbac.yaml", Predicate: hasRBAC}, Template{Name: "deployment.yaml"}, Template{Name: "service.yaml"}, } deploymentReplicationTemplateNames = []Template{ - Template{Name: "crd.yaml"}, Template{Name: "rbac.yaml", Predicate: hasRBAC}, Template{Name: "deployment-replication.yaml"}, Template{Name: "service.yaml"}, @@ -119,6 +121,15 @@ description: | Kube-ArangoDB-Storage is a cluster-wide operator used to provision PersistentVolumes on disks attached locally to Nodes home: https://arangodb.com ` + kubeArangoDBCRDChartTemplate = ` +apiVersion: v1 +name: kube-arangodb-crd +version: "{{ .Version }}" +description: | + Kube-ArangoDB-crd contains the custom resource definitions for ArangoDeployment and ArangoDeploymentReplication resources. +home: https://arangodb.com +` + kubeArangoDBValuesTemplate = ` # Image containing the kube-arangodb operators Image: {{ .Image | quote }} @@ -155,6 +166,8 @@ Storage: ServiceAccountName: {{ .Storage.Operator.ServiceAccountName | quote }} ServiceType: {{ .Storage.Operator.ServiceType | quote }} ` + kubeArangoDBCRDValuesTemplate = `` + kubeArangoDBNotesText = ` kube-arangodb has been deployed successfully! @@ -180,11 +193,23 @@ You can now deploy an ArangoLocalStorage resource. See https://docs.arangodb.com/devel/Manual/Deployment/Kubernetes/StorageResource.html for further instructions. +` + kubeArangoDBCRDNotesText = ` +kube-arangodb-crd has been deployed successfully! + +Your release is named '{{ .Release.Name }}'. + +You can now continue install kube-arangodb chart. ` ) var ( chartTemplateGroups = map[string]chartTemplates{ + "kube-arangodb-crd": chartTemplates{ + "Chart.yaml": kubeArangoDBCRDChartTemplate, + "values.yaml": kubeArangoDBCRDValuesTemplate, + "templates/NOTES.txt": kubeArangoDBCRDNotesText, + }, "kube-arangodb": chartTemplates{ "Chart.yaml": kubeArangoDBChartTemplate, "values.yaml": kubeArangoDBValuesTemplate, @@ -272,6 +297,7 @@ func main() { // Prepare templates to include templateInfoSet := map[string]TemplateGroup{ + "crd": TemplateGroup{ChartName: "kube-arangodb-crd", Templates: crdTemplateNames}, "deployment": TemplateGroup{ChartName: "kube-arangodb", Templates: deploymentTemplateNames}, "deployment-replication": TemplateGroup{ChartName: "kube-arangodb", Templates: deploymentReplicationTemplateNames}, "storage": TemplateGroup{ChartName: "kube-arangodb-storage", Templates: storageTemplateNames}, diff --git a/tools/release/release.go b/tools/release/release.go index 84e008c2d..c4f47e689 100644 --- a/tools/release/release.go +++ b/tools/release/release.go @@ -48,6 +48,7 @@ var ( binaries = map[string]string{ "kube-arangodb.tgz": "charts/kube-arangodb.tgz", "kube-arangodb-storage.tgz": "charts/kube-arangodb-storage.tgz", + "kube-arangodb-crd.tgz": "charts/kube-arangodb-crd.tgz", } )