DEPLOY-276: ACS helm chart for community

This commit is contained in:
Sergiu-Alexandru Vidrascu
2017-12-15 18:15:54 +02:00
parent fbda727035
commit 5b4e8ef554
22 changed files with 386 additions and 3 deletions

View File

@@ -7,8 +7,8 @@ This project contains the code for packaging the entire Alfresco Content Service
* ```mvn clean install``` in the root of the project will build everything. * ```mvn clean install``` in the root of the project will build everything.
Note: It is not easy to build the full installer locally (and impossible on Windows) so, most likely you don't want to create the installer locally. Comment out the <module>installer</module> in the root pom.xml in order to avoid building the installer locally. Note: It is not easy to build the full installer locally (and impossible on Windows) so, most likely you don't want to create the installer locally. Comment out the <module>installer</module> in the root pom.xml in order to avoid building the installer locally.
## Docker-compose ## Docker-compose & Kubernetes
Build and start Alfresco Content Services Community using docker-compose, containing: Build and start Alfresco Content Services Community using docker-compose or Kubernetes, containing:
1. Alfresco Repository for community, with: 1. Alfresco Repository for community, with:
1.1. Alfresco Share Services amp 1.1. Alfresco Share Services amp
1.2. Alfresco AOS amp 1.2. Alfresco AOS amp
@@ -19,7 +19,7 @@ Build and start Alfresco Content Services Community using docker-compose, contai
3. A Postgres DB 3. A Postgres DB
4. Alfresco Solr6 4. Alfresco Solr6
### Instructions: ### Docker Compose Instructions:
#### Prerequisite: #### Prerequisite:
* Docker installed locally * Docker installed locally
* 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.
@@ -34,6 +34,22 @@ Build and start Alfresco Content Services Community using docker-compose, contai
* The images used in the docker-compose.yml are images that are build in the 'docker-alfresco' and 'docker-share' subfolders of the project - see the relevant sections below * The images used in the docker-compose.yml are images that are build 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 use proper tags when you create the images and update the docker-compose.yml with these proper 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 use proper tags when you create the images and update the docker-compose.yml with these proper tags that you created.
### Kubernetes Instructions:
#### Prerequisite:
* A minikube k8s cluster up and ready
* 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.
#### Steps
1. Go to **helm** folder
2. Run ```helm install alfresco-content-services```
3. After deploying the helm chart you will get information for obtaining the URL for alfresco, share and solr.
#### Notes:
* The images used in the docker-compose.yml are images that are build 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 use proper tags when you create the images and update the docker-compose.yml with these proper tags that you created.
## Docker images ## Docker images
These images are used to build the images used by the docker-compose.yml project to bring up an ACS Community, similar to what the installer did/does. These images are used to build the images used by the docker-compose.yml project to bring up an ACS Community, similar to what the installer did/does.
The images are based on *pure* _content services_ and _share_ images done by the _acs-packaging_ and _share_ projects and adds the amps and settings necessary for running the images in a similar fashion to what the ACS deployment with the installer did/does. The images are based on *pure* _content services_ and _share_ images done by the _acs-packaging_ and _share_ projects and adds the amps and settings necessary for running the images in a similar fashion to what the ACS deployment with the installer did/does.

View File

@@ -0,0 +1,21 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj

View File

@@ -0,0 +1,13 @@
name: alfresco-content-services
version: 0.0.1
description: A Helm chart for deploying Alfresco Content Services
keywords:
- content
- content services
- alfresco
- community
- alfresco community
home: https://www.alfresco.com
sources:
- https://github.com/Alfresco/acs-community-full-packaging/tree/master/helm
icon: https://avatars0.githubusercontent.com/u/391127?s=200&v=4

View File

@@ -0,0 +1,9 @@
dependencies:
- name: postgresql
repository: https://kubernetes-charts.storage.googleapis.com/
version: 0.8.5
- name: nginx-ingress
repository: https://kubernetes-charts.storage.googleapis.com
version: 0.8.18
digest: sha256:ee2a7ec0ed228940857082137c9fe72ff81fc4a2bdb3ca8315d258066750b714
generated: 2017-12-15T16:41:34.393214+02:00

View File

