Skip to content

Commit

Permalink
Ledger: Add README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
NoUseFreak committed May 10, 2020
1 parent bf35123 commit a3f47f4
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 14 deletions.
2 changes: 1 addition & 1 deletion charts/ledger/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: ledger
description: A ledger for your CD pipeline
version: 0.1.7
version: 0.1.8
appVersion: 0.1.5
sources:
- https://github.com/stenic/helm-charts/tree/master/charts/ledger
92 changes: 92 additions & 0 deletions charts/ledger/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Ledger helm chart

## TL;DR;

```console
helm repo add stenic https://stenic.github.io/helm-charts
helm install my-release stenic/ledger
```


## Introduction

This chart bootstraps a [Ledger](https://github.com/stenic/ledger) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.


## Prerequisites

- Kubernetes 1.12+
- Helm 2.11+ or Helm 3.0+
- PV provisioner support in the underlying infrastructure
- ReadWriteMany volumes for deployment scaling


## Installing the Chart

To install the chart with the release name `my-release`:

```console
helm repo add stenic https://stenic.github.io/helm-charts
helm install my-release stenic/ledger
```

These commands deploy Ledger on the Kubernetes cluster in the default configuration. The [Parameters](#parameters) 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 list the configurable parameters of the Ledger chart and their default values.

| Parameter | Description | Default |
| --------------------------------- | ------------------------------------ | ----------------------------------------- |
| `ledger.adminPassword` | Admin password to set in the secret | Random value |
| `image.repository` | Image name | `stenicbv/ledger` |
| `image.tag` | Image tag | Not set `Chart.AppVersion` |
| `image.pullPolicy` | Image pull policy | `IfNotPresent` |
| `nameOverride` | Override the resource name prefix | `ledger` |
| `fullnameOverride` | Override the full resource names | `ledger-{release-name}` |
| `persistence.enabled` | Enable the use of a PVC | `true` |
| `persistence.existingClaim` | Provide the name of a PVC | `nil` |
| `persistence.storageClass` | Storage class for the PVC | `nil` |
| `persistence.annotations` | Annotations for the PVC | `{}` |
| `persistence.accessMode` | The PVC access mode | `ReadWriteOnce` |
| `persistence.size` | The size of the PVC | `8Gi` |
| `serviceAccount.create` | Configures if a ServiceAccount with this name should be created | `true` |
| `serviceAccount.annotations` | Configures annotation for the ServiceAccount | `{}` |
| `serviceAccountAgent.name` | Name of the agent ServiceAccount to be used by access-controlled resources | autogenerated |
| `statefulset.volume.name` | Name of the volume | `ledger` |
| `statefulset.volume.path` | Path to mount the volume | `/data` |
| `service.type` | Kubernetes service type | `ClusterIP` |
| `service.port` | Kubernetes service port | `80` |
| `ingress.enabled` | Enables ingress | `false` |
| `ingress.hostName` | Ingress host name | `ledger.example.com` |
| `ingress.annotations` | Ingress annotations | `{}` |
| `ingress.tls` | Ingress TLS configuration | `nil` |
| `resources` | Resources allocation (Requests and Limits) | `{requests: {cpu: 50m, memory: 28Mi}, limits: {cpu: 100m, memory: 64Mi}}`|
| `nodeSelector` | Node labels for pod assignment | `{}` |
| `tolerations` | Toleration labels for pod assignment | `[]` |
| `affinity` | Affinity settings | `{}` |
| `imagePullSecretName` | Agent image pull secret | `nil` |
| `securityContext` | SecurityContext for Ledger | `{}` |
| `podSecurityContext` | SecurityContext for tje Ledger pod | `{}` |

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.

Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,

```console
helm install my-release -f values.yaml stenic/ledger
```
12 changes: 2 additions & 10 deletions charts/ledger/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,14 @@ metadata:
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- toYaml .Values.ingress.tls | nindent 4 }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
- host: {{ .Values.ingress.hostName | quote }}
http:
paths:
- path: /
backend:
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
20 changes: 20 additions & 0 deletions charts/ledger/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ spec:
labels:
{{- include "ledger.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "ledger.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
initContainers:
- name: {{ .Chart.Name }}-init
image: alpine:3.6
Expand All @@ -29,6 +36,7 @@ spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: LEDGER_PORT
value: "8080"
Expand All @@ -44,6 +52,18 @@ spec:
volumeMounts:
- name: {{ include "ledger.fullname" . }}-data
mountPath: /data
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumeClaimTemplates:
- metadata:
name: {{ include "ledger.fullname" . }}-data
Expand Down
5 changes: 2 additions & 3 deletions charts/ledger/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,11 @@ service:

ingress:
enabled: false
hostName: ledger.example.com
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: ledger.example.com
tls: []
tls:
# - secretName: chart-example-tls
# hosts:
# - ledger.example.com
Expand Down

0 comments on commit a3f47f4

Please sign in to comment.