Add Sapho Chart (#279)

* Initial Commit

* cleaned up some unused values...

* Delete values.yaml

* cleanup

* Disabled Persistant volume support for mysql due to it causing sapho server to try connecting to mysql before it is ready

* Edited values.yaml:
Removed line 8 - This setting causes MySQL to crash, root is the default user created so
with this it tries to create the root user twice.

NOTES.TXT:
Removed section about MySQL.

* Re-enabled livenessProbe (prev disabled for troubleshooting)

* incubator/sapho/Chart.yaml:
Added proper chart description and source URLs.

incubator/sapho/README.md:
Updated readme with a product description and revised install instructions.

* Moved to stable/

* Moved into stable/

* Update NOTES.txt
This commit is contained in:
Christopher Montes
2016-12-19 15:00:14 -08:00
committed by Lachlan Evenson
parent 103ee1952f
commit 14546e2c3a
10 changed files with 258 additions and 0 deletions
+21
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
+12
View File
@@ -0,0 +1,12 @@
apiVersion: v1
description: A micro application development and integration platform that enables organizations to create and deliver secure micro applications that tie into existing business systems and track changes to key business data.
name: sapho
version: 0.1.3
sources:
- https://bitbucket.org/sapho/ops-docker-tomcat/src
- https://hub.docker.com/r/sapho/ops-docker-tomcat
- https://github.com/kubernetes/charts/tree/master/stable/mysql
maintainers:
- name: Sapho
email: support@sapho.com
engine: gotpl
+79
View File
@@ -0,0 +1,79 @@
# Sapho
The Sapho Micro App Platform is the best way to put actionable business information into your employees hands. This micro application development and integration platform enables organizations to create and deliver secure micro apps that tie into existing business systems and track changes to key business data. The result is a work feed that keeps employees up-to-date with important information and their associated actions. Employees benefits from real time data updates and one-click task completion from a single unified app, browser, or messenger client. All of this runs on Azure, connects to your existing infrastructure, and integrates with your existing identity and access control solutions to maintain security. For more information, please visit [Sapho](https://www.sapho.com/).
## Introduction
This chart bootstraps a [Sapho](https://bitbucket.org/sapho/ops-docker-tomcat/) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
It also packages the [MySQL chart](https://github.com/kubernetes/charts/tree/master/stable/mysql) which is required for bootstrapping a MySQL deployment for the database requirements of the Sapho application.
## Prerequisites
- Kubernetes 1.4+ with Beta APIs enabled
- PV provisioner support in the underlying infrastructure
## Installing the Chart
To install the chart:
```console
$ helm install --name my-release stable/sapho
```
> **Tip**: List all releases using `helm list`
The command deploys Sapho 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, use `helm list` command to obtain the release name, then :
```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 Sapho chart and their default values.
| Parameter | Description | Default |
| ------------------------------- | ------------------------------- | ---------------------------------------------------------- |
| `image` | Sapho image | `sapho/ops-docker-tomcat:{VERSION}` |
| `imagePullPolicy` | Image pull policy | `Always` if `image` tag is `latest`, else `IfNotPresent` |
| `saphoDBuser` | User of the application | `user` |
| `saphoDBpass` | MySQL DB Password | `nil` |
| `saphoDBtype` | Sapho DB Type | `mysql` |
| `saphoDBhost` | Sapho DB HostName | `nil` |
| `mysql.mysqlRootPassword` | MySQL admin password | `nil` |
| `serviceType` | Kubernetes Service type | `LoadBalancer` |
| `persistence.enabled` | Enable persistence using PVC | `true`
The above parameters map to the env variables defined in [sapho/ops-docker-tomcat](https://bitbucket.org/sapho/ops-docker-tomcat). For more information please refer to the [sapho/ops-docker-tomcat](https://bitbucket.org/sapho/ops-docker-tomcat) image documentation.
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
```console
$ helm install --set saphoDBuser=root,saphoDBpass=password,mysql.mysqlRootPassword=password sapho
```
The above command sets Sapho's JDBC connection's username and password to `root` and `password` respectively. Additionally it sets the MySQL `root` user password to `password`.
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 sapho
```
> **Tip**: You can use the default [values.yaml](values.yaml)
## Persistence
The [MySQL](https://hub.docker.com/_/mysql/) image stores the data at the `/var/lib/mysql` path of the container which is mounted to a PVC.
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.
+6
View File
@@ -0,0 +1,6 @@
dependencies:
- name: mysql
repository: https://kubernetes-charts.storage.googleapis.com/
version: 0.2.1
digest: sha256:150372f342415d400342e4c4d0e05fffb7f87e1af8ce7a95d0c7e2dabb87b6a1
generated: 2016-12-02T15:51:00.728837836-07:00
+4
View File
@@ -0,0 +1,4 @@
dependencies:
- name: mysql
version: 0.2.1
repository: https://kubernetes-charts.storage.googleapis.com/
+15
View File
@@ -0,0 +1,15 @@
1. Get the application URL by running these commands:
{{- if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT/login
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available, and a few more minutes before the application will be available (allow up to 5 minutes).
You can watch the status of by running 'kubectl get svc -w {{ template "fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP:{{ .Values.service.externalPort }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "fullname" . }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl port-forward $POD_NAME 8080:{{ .Values.service.externalPort }}
{{- end }}
+24
View File
@@ -0,0 +1,24 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 24 -}}
{{- end -}}
{{/*
Create a default fully qualified app name.
We truncate at 24 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 24 -}}
{{- end -}}
{{/*
Create a default fully qualified app name.
We truncate at 24 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "mysql.fullname" -}}
{{- printf "%s-%s" .Release.Name "mysql" | trunc 24 -}}
{{- end -}}
+49
View File
@@ -0,0 +1,49 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
spec:
replicas: {{ .Values.replicaCount }}
template:
metadata:
labels:
app: {{ template "fullname" . }}
spec:
containers:
- name: {{ template "fullname" . }}
image: "{{ .Values.image }}"
imagePullPolicy: {{ default "" .Values.imagePullPolicy | quote }}
env:
- name: SAPHO_DB_HOSTNAME
value: {{ template "mysql.fullname" . }}
- name: SAPHO_DB_PORT
value: {{ .Values.saphoDBport | quote }}
- name: SAPHO_DB_TYPE
value: {{ .Values.saphoDBtype }}
- name: SAPHO_DB_USERNAME
value: {{ .Values.saphoDBuser }}
- name: SAPHO_DB_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "mysql.fullname" . }}
key: mysql-root-password
ports:
- name: http
containerPort: 8080
livenessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 180
timeoutSeconds: 10
readinessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 30
timeoutSeconds: 5
resources:
{{ toYaml .Values.resources | indent 12 }}
+15
View File
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "fullname" . }}
labels:
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.externalPort }}
targetPort: {{ .Values.service.internalPort }}
protocol: TCP
name: {{ .Values.service.name }}
selector:
app: {{ template "fullname" . }}
+33
View File
@@ -0,0 +1,33 @@
# Default values for sapho.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
image: sapho/ops-docker-tomcat:8-jre8
mysql:
persistence:
enabled: true
storageClass: generic
accessMode: ReadWriteOnce
size: 8Gi
resources:
requests:
memory: 512Mi
cpu: 250m
service:
name: sapho
type: LoadBalancer
externalPort: 80
internalPort: 8080
resources:
# limits:
# cpu: 500m
# memory: 2048Mi
requests:
cpu: 250m
memory: 2048Mi
saphoDBport: 3306
saphoDBtype: mysql
saphoDBuser: root