DEPLOY-377:

- removed pvc
- updated readme and helm notes to specify infrastructure dependency
- set default claim for postgres
This commit is contained in:
Sergiu-Alexandru Vidrascu
2018-03-01 12:33:41 +02:00
parent 5c9115d457
commit 04c81bae7a
4 changed files with 28 additions and 70 deletions

View File

@@ -36,20 +36,34 @@ Build and start Alfresco Content Services Community using docker-compose or Kube
### Kubernetes Instructions:
#### 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.
* 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
1. Go to **helm** folder
2. Run ```helm dependency update alfresco-content-services && helm install alfresco-content-services```
1. Run ```helm repo add alfresco-incubator http://kubernetes-charts.alfresco.com/incubator``` to add the Alfresco Kubernetes repository to helm.
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.
#### 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.
* 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.
## Docker images

View File

@@ -1,28 +1,16 @@
1. Get the share application URL by running these commands:
IP=$(minikube ip)
PORT=$(kubectl get services {{ .Release.Name }}-nginx-ingress-controller -o jsonpath={.spec.ports[0].nodePort})
echo "http://$IP:$PORT/share"
{{ if .Values.dnsaddress }}
2. To access Repository go to /alfresco path with the same base URL
3. To access Solr go to /solr 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:
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})
echo "http://$DNSNAME/share"
{{ else }}
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:
6. Persistent Storage
helm upgrade --reuse-values {{ .Release.Name }} --set dnsaddress="Your DNS address ex: http://myenv.com" alfresco-incubator/alfresco-content-services
Depending on the storage you use for volumes you should be able to access the persisted db data in the following locations:
- On minikube the usual location is /tmp/hostpath-provisioning
- With docker-for-desktop the usual location is /Users/YourUser/.docker/Volumes/
If you choose to use EFS for persistence keep in mind that the persistent volume created has the ReclaimPolicy set to Recycle.
This means that by default, when you delete the release the saved data is deleted automatically.
To change this behaviour and keep the data you can set the persistence.reclaimPolicy value to Retain.
For more Information on Reclaim Policies checkout the official K8S documentation here -> https://kubernetes.io/docs/concepts/storage/persistent-volumes/#reclaim-policy
{{ end }}

View File

@@ -1,34 +0,0 @@
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
{{- if and .Values.persistence.efs.enabled -}}
apiVersion: v1
kind: PersistentVolume
metadata:
name: content-services-pv
spec:
capacity:
storage: {{ .Values.persistence.baseSize | quote }}
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: {{ .Values.persistence.reclaimPolicy | default "Recycle" }}
nfs:
server: "{{ .Values.persistence.efs.dns }}"
path: "{{ .Values.persistence.efs.path }}"
storageClassName: efs
---
{{- end -}}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: content-services-pvc
spec:
accessModes:
{{ if .Values.persistence.efs.enabled }}
- ReadWriteMany
storageClassName: efs
{{ else }}
- ReadWriteOnce
{{ end }}
resources:
requests:
storage: {{ .Values.database.persistence.size | quote }}
{{- end }}

View File

@@ -67,18 +67,8 @@ solr:
limits:
memory: "500Mi"
persistence:
enabled: true
baseSize: 10Gi
efs:
enabled: false
dns: fs-example.efs.us-east-1.amazonaws.com
path: "/"
database:
type: postgresql
persistence:
size: 2Gi
postgresql:
## If true, install the postgresql chart alongside Alfresco Content Services
@@ -89,7 +79,7 @@ postgresql:
postgresPassword: alfresco
postgresDatabase: alfresco
persistence:
existingClaim: "content-services-pvc"
existingClaim: "alfresco-volume-claim"
subPath: "alfresco-content-services/database-data"
resources:
requests: