Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ jobs:
helm repo add fluxcd-community https://fluxcd-community.github.io/helm-charts
helm repo add dexidp https://charts.dexidp.io
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add plural https://pluralsh.github.io/module-library
helm repo add plural https://k8s.ory.sh/helm/charts
- name: Run chart-releaser
id: release
uses: helm/chart-releaser-action@v1.5.0
Expand Down
22 changes: 22 additions & 0 deletions charts/plural/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# 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
.vscode/
9 changes: 9 additions & 0 deletions charts/plural/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dependencies:
- name: hydra
repository: https://k8s.ory.sh/helm/charts
version: 0.26.5
- name: test-base
repository: https://pluralsh.github.io/module-library
version: 0.1.10
digest: sha256:0b68f34a7fee38ce1d995ea285132e440a4d532ed82610a86c9dbb924dafb7e8
generated: "2023-06-14T11:26:09.163042-04:00"
18 changes: 18 additions & 0 deletions charts/plural/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v2
name: plural
description: A helm chart for installing plural
appVersion: 0.11.8
version: 0.10.107
dependencies:
- name: hydra
version: 0.26.5
repository: https://k8s.ory.sh/helm/charts
- name: test-base
version: 0.1.10
repository: https://pluralsh.github.io/module-library
condition: test-base.enabled
maintainers:
- name: michaeljguarino
email: mjg@plural.sh
sources:
- https://github.com/pluralsh/plural
61 changes: 61 additions & 0 deletions charts/plural/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Helm chart for installing Plural

Plural is a multi-tenant kubernetes app delivery platform. It has as subcomponents:

* postgres db
* rabbitmq cluster
* rtc, api, and background worker deployments
* chartmuseum
* docker registry

## Installation

```
helm repo add plural https://app.plural.sh/cm/plural
```

## Usage

```
helm upgrade --install plural plural/plural
```

## Example Configuration

(It's highly recommend you utilize plural to generate the initial configuration for you based on the environment you're deploying to)

```yaml
postgresql:
postgresqlPassword: supercomplicatedrandombytes

secrets:
jwt: alsosupercomplicatedrandombytes
erlang: stillusesupercomplicatedrandombytes

ingress:
dns: my.forge.domain

api:
bucket: assets-for-forge

chartmuseum:
bucket: bucket-for-chartmuseum

admin:
enabled: true
name: "Michael Guarino"
email: mguarino46@gmail.com
password: "a very strong password"
publisher: michaeljguarino
publisher_description: "A collection of my personal projects"
```

## More configuration

