This repository has been archived by the owner on Feb 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16.8k
[stable/suitecrm] adds chart to deploy SuiteCRM #1258
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
fd2732b
[stable/suitecrm] adds chart to deploy SuiteCRM
94fd8a7
suitecrm: bump image version
1f650ea
suitecrm: bump chart series
095a022
suitecrm: add standard labels to pod metadata
b94449e
suitecrm: use `name` template for app labels
e790d05
suitecrm: fix `app` label in NOTES.txt
7009182
suitecrm: removed `chart` and `heritage` labels from the Pod spec
ff3e599
suitecrm: drop use of `default ""` in templates
db8367a
suitecrm: add Release.Name to service selectors
16e0360
suitecrm: fix pod selector in NOTES.txt
c8f58d9
suitecrm: disabled default resource limits
45a71de
parse: fix empty resources
unguiculus dd2a829
parse: fix requirements.lock
unguiculus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: suitecrm | ||
version: 0.2.0 | ||
description: SuiteCRM is a completely open source enterprise-grade Customer Relationship Management (CRM) application. SuiteCRM is a software fork of the popular customer relationship management (CRM) system SugarCRM. | ||
keywords: | ||
- suitecrm | ||
- CRM | ||
home: http://www.suitecrm.com | ||
sources: | ||
- https://github.com/bitnami/bitnami-docker-suitecrm | ||
maintainers: | ||
- name: Bitnami | ||
email: containers@bitnami.com | ||
engine: gotpl | ||
icon: https://bitnami.com/assets/stacks/osclass/img/osclass-stack-110x117.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
# SuiteCRM | ||
|
||
[SuiteCRM](https://www.suitecrm.com) SuiteCRM is a completely open source enterprise-grade Customer Relationship Management (CRM) application. SuiteCRM is a software fork of the popular customer relationship management (CRM) system SugarCRM. | ||
|
||
## TL;DR; | ||
|
||
```console | ||
$ helm install stable/suitecrm | ||
``` | ||
|
||
## Introduction | ||
|
||
This chart bootstraps a [SuiteCRM](https://github.com/bitnami/bitnami-docker-suitecrm) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. | ||
|
||
It also packages the [Bitnami MariaDB chart](https://github.com/kubernetes/charts/tree/master/stable/mariadb) which is required for bootstrapping a MariaDB deployment for the database requirements of the SuiteCRM application. | ||
|
||
## Prerequisites | ||
|
||
- Kubernetes 1.5+ with Beta APIs enabled | ||
- PV provisioner support in the underlying infrastructure | ||
|
||
## Installing the Chart | ||
|
||
To install the chart with the release name `my-release`: | ||
|
||
```console | ||
$ helm install --name my-release stable/suitecrm | ||
``` | ||
|
||
The command deploys SuiteCRM on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation. | ||
|
||
> **Tip**: List all releases using `helm list` | ||
|
||
## Uninstalling the Chart | ||
|
||
To uninstall/delete the `my-release` deployment: | ||
|
||
```console | ||
$ helm delete my-release | ||
``` | ||
|
||
The command removes all the Kubernetes components associated with the chart and deletes the release. | ||
|
||
## Configuration | ||
|
||
The following tables lists the configurable parameters of the SuiteCRM chart and their default values. | ||
|
||
| Parameter | Description | Default | | ||
|-------------------------------------|-------------------------------------------|---------------------------------------------| | ||
| `imageTag` | `bitnami/suitecrm` image tag. | SuiteCRM image version | | ||
| `imagePullPolicy` | Image pull policy. | `IfNotPresent` | | ||
| `suitecrmHost` | SuiteCRM host to create application URLs | `nil` | | ||
| `suitecrmLoadBalancerIP` | `loadBalancerIP` for the SuiteCRM Service | `nil` | | ||
| `suitecrmUsername` | User of the application | `user` | | ||
| `suitecrmPassword` | Application password | _random 10 character alphanumeric string_ | | ||
| `suitecrmEmail` | Admin email | `user@example.com` | | ||
| `suitecrmLastName` | Last name | `Last` | | ||
| `suitecrmSmtpHost` | SMTP host | `nil` | | ||
| `suitecrmSmtpPort` | SMTP port | `nil` | | ||
| `suitecrmSmtpUser` | SMTP user | `nil` | | ||
| `suitecrmSmtpPassword` | SMTP password | `nil` | | ||
| `suitecrmSmtpProtocol` | SMTP protocol [`ssl`, `tls`] | `nil` | | ||
| `mariadb.mariadbRootPassword` | MariaDB admin password | `nil` | | ||
| `serviceType` | Kubernetes Service type | `LoadBalancer` | | ||
| `persistence.enabled` | Enable persistence using PVC | `true` | | ||
| `persistence.apache.storageClass` | PVC Storage Class for apache volume | `nil` (uses alpha storage class annotation) | | ||
| `persistence.apache.accessMode` | PVC Access Mode for apache volume | `ReadWriteOnce` | | ||
| `persistence.apache.size` | PVC Storage Request for apache volume | `1Gi` | | ||
| `persistence.suitecrm.storageClass` | PVC Storage Class for SuiteCRM volume | `nil` (uses alpha storage class annotation) | | ||
| `persistence.suitecrm.accessMode` | PVC Access Mode for SuiteCRM volume | `ReadWriteOnce` | | ||
| `persistence.suitecrm.size` | PVC Storage Request for SuiteCRM volume | `8Gi` | | ||
| `resources` | CPU/Memory resource requests/limits | Memory: `512Mi`, CPU: `300m` | | ||
|
||
The above parameters map to the env variables defined in [bitnami/suitecrm](http://github.com/bitnami/bitnami-docker-suitecrm). For more information please refer to the [bitnami/suitecrm](http://github.com/bitnami/bitnami-docker-suitecrm) image documentation. | ||
|
||
> **Note**: | ||
> | ||
> For SuiteCRM to function correctly, you should specify the `suitecrmHost` parameter to specify the FQDN (recommended) or the public IP address of the SuiteCRM service. | ||
> | ||
> Optionally, you can specify the `suitecrmLoadBalancerIP` parameter to assign a reserved IP address to the SuiteCRM service of the chart. However please note that this feature is only available on a few cloud providers (f.e. GKE). | ||
> | ||
> To reserve a public IP address on GKE: | ||
> | ||
> ```bash | ||
> $ gcloud compute addresses create suitecrm-public-ip | ||
> ``` | ||
> | ||
> The reserved IP address can be associated to the SuiteCRM service by specifying it as the value of the `suitecrmLoadBalancerIP` parameter while installing the chart. | ||
|
||
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, | ||
|
||
```console | ||
$ helm install --name my-release \ | ||
--set suitecrmUsername=admin,suitecrmPassword=password,mariadb.mariadbRootPassword=secretpassword \ | ||
stable/suitecrm | ||
``` | ||
|
||
The above command sets the SuiteCRM administrator account username and password to `admin` and `password` respectively. Additionally it sets the MariaDB `root` user password to `secretpassword`. | ||
|
||
Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example, | ||
|
||
```console | ||
$ helm install --name my-release -f values.yaml stable/suitecrm | ||
``` | ||
|
||
> **Tip**: You can use the default [values.yaml](values.yaml) | ||
|
||
## Persistence | ||
|
||
The [Bitnami SuiteCRM](https://github.com/bitnami/bitnami-docker-suitecrm) image stores the SuiteCRM data and configurations at the `/bitnami/suitecrm` and `/bitnami/apache` paths of the container. | ||
|
||
Persistent Volume Claims are used to keep the data across deployments. This is known to work in GCE, AWS, and minikube. | ||
See the [Configuration](#configuration) section to configure the PVC or to disable persistence. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
dependencies: | ||
- name: mariadb | ||
repository: https://kubernetes-charts.storage.googleapis.com/ | ||
version: 0.6.3 | ||
digest: sha256:edc6a5f543237e1b90de3e44a5f8cc2038025863e6ba599f41ce52292df51903 | ||
generated: 2017-07-31T16:23:58.262325603+02:00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
dependencies: | ||
- name: mariadb | ||
version: 0.6.3 | ||
repository: https://kubernetes-charts.storage.googleapis.com/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{{- if empty (include "host" .) -}} | ||
############################################################################### | ||
### ERROR: You did not provide an external host in your 'helm install' call ### | ||
############################################################################### | ||
|
||
This deployment will be incomplete until you configure SuiteCRM with a resolvable | ||
host. To configure SuiteCRM with the URL of your service: | ||
|
||
1. Get the SuiteCRM URL by running: | ||
|
||
{{- if contains "NodePort" .Values.serviceType }} | ||
|
||
export APP_PORT=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath="{.spec.ports[0].nodePort}") | ||
export APP_HOST=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") | ||
|
||
{{- else if contains "LoadBalancer" .Values.serviceType }} | ||
|
||
NOTE: It may take a few minutes for the LoadBalancer IP to be available. | ||
Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "fullname" . }}' | ||
|
||
export APP_HOST=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") | ||
export APP_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath="{.data.suitecrm-password}" | base64 --decode) | ||
{{- if .Values.mariadb.mariadbRootPassword }} | ||
export APP_DATABASE_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "mariadb.fullname" . }} -o jsonpath="{.data.mariadb-root-password}" | base64 --decode) | ||
{{- end }} | ||
{{- end }} | ||
|
||
2. Complete your SuiteCRM deployment by running: | ||
|
||
helm upgrade {{ .Release.Name }} \ | ||
--set suitecrmHost=$APP_HOST,suitecrmPassword=$APP_PASSWORD{{ if .Values.mariadb.mariadbRootPassword }},mariadb.mariadbRootPassword=$APP_DATABASE_PASSWORD{{ end }} stable/suitecrm | ||
|
||
{{- else -}} | ||
1. Get the SuiteCRM URL by running: | ||
|
||
{{- if eq .Values.serviceType "ClusterIP" }} | ||
|
||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") | ||
echo http://127.0.0.1:8080/ | ||
kubectl port-forward $POD_NAME 8080:80 | ||
{{- else }} | ||
|
||
echo URL : http://{{ include "host" . }}/ | ||
{{- end }} | ||
|
||
2. Get your SuiteCRM login credentials by running: | ||
|
||
echo Username : {{ .Values.suitecrmUsername }} | ||
echo Password : $(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath="{.data.suitecrm-password}" | base64 --decode) | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
*/}} | ||
{{- define "fullname" -}} | ||
{{- $name := default .Chart.Name .Values.nameOverride -}} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
*/}} | ||
{{- define "mariadb.fullname" -}} | ||
{{- printf "%s-%s" .Release.Name "mariadb" | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Get the user defined LoadBalancerIP for this release. | ||
Note, returns 127.0.0.1 if using ClusterIP. | ||
*/}} | ||
{{- define "serviceIP" -}} | ||
{{- if eq .Values.serviceType "ClusterIP" -}} | ||
127.0.0.1 | ||
{{- else -}} | ||
{{- index .Values (printf "%sLoadBalancerIP" .Chart.Name) | default "" -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Gets the host to be used for this application. | ||
If not using ClusterIP, or if a host or LoadBalancerIP is not defined, the value will be empty. | ||
*/}} | ||
{{- define "host" -}} | ||
{{- $host := index .Values (printf "%sHost" .Chart.Name) | default "" -}} | ||
{{- default (include "serviceIP" .) $host -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{{- if .Values.persistence.enabled -}} | ||
kind: PersistentVolumeClaim | ||
apiVersion: v1 | ||
metadata: | ||
name: {{ template "fullname" . }}-apache | ||
labels: | ||
app: {{ template "name" . }} | ||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" | ||
release: "{{ .Release.Name }}" | ||
heritage: "{{ .Release.Service }}" | ||
annotations: | ||
{{- if .Values.persistence.apache.storageClass }} | ||
volume.beta.kubernetes.io/storage-class: {{ .Values.persistence.apache.storageClass | quote }} | ||
{{- else }} | ||
volume.alpha.kubernetes.io/storage-class: default | ||
{{- end }} | ||
spec: | ||
accessModes: | ||
- {{ .Values.persistence.apache.accessMode | quote }} | ||
resources: | ||
requests: | ||
storage: {{ .Values.persistence.apache.size | quote }} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
{{- if include "host" . -}} | ||
apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ template "fullname" . }} | ||
labels: | ||
app: {{ template "name" . }} | ||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" | ||
release: "{{ .Release.Name }}" | ||
heritage: "{{ .Release.Service }}" | ||
spec: | ||
template: | ||
metadata: | ||
labels: | ||
app: {{ template "name" . }} | ||
release: "{{ .Release.Name }}" | ||
spec: | ||
containers: | ||
- name: {{ template "fullname" . }} | ||
image: "{{ .Values.image }}" | ||
imagePullPolicy: {{ .Values.imagePullPolicy | quote }} | ||
env: | ||
- name: MARIADB_HOST | ||
value: {{ template "mariadb.fullname" . }} | ||
- name: MARIADB_PORT_NUMBER | ||
value: "3306" | ||
- name: MARIADB_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: {{ template "mariadb.fullname" . }} | ||
key: mariadb-root-password | ||
- name: SUITECRM_HOST | ||
value: {{ include "host" . | quote }} | ||
- name: SUITECRM_USERNAME | ||
value: {{ .Values.suitecrmUsername | quote }} | ||
- name: SUITECRM_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: {{ template "fullname" . }} | ||
key: suitecrm-password | ||
- name: SUITECRM_EMAIL | ||
value: {{ .Values.suitecrmEmail | quote }} | ||
- name: SUITECRM_LAST_NAME | ||
value: {{ .Values.suitecrmLastName | quote }} | ||
- name: SUITECRM_SMTP_HOST | ||
value: {{ .Values.suitecrmSmtpHost | quote }} | ||
- name: SUITECRM_SMTP_PORT | ||
value: {{ .Values.suitecrmSmtpPort | quote }} | ||
- name: SUITECRM_SMTP_USER | ||
value: {{ .Values.suitecrmSmtpUser | quote }} | ||
- name: SUITECRM_SMTP_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: {{ template "fullname" . }} | ||
key: suitecrm-smtp-password | ||
- name: SUITECRM_SMTP_PROTOCOL | ||
value: {{ .Values.suitecrmSmtpProtocol | quote }} | ||
ports: | ||
- name: http | ||
containerPort: 80 | ||
- name: https | ||
containerPort: 443 | ||
livenessProbe: | ||
httpGet: | ||
path: /index.php | ||
port: http | ||
httpHeaders: | ||
- name: Host | ||
value: {{ include "host" . | quote }} | ||
initialDelaySeconds: 300 | ||
readinessProbe: | ||
httpGet: | ||
path: /index.php | ||
port: http | ||
httpHeaders: | ||
- name: Host | ||
value: {{ include "host" . | quote }} | ||
initialDelaySeconds: 60 | ||
resources: | ||
{{ toYaml .Values.resources | indent 10 }} | ||
volumeMounts: | ||
- name: suitecrm-data | ||
mountPath: /bitnami/suitecrm | ||
- name: apache-data | ||
mountPath: /bitnami/apache | ||
volumes: | ||
- name: suitecrm-data | ||
{{- if .Values.persistence.enabled }} | ||
persistentVolumeClaim: | ||
claimName: {{ template "fullname" . }}-suitecrm | ||
{{- else }} | ||
emptyDir: {} | ||
{{- end }} | ||
- name: apache-data | ||
{{- if .Values.persistence.enabled }} | ||
persistentVolumeClaim: | ||
claimName: {{ template "fullname" . }}-apache | ||
{{- else }} | ||
emptyDir: {} | ||
{{- end }} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: {{ template "fullname" . }} | ||
labels: | ||
app: {{ template "name" . }} | ||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" | ||
release: "{{ .Release.Name }}" | ||
heritage: "{{ .Release.Service }}" | ||
type: Opaque | ||
data: | ||
{{ if .Values.suitecrmPassword }} | ||
suitecrm-password: {{ .Values.suitecrmPassword | b64enc | quote }} | ||
{{ else }} | ||
suitecrm-password: {{ randAlphaNum 10 | b64enc | quote }} | ||
{{ end }} | ||
suitecrm-smtp-password: {{ default "" .Values.suitecrmSmtpPassword | b64enc | quote }} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only
app
andrelease
label should be added here.