Merge pull request #4 from Alfresco/DEPLOY-377

DEPLOY-377: Add persistent volume claim for persisting database data
This commit is contained in:
Sergiu Vidrascu
2018-03-07 06:36:38 +02:00
committed by GitHub
3 changed files with 34 additions and 18 deletions

View File

@@ -36,20 +36,34 @@ Build and start Alfresco Content Services Community using docker-compose or Kube
### Kubernetes Instructions: ### Kubernetes Instructions:
#### Prerequisite: #### Prerequisite:
* A minikube/aws k8s cluster up and ready (minimum 5GB memory) * Deploy the infrastructure chart as specified in https://github.com/Alfresco/alfresco-infrastructure-deployment
* Access to docker-internal.alfresco.com and quay.io repositories - Platform Services team is working on getting the images in [Docker Hub](https://hub.docker.com/u/alfresco/) registry. * Access to docker-internal.alfresco.com and quay.io repositories - Platform Services team is working on getting the images in [Docker Hub](https://hub.docker.com/u/alfresco/) registry.
* A kubernetes secret (quay-registry-secret) with the above mentioned credentials created in your cluster. * A kubernetes secret (quay-registry-secret) with the above mentioned credentials created in your cluster.
**Note!** You do not need to pull this repo in order to deploy Alfresco Content Services in Kubernetes
#### Steps #### Steps
1. Go to **helm** folder 1. Run ```helm repo add alfresco-incubator http://kubernetes-charts.alfresco.com/incubator``` to add the Alfresco Kubernetes repository to helm.
2. Run ```helm dependency update alfresco-content-services && helm install alfresco-content-services``` 2. Deploy Alfresco Content Services:
```bash
#On MINIKUBE
helm install alfresco-incubator/alfresco-content-services \
--set dnsaddress="http://$ELBADDRESS:$INFRAPORT" \
--namespace=$DESIREDNAMESPACE
#On AWS
helm install alfresco-incubator/alfresco-content-services \
--set dnsaddress="http://$ELBADDRESS" \
--namespace=$DESIREDNAMESPACE
```
3. After deploying the helm chart you will get information for obtaining the URL for repository, share and solr. 3. After deploying the helm chart you will get information for obtaining the URL for repository, share and solr.
#### Notes: #### Notes:
* The images used in the alfresco-content-services/values.yml are images that are built in the 'docker-alfresco' and 'docker-share' subfolders of the project - see the relevant sections below. * The images used in the alfresco-content-services/values.yml are images that are built in the 'docker-alfresco' and 'docker-share' subfolders of the project - see the relevant sections below.
* If you don't have access to the docker-internal.alfresco.com and quay.io images, or if you want custom data in your docker images, you can use the 'docker-alfresco' and 'docker-share' folders to customize and build your customized docker images that are used in the docker-compose project. Just make sure you build them in the minikube docker environment and update the alfresco-content-services/values.yml with the tags that you created. * If you don't have access to the docker-internal.alfresco.com and quay.io images, or if you want custom data in your docker images, you can use the 'docker-alfresco' and 'docker-share' folders to customize and build your customized docker images that are used in the docker-compose project. Just make sure you build them in the minikube docker environment and update the alfresco-content-services/values.yml with the tags that you created.
* You can also change those values when deploying the helm chart by running ```helm install alfresco-content-services --set repository.image.tag="yourTag" --set share.image.tag="yourTag"```. * You can also change those values when deploying the helm chart by running ```helm install alfresco-incubator/alfresco-content-services --set repository.image.tag="yourTag" --set share.image.tag="yourTag"```.
* Hint: Run ```eval $(minikube docker-env)``` to switch to your minikube docker environment on osx. * Hint: Run ```eval $(minikube docker-env)``` to switch to your minikube docker environment on osx.
## Docker images ## Docker images

View File

@@ -1,15 +1,16 @@
1. Get the share application URL by running these commands:
IP=$(minikube ip) {{ if .Values.dnsaddress }}
PORT=$(kubectl get services {{ .Release.Name }}-nginx-ingress-controller -o jsonpath={.spec.ports[0].nodePort})
echo "http://$IP:$PORT/share"
2. To access Repository go to /alfresco path with the same base URL You can access all components of Alfresco Content Services using the same root address, but different paths as follows:
3. To access Solr go to /solr path with the same base URL
4. If you deployed on an AWS cluster you can get the route53 entry for the cluster as follows: Content: {{ .Values.dnsaddress }}/alfresco
Share: {{ .Values.dnsaddress }}/share
Solr: {{ .Values.dnsaddress }}/solr
DNSNAME=$(kubectl get services {{ .Release.Name }}-nginx-ingress-controller -o jsonpath={.status.loadBalancer.ingress[0].hostname}) {{ else }}
echo "http://$DNSNAME/share"
5. Note: if you deployed on a different namespace than the default one, then the kubectl commands should also specify the namespace to run in with --namespace If you have a specific DNS address for the cluster please run the following commands to get the application paths:
helm upgrade --reuse-values {{ .Release.Name }} --set dnsaddress="Your DNS address ex: http://myenv.com" alfresco-incubator/alfresco-content-services
{{ end }}

View File

@@ -67,6 +67,9 @@ solr:
limits: limits:
memory: "500Mi" memory: "500Mi"
database:
type: postgresql
postgresql: postgresql:
## If true, install the postgresql chart alongside Alfresco Content Services ## If true, install the postgresql chart alongside Alfresco Content Services
enabled: true enabled: true
@@ -76,7 +79,8 @@ postgresql:
postgresPassword: alfresco postgresPassword: alfresco
postgresDatabase: alfresco postgresDatabase: alfresco
persistence: persistence:
enabled: false existingClaim: "alfresco-volume-claim"
subPath: "alfresco-content-services/database-data"
resources: resources:
requests: requests:
memory: "250Mi" memory: "250Mi"
@@ -84,7 +88,4 @@ postgresql:
memory: "500Mi" memory: "500Mi"
driver: org.postgresql.Driver driver: org.postgresql.Driver
database:
type: postgresql
replicaCount: 1 replicaCount: 1