| Parameter | Description | Default |
| --------- | ----------- | ------- |
| replicaCount | number of api replicas | 2 |
| api.bucket | the bucket to use for images | forge-assets |
| chartmuseum.bucket | the bucket for charts | forge-charts |
| ingress.dns | the dns name to register under | forge.piazza.app |
| ingress.enabled | whether to provision an ingress | true |
Binary file added charts/plural/charts/hydra-0.26.5.tgz
Binary file not shown.
Binary file added charts/plural/charts/test-base-0.1.10.tgz
Binary file not shown.
37 changes: 37 additions & 0 deletions charts/plural/deps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: plural.sh/v1alpha1
kind: Dependencies
metadata:
application: true
description: deploys plural's api and background services
spec:
dependencies:
- type: helm
name: bootstrap
repo: bootstrap
version: '>= 0.5.1'
- type: helm
name: ingress-nginx
repo: ingress-nginx
version: '>= 0.1.2'
- type: helm
name: postgres
repo: postgres
version: '>= 0.1.0'
- type: helm
name: cluster-operator
repo: rabbitmq
version: '>= 0.1.11'
- type: helm
name: influx
repo: influx
version: '>= 0.1.10'
- type: terraform
name: aws
repo: plural
version: '>= 0.1.1'
optional: true
- type: terraform
name: gcp
repo: plural
version: '>= 0.1.0'
optional: true
57 changes: 57 additions & 0 deletions charts/plural/runbooks/db-scaling-manual.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<root gap='medium'>
<box pad='small' gap='medium' direction='row' align='center'>
<box direction='row' align='center' gap='small'>
<box gap='small' align='center'>
<timeseries datasource="cpu" label="CPU Usage" />
<text size='small'>You should set a reservation to
roughly correspond to 30% utilization</text>
</box>
<box gap='small' align='center'>
<timeseries datasource="memory" label="Memory Usage" />
<text size='small'>You should set a reservation to
roughly correspond to 60% utilization</text>
</box>
</box>
<box gap='small'>
<box gap='xsmall'>
<input placeholder="250m" label='CPU Request' name='cpu'>
<valueFrom
datasource="statefulset"
doc="kubernetes.raw"
path="spec.template.spec.containers[0].resources.requests.cpu" />
</input>
<input placeholder="1Gi" label='Memory Request' name='memory'>
<valueFrom
datasource="statefulset"
doc="kubernetes.raw"
path="spec.template.spec.containers[0].resources.requests.memory" />
</input>
</box>
<box direction='row' justify='end'>
<button label='Scale' action='scale' primary='true' />
</box>
</box>
</box>
<box direction='row' align='center' gap='small'>
<box gap='small' align='center'>
<timeseries datasource="volume" label="Volume Usage" />
<text size='small'>You should resize at around 80% utilization (or based on dataset growth)</text>
</box>
<box gap='small'>
<input placeholder="25Gi" label='Volume Size' name='volume'>
<valueFrom
datasource="statefulset"
doc="kubernetes.raw"
path="spec.volumeClaimTemplates[0].spec.resources.requests.storage" />
</input>
</box>
</box>
<box width='100%' gap='small'>
<text size='small'>Be sure to scale your postgres pods within your nodes capacities, listed here:</text>
<table width='100%' datasource='nodes' path='nodes'>
<tableColumn path='metadata.name' header='name' width='33%' />
<tableColumn path='status.capacity.cpu' header='cpu' width='33%' />
<tableColumn path='status.capacity.memory' header='memory' width='33%' />
</table>
</box>
</root>
21 changes: 21 additions & 0 deletions charts/plural/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range .paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }}
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "plural.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "plural.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "plural.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "plural.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl port-forward $POD_NAME 8080:80
{{- end }}
102 changes: 102 additions & 0 deletions charts/plural/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "plural.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).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "plural.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "plural.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Common labels
*/}}
{{- define "plural.labels" -}}
app.kubernetes.io/name: {{ include "plural.name" . }}
helm.sh/chart: {{ include "plural.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}


{{- define "plural.env" -}}
- name: HOST
value: {{ .Values.ingress.dns }}
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Values.dbPasswordSecret }}
key: password
- name: RABBIT_USERNAME
valueFrom:
secretKeyRef:
name: rabbitmq-default-user
key: username
- name: RABBIT_PASSWORD
valueFrom:
secretKeyRef:
name: rabbitmq-default-user
key: password
- name: INFLUX_PASSWORD
valueFrom:
secretKeyRef:
name: influxdb-auth
key: influxdb-password
- name: RABBIT_NAMESPACE
value: {{ .Values.rabbitmqNamespace }}
- name: DBHOST
value: plural-plural
- name: DBSSL
value: 'true'
{{ if .Values.sentryDsn }}
- name: SENTRY_DSN
value: {{ .Values.sentryDsn | quote }}
{{ end }}
{{- end -}}

{{- define "plural.image" -}}
{{ .Values.global.registry }}/{{ .repository }}:{{ .tag }}
{{- end -}}

{{- define "plural.migration-name" -}}
plural-migration-{{ .Values.global.tag | default .Values.image.tag | default .Chart.AppVersion | sha256sum | trunc 8 }}
{{- end -}}


{{- define "plural.imageTag" -}}
{{ .Values.global.tag | default .Values.image.tag | default .Chart.AppVersion }}
{{- end -}}
Loading
Loading