Skip to content

Commit f8775f0

Browse files
authored
Create 'Lita' Helm chart (#16)
1 parent 76e7edb commit f8775f0

10 files changed

+627
-0
lines changed

charts/lita/.helmignore

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*~
18+
# Various IDEs
19+
.project
20+
.idea/
21+
*.tmproj

charts/lita/Chart.yaml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: v2
2+
name: lita
3+
version: 0.1.0
4+
description: A Helm chart for Lita
5+
type: application
6+
keywords:
7+
- lita
8+
home: https://github.com/indiegogo/gogo-lita
9+
sources:
10+
- https://github.com/indiegogo/gogo-lita
11+
dependencies:
12+
- name: common
13+
version: "0.1.2"
14+
repository: https://charts.indiegogo.com/
15+
tags:
16+
- indiegogo-common
17+
- name: redis
18+
version: "0.4.6"
19+
repository: https://groundhog2k.github.io/helm-charts/
20+
condition: redis.chartEnabled
21+
maintainers:
22+
- name: DevOps
23+
email: devops@indiegogo.com
24+
appVersion: "b192b8c"

charts/lita/README.md

+163
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
# Lita Chart packaged by Indiegogo
2+
3+
## TL;DR
4+
5+
```bash
6+
$ helm repo add indiegogo https://charts.indiegogo.com
7+
$ helm install my-release indiegogo/lita
8+
```
9+
10+
## Introduction
11+
12+
This chart bootstraps a Lita deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
13+
14+
## Prerequisites
15+
16+
- Kubernetes 1.12+
17+
- Helm 3.6.2
18+
19+
## Getting started with default values
20+
21+
To get you started with modifying the default values to your liking/needs, use the below command to grab the latest `values.yaml` file:
22+
23+
```bash
24+
$ helm show values indiegogo/lita > values.yaml
25+
```
26+
27+
## Installing the Chart
28+
29+
To install the chart with the release name `my-release`:
30+
31+
```bash
32+
$ helm install my-release indiegogo/lita
33+
```
34+
35+
The command deploys Lita on the Kubernetes cluster in the default configuration. The [Parameters](#parameters) section lists the parameters that can be configured during installation.
36+
37+
> **Tip**: List all releases using `helm list`
38+
39+
## Uninstalling the Chart
40+
41+
To uninstall/delete the `my-release` deployment:
42+
43+
```bash
44+
$ helm uninstall my-release
45+
```
46+
47+
> NOTE: If you used `-n namespace` when you installed the chart, be sure to use it again when you uninstall the chart, otherwise the associated dependency Kubernetes resources will not be deleted:
48+
49+
```bash
50+
$ helm uninstall -n namespace my-release
51+
```
52+
53+
The command removes all the Kubernetes components associated with the chart and deletes the release.
54+
55+
## Parameters
56+
57+
58+
### Common parameters
59+
60+
| Name | Type | Description | Default |
61+
| ------------------ | ------ | ---------------------------------------------------------------- | ------- |
62+
| `kubeVersion` | string | Override Kubernetes version | `nil` |
63+
| `nameOverride` | string | Partially override names.fullname | `nil` |
64+
| `fullnameOverride` | string | Fully override names.fullname | `nil` |
65+
| `commonLabels` | object | Labels to add to all deployed objects | `{}` |
66+
| `networkPort` | int | Deployment container, Deployment livenessProbe, and Service port | `8080` |
67+
68+
69+
### Lita configuration parameters
70+
71+
| Name | Type | Description | Default |
72+
| -------------------------------- | ------ | ---------------------------------------------------------- | --------------------|
73+
| `configuration.circleCiHost` | string | CircleCI host that Lita communicates with | `"circleci.igg.me"` |
74+
| `configuration.enableDebug` | string | Enable debugging in Lita | `""` |
75+
| `configuration.circleCiApiToken` | string | CircleCI API token so Lita can communication with CircleCI | `"CHANGEME"` |
76+
| `configuration.slackToken` | string | Slack token so Lita can communicate with Slack | `"CHANGEME"` |
77+
78+
79+
### Deployment parameters
80+
81+
| Name | Type | Description | Default |
82+
| ----------------------------------- | ------- | -------------------------------------------------------------- | -------------------------- |
83+
| `image.registry` | string | The Docker image registry | `"gcr.io"` |
84+
| `image.repository` | string | The Docker image repository | `"indiegogo-staging/lita"` |
85+
| `image.tag` | string | The Docker image tag | `'latest'` |
86+
| `image.pullPolicy` | string | The Docker image pull policy | `"IfNotPresent"` |
87+
| `environmentIncludeDefault` | boolean | Include/don't include the default environment variables | `true` |
88+
| `environment` | object | Custom/extra environment variables | `{}` |
89+
| `containerPort` | int | Lita container port (overrides `networkPort`) | `nil` |
90+
| `replicaCount` | int | Number of Lita replicas to deploy | `1` |
91+
| `strategy.type` | string | Deployment strategy type | `"RollingUpdate"` |
92+
| `strategy.rollingUpdate` | object | Rolling update deployment strategy options | `{}` |
93+
| `resources.requests` | object | CPU/memory resource requests | `{}` |
94+
| `resources.limits` | object | CPU/memory resource limits | `{}` |
95+
| `livenessProbe.enabled` | boolean | Enable/Disable the default tcpSocket livenessProbe | `true` |
96+
| `livenessProbe.port` | int | Default livenessProbe tcpSocket port (overrides `networkPort`) | `nil` |
97+
| `livenessProbe.initialDelaySeconds` | int | Initial delay seconds for livenessProbe | `nil` |
98+
| `livenessProbe.periodSeconds` | int | Period seconds for livenessProbe | `nil` |
99+
| `livenessProbe.timeoutSeconds` | int | Timeout seconds for livenessProbe | `nil` |
100+
| `livenessProbe.successThreshold` | int | Success threshold for livenessProbe | `nil` |
101+
| `livenessProbe.failureThreshold` | int | Failure threshold for livenessProbe | `nil` |
102+
| `customLivenessProbe` | object | Custom livenessProbe that overrides the default one | `{}` |
103+
| `readinessProbeEnabled` | boolean | Enable the custom readinessProbe | `false` |
104+
| `readinessProbe` | object | Write your custom readiness probe here | `{}` |
105+
| `usePacificTime` | boolean | Use Pacific time instead of UTC in container | `false` |
106+
107+
108+
### Service parameters
109+
110+
| Name | Type | Description | Default |
111+
| ---------------| ------ | ------------------------------------------- | ------------ |
112+
| `service.port` | int | Lita Service port (overrides `networkPort`) | `nil` |
113+
| `service.type` | string | Lita Service Type | `"NodePort"` |
114+
115+
116+
### Ingress parameters
117+
118+
| Name | Type | Description | Default |
119+
| --------------------------- | ------- | -------------------------- | ----------------- |
120+
| `ingress.enabled` | boolean | Enable/Disable Ingress | `true` |
121+
| `ingress.tls.enabled` | boolean | Enable/Disable Ingress TLS | `false` |
122+
| `ingress.tls.hosts` | list | Ingress TLS host(s) | see `values.yaml` |
123+
| `ingress.tls.secretName` | string | Ingress TLS Secret name | `nil` |
124+
| `ingress.rules.hosts` | list | Ingress rules host(s) | see `values.yaml` |
125+
| `ingress.customAnnotations` | object | Ingress custom annotations | `{}` |
126+
127+
128+
### Redis storage parameters
129+
130+
| Name | Type | Description | Default |
131+
| -------------------------------- | ------- | ----------------------------------------------- | ---------- |
132+
| `persistentVolume.enabled` | boolean | Enable to use an existing Redis persistent disk | `false` |
133+
| `persistentVolume.pdName` | string | Name of the existing persistent disk | `nil` |
134+
| `persistentVolume.reclaimPolicy` | string | Reclamation of the persistent disk resources | `"Retain"` |
135+
136+
137+
### Redis chart parameters
138+
139+
| Name | Type | Description | Default |
140+
| ----------------------------------------- | ------- | ---------------------------------------------- | ------------ |
141+
| `redis.chartEnabled` | boolean | Enable the Redis chart dependency | `true` |
142+
| `redis.fullnameOverride` | string | Fully override the default Redis instance name | `"redis"` |
143+
| `redis.args` | list | Add extra Redis command arguments | `[]` |
144+
| `redis.storage.persistentVolumeClaimName` | string | Set to use an existing Persistent Volume Claim | `nil` |
145+
| `redis.storage.requestedSize` | string | Set to create a new Persistent Volume Claim | `"10Gi"` |
146+
| `redis.storage.className` | string | Type of storage (standard/ssd) | `"standard"` |
147+
148+
149+
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
150+
151+
```bash
152+
$ helm install my-release \
153+
--set replicaCount=1 \
154+
indiegogo/lita
155+
```
156+
157+
Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,
158+
159+
```bash
160+
$ helm install my-release -f values.yaml indiegogo/lita
161+
```
162+
163+
> **Tip**: You can use the default [values.yaml](values.yaml)

charts/lita/templates/NOTES.txt

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
** Please be patient while the chart is being deployed **
2+
3+
--------------------------------------------------------------------------------------
4+
NOTICE
5+
6+
The lita pod will likely restart two or three times before it is fully operational.
7+
This is because the Redis instance is in the process of starting.
8+
9+
--------------------------------------------------------------------------------------

charts/lita/templates/deployment.yaml

+98
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
kind: Deployment
2+
apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
3+
metadata:
4+
name: {{ include "common.names.fullname" . }}
5+
namespace: {{ .Release.Namespace | quote }}
6+
labels: {{- include "common.labels.standard" . | nindent 4 }}
7+
{{- if .Values.commonLabels }}
8+
{{- include "common.tplValues.render" ( dict "value" .Values.commonLabels "scope" $ ) | nindent 4 }}
9+
{{- end }}
10+
spec:
11+
selector:
12+
matchLabels:
13+
app: {{ include "common.names.fullname" . }}
14+
replicas: {{ .Values.replicaCount }}
15+
{{- if .Values.strategy }}
16+
strategy: {{- toYaml .Values.strategy | nindent 4 }}
17+
{{- end }}
18+
template:
19+
metadata:
20+
labels:
21+
app: {{ include "common.names.fullname" . }}
22+
spec:
23+
{{- if .Values.usePacificTime }}
24+
volumes:
25+
- name: tz-config
26+
hostPath:
27+
path: /usr/share/zoneinfo/America/Los_Angeles
28+
{{- end }}
29+
containers:
30+
- name: {{ include "common.names.fullname" . }}
31+
{{- with .Values.image }}
32+
image: "{{- if contains ":" .repository -}}{{ .repository }}{{- else -}}{{- if .registry -}}{{ .registry }}/{{- end -}}{{ .repository }}:{{ default $.Chart.AppVersion .tag }}{{- end -}}"
33+
{{- end }}
34+
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
35+
{{- if or .Values.environmentIncludeDefault .Values.environment }}
36+
env:
37+
{{- if .Values.environmentIncludeDefault }}
38+
- name: CIRCLECI_HOST
39+
value: {{ default "circleci.igg.me" .Values.configuration.circleCiHost }}
40+
- name: GOGO_LITA_REDIS_HOST
41+
value: {{ required "You must set a value for 'redis.fullnameOverride' in values.yaml" .Values.redis.fullnameOverride }}
42+
- name: GOGO_LITA_DEBUG
43+
value: {{ default "0" .Values.configuration.enableDebug | quote }}
44+
- name: CIRCLECI_API_TOKEN
45+
valueFrom:
46+
secretKeyRef:
47+
name: {{ .Release.Name }}
48+
key: CIRCLECI_API_TOKEN
49+
- name: GOGO_LITA_SLACK_TOKEN
50+
valueFrom:
51+
secretKeyRef:
52+
name: {{ .Release.Name }}
53+
key: GOGO_LITA_SLACK_TOKEN
54+
{{- end }}
55+
56+
{{- range $key, $value := .Values.environment }}
57+
- name: {{ $key }}
58+
value: {{ $value | quote }}
59+
{{- end }}
60+
{{- end }}
61+
ports:
62+
- containerPort: {{ default .Values.networkPort .Values.containerPort }}
63+
{{- if .Values.resources }}
64+
resources: {{- toYaml .Values.resources | nindent 12 }}
65+
{{- end }}
66+
command: ["bundle"]
67+
args: ["exec", "lita"]
68+
{{- if .Values.livenessProbe.enabled }}
69+
livenessProbe:
70+
tcpSocket:
71+
port: {{ default .Values.networkPort .Values.livenessProbe.port }}
72+
{{- if .Values.livenessProbe.initialDelaySeconds }}
73+
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
74+
{{- end }}
75+
{{- if .Values.livenessProbe.periodSeconds }}
76+
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
77+
{{- end }}
78+
{{- if .Values.livenessProbe.timeoutSeconds }}
79+
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
80+
{{- end }}
81+
{{- if .Values.livenessProbe.successThreshold }}
82+
successThreshold: {{ .Values.livenessProbe.successThreshold }}
83+
{{- end }}
84+
{{- if .Values.livenessProbe.failureThreshold }}
85+
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
86+
{{- end }}
87+
{{- else if .Values.customLivenessProbe }}
88+
livenessProbe: {{- toYaml .Values.customLivenessProbe | nindent 12 }}
89+
{{- end }}
90+
{{- if .Values.readinessProbeEnabled }}
91+
readinessProbe: {{- toYaml .Values.readinessProbe | nindent 12 }}
92+
{{- end }}
93+
{{- if .Values.usePacificTime }}
94+
volumeMounts:
95+
- name: tz-config
96+
mountPath: /etc/localtime
97+
readOnly: true
98+
{{- end }}

charts/lita/templates/ingress.yaml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{{- if .Values.ingress.enabled }}
2+
kind: Ingress
3+
apiVersion: {{ include "common.capabilities.ingress.apiVersion" . }}
4+
metadata:
5+
name: {{ include "common.names.fullname" . }}
6+
namespace: {{ .Release.Namespace | quote }}
7+
labels: {{- include "common.labels.standard" . | nindent 4 }}
8+
{{- if .Values.commonLabels }}
9+
{{- include "common.tplValues.render" ( dict "value" .Values.commonLabels "scope" $ ) | nindent 4 }}
10+
{{- end }}
11+
{{- if .Values.ingress.customAnnotations }}
12+
annotations: {{- toYaml .Values.ingress.customAnnotations | nindent 4 }}
13+
{{- end }}
14+
spec:
15+
{{- if .Values.ingress.tls.enabled }}
16+
tls:
17+
- hosts:
18+
{{- range .Values.ingress.tls.hosts }}
19+
- {{ . }}
20+
{{- end }}
21+
secretName: {{ printf "%s-tls" (default (index (required "You must add a host in the 'ingress.tls.hosts' list in values.yaml" .Values.ingress.tls.hosts) 0) .Values.ingress.tls.secretName) | replace "." "-" }}
22+
{{- end }}
23+
rules:
24+
{{- range .Values.ingress.rules.hosts }}
25+
- host: {{ .host }}
26+
http:
27+
paths:
28+
{{- range .paths }}
29+
- path: {{ .path }}
30+
pathType: {{ .pathType }}
31+
backend:
32+
service:
33+
name: {{ .service.name }}
34+
port:
35+
number: {{ .service.port.number }}
36+
{{- end }}
37+
{{- end }}
38+
{{- end }}

charts/lita/templates/redis-pv.yaml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{{- if and .Values.persistentVolume.enabled (not .Values.redis.storage.persistentVolumeClaimName) }}
2+
apiVersion: v1
3+
kind: PersistentVolume
4+
metadata:
5+
name: {{ printf "%s-redis-data" (include "common.names.fullname" .) }}
6+
spec:
7+
capacity:
8+
storage: {{ .Values.redis.storage.requestedSize }}
9+
accessModes:
10+
- ReadWriteOnce
11+
persistentVolumeReclaimPolicy: {{ .Values.persistentVolume.reclaimPolicy }}
12+
gcePersistentDisk:
13+
pdName: {{ required "To use an existing persistent disk, please set a persistent disk name in values.yaml (persistentVolume.pdName)" .Values.persistentVolume.pdName }}
14+
fsType: ext4
15+
storageClassName: {{ .Values.redis.storage.className }}
16+
claimRef:
17+
name: redis-data-redis-0
18+
namespace: {{ .Release.Namespace | quote }}
19+
{{- end }}

charts/lita/templates/secret.yaml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
kind: Secret
2+
apiVersion: v1
3+
metadata:
4+
name: {{ .Release.Name }}
5+
namespace: {{ .Release.Namespace | quote }}
6+
labels: {{- include "common.labels.standard" . | nindent 4 }}
7+
{{- if .Values.commonLabels }}
8+
{{- include "common.tplValues.render" ( dict "value" .Values.commonLabels "scope" $ ) | nindent 4 }}
9+
{{- end }}
10+
type: Opaque
11+
stringData:
12+
CIRCLECI_API_TOKEN: {{ required "A CircleCI API token must be set in values.yaml" .Values.configuration.circleCiApiToken }}
13+
GOGO_LITA_SLACK_TOKEN: {{ required "A Slack token must be set in values.yaml" .Values.configuration.slackToken }}

0 commit comments

Comments
 (0)