@@ -0,0 +1,8 @@
dependencies:
- name: postgresql
version: 0.8.5
repository: https://kubernetes-charts.storage.googleapis.com/
- name: nginx-ingress
version: ^0.8.11
repository: https://kubernetes-charts.storage.googleapis.com

View File

@@ -0,0 +1,8 @@
1. Get the 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"
2. To access Alfresco go to /alfresco path with the same base URL
4. To access Solr go to /solr path with the same base URL

View File

@@ -0,0 +1,8 @@
{{/*
Create a default fully qualified name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "content-services.fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

View File

@@ -0,0 +1,20 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "content-services.fullname" . }}-repository-configmap
labels:
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
data:
{{- if .Values.repository.environment }}
{{- range $key, $val := .Values.repository.environment }}
{{ $key }}: {{ $val | quote }}
{{- end }}
{{- end }}
CATALINA_OPTS: " -Ddb.driver=org.postgresql.Driver
-Ddb.username={{ .Values.postgresql.postgresUser }}
-Ddb.password={{ .Values.postgresql.postgresPassword }}
-Ddb.url=jdbc:postgresql://{{ .Release.Name }}-postgresql-acs:5432/{{ .Values.postgresql.postgresDatabase }}
-Dsolr.host={{ template "content-services.fullname" . }}-solr
-Dsolr.port={{ .Values.solr.service.externalPort }}"

View File

@@ -0,0 +1,11 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "content-services.fullname" . }}-share-configmap
labels:
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
data:
REPO_HOST: "{{ template "content-services.fullname" . }}-repository"
REPO_PORT: "{{ .Values.repository.service.externalPort }}"

View File

@@ -0,0 +1,18 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "content-services.fullname" . }}-solr-configmap
labels:
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
data:
SOLR_ALFRESCO_HOST: "{{ template "content-services.fullname" . }}-repository"
SOLR_ALFRESCO_PORT: "{{ .Values.repository.service.externalPort }}"
SOLR_SOLR_HOST: "{{ template "content-services.fullname" . }}-solr"
SOLR_SOLR_PORT: "{{ .Values.solr.image.internalPort }}"
{{- if .Values.solr.environment }}
{{- range $key, $val := .Values.solr.environment }}
{{ $key }}: {{ $val | quote }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,32 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{ template "content-services.fullname" . }}-repository
labels:
app: {{ template "content-services.fullname" . }}-repository
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.repository.replicaCount }}
template:
metadata:
labels:
app: {{ template "content-services.fullname" . }}-repository
release: {{ .Release.Name }}
spec:
imagePullSecrets:
- name: {{ .Values.registryPullSecrets }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.repository.image.repository }}:{{ .Values.repository.image.tag }}"
imagePullPolicy: {{ .Values.repository.image.pullPolicy }}
envFrom:
- configMapRef:
name: {{ template "content-services.fullname" . }}-repository-configmap
ports:
- containerPort: {{ .Values.repository.image.internalPort }}
initContainers:
- name: init-postgres
image: busybox
command: ['sh', '-c', 'until nslookup {{ .Release.Name }}-postgresql-acs; do echo "waiting for postgres"; sleep 2; done;']

View File

@@ -0,0 +1,28 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{ template "content-services.fullname" . }}-share
labels:
app: {{ template "content-services.fullname" . }}-share
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.share.replicaCount }}
template:
metadata:
labels:
app: {{ template "content-services.fullname" . }}-share
release: {{ .Release.Name }}
spec:
imagePullSecrets:
- name: {{ .Values.registryPullSecrets }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.share.image.repository }}:{{ .Values.share.image.tag }}"
imagePullPolicy: {{ .Values.share.image.pullPolicy }}
ports:
- containerPort: {{ .Values.share.image.internalPort }}
envFrom:
- configMapRef:
name: {{ template "content-services.fullname" . }}-share-configmap

View File

@@ -0,0 +1,28 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{ template "content-services.fullname" . }}-solr
labels:
app: {{ template "content-services.fullname" . }}-solr
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.solr.replicaCount }}
template:
metadata:
labels:
app: {{ template "content-services.fullname" . }}-solr
release: {{ .Release.Name }}
spec:
imagePullSecrets:
- name: {{ .Values.registryPullSecrets }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.solr.image.repository }}:{{ .Values.solr.image.tag }}"
imagePullPolicy: {{ .Values.solr.image.pullPolicy }}
envFrom:
- configMapRef:
name: {{ template "content-services.fullname" . }}-solr-configmap
ports:
- containerPort: {{ .Values.solr.image.internalPort }}

View File

@@ -0,0 +1,15 @@
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "content-services.fullname" . }}-repository
annotations:
kubernetes.io/ingress.class: "nginx"
ingress.kubernetes.io/ssl-redirect: "false"
spec:
rules:
- http:
paths:
- path: {{ .Values.repository.ingress.path }}
backend:
serviceName: {{ template "content-services.fullname" . }}-repository
servicePort: {{ .Values.repository.service.externalPort }}

View File

@@ -0,0 +1,15 @@
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "content-services.fullname" . }}-share
annotations:
kubernetes.io/ingress.class: "nginx"
ingress.kubernetes.io/ssl-redirect: "false"
spec:
rules:
- http:
paths:
- path: {{ .Values.share.ingress.path }}
backend:
serviceName: {{ template "content-services.fullname" . }}-share
servicePort: {{ .Values.share.service.externalPort }}

View File

@@ -0,0 +1,15 @@
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "content-services.fullname" . }}-solr
annotations:
kubernetes.io/ingress.class: "nginx"
ingress.kubernetes.io/ssl-redirect: "false"
spec:
rules:
- http:
paths:
- path: {{ .Values.solr.ingress.path }}
backend:
serviceName: {{ template "content-services.fullname" . }}-solr
servicePort: {{ .Values.solr.service.externalPort }}

View File

@@ -0,0 +1,18 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "content-services.fullname" . }}-repository
labels:
app: {{ template "content-services.fullname" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
type: {{ .Values.repository.service.type }}
ports:
- port: {{ .Values.repository.service.externalPort }}
targetPort: {{ .Values.repository.image.internalPort }}
name: {{ .Values.repository.service.name }}
selector:
app: {{ template "content-services.fullname" . }}-repository
release: {{ .Release.Name }}

View File

@@ -0,0 +1,18 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "content-services.fullname" . }}-share
labels:
app: {{ template "content-services.fullname" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
type: {{ .Values.share.service.type }}
ports:
- port: {{ .Values.share.service.externalPort }}
targetPort: {{ .Values.share.image.internalPort }}
name: {{ .Values.share.service.name }}
selector:
app: {{ template "content-services.fullname" . }}-share
release: {{ .Release.Name }}

View File

@@ -0,0 +1,18 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "content-services.fullname" . }}-solr
labels:
app: {{ template "content-services.fullname" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
type: {{ .Values.solr.service.type }}
ports:
- port: {{ .Values.solr.service.externalPort }}
targetPort: {{ .Values.solr.image.internalPort }}
name: {{ .Values.solr.service.name }}
selector:
app: {{ template "content-services.fullname" . }}-solr
release: {{ .Release.Name }}

View File

@@ -0,0 +1,64 @@
# Default values for alfresco-acs.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
registryPullSecrets: quay-registry-secret
repository:
replicaCount: 1
image:
repository: quay.io/alfresco/alfresco-full-content-services-community
tag: "latest"
pullPolicy: Always
internalPort: 8080
service:
name: alfresco
type: NodePort
externalPort: 80
ingress:
path: /alfresco
environment:
JAVA_OPTS: " -Dsolr.base.url=/solr
-Dsolr.secureComms=none
-Dindex.subsystem.name=solr6"
share:
replicaCount: 1
image:
repository: quay.io/alfresco/alfresco-full-share
tag: "5.2.X"
pullPolicy: Always
internalPort: 8080
service:
name: share
type: NodePort
externalPort: 80
ingress:
path: /share
solr:
replicaCount: 1
image:
repository: quay.io/alfresco/search-services
tag: "1.2.0-SNAPSHOT"
pullPolicy: IfNotPresent
internalPort: 8983
service:
name: solr
type: NodePort
externalPort: 80
ingress:
path: /solr
environment:
SOLR_CREATE_ALFRESCO_DEFAULTS: alfresco,archive
postgresql:
nameOverride: postgresql-acs
imageTag: "9.4.12"
postgresUser: alfresco
postgresPassword: alfresco
postgresDatabase: alfresco
persistence:
enabled: false