From a3f47f47f9ee8de3ac709277104a657ab7436c31 Mon Sep 17 00:00:00 2001 From: Dries De Peuter Date: Sun, 10 May 2020 15:14:59 +0200 Subject: [PATCH] Ledger: Add README.md --- charts/ledger/Chart.yaml | 2 +- charts/ledger/README.md | 92 ++++++++++++++++++++++++ charts/ledger/templates/ingress.yaml | 12 +--- charts/ledger/templates/statefulset.yaml | 20 ++++++ charts/ledger/values.yaml | 5 +- 5 files changed, 117 insertions(+), 14 deletions(-) create mode 100644 charts/ledger/README.md diff --git a/charts/ledger/Chart.yaml b/charts/ledger/Chart.yaml index ffff596..b63fa8f 100644 --- a/charts/ledger/Chart.yaml +++ b/charts/ledger/Chart.yaml @@ -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 diff --git a/charts/ledger/README.md b/charts/ledger/README.md new file mode 100644 index 0000000..1827c36 --- /dev/null +++ b/charts/ledger/README.md @@ -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 +``` diff --git a/charts/ledger/templates/ingress.yaml b/charts/ledger/templates/ingress.yaml index 9a08487..b58b9a8 100644 --- a/charts/ledger/templates/ingress.yaml +++ b/charts/ledger/templates/ingress.yaml @@ -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 }} diff --git a/charts/ledger/templates/statefulset.yaml b/charts/ledger/templates/statefulset.yaml index a5f9ddb..3cdf53c 100644 --- a/charts/ledger/templates/statefulset.yaml +++ b/charts/ledger/templates/statefulset.yaml @@ -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 @@ -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" @@ -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 diff --git a/charts/ledger/values.yaml b/charts/ledger/values.yaml index 427ddc6..e4a6acc 100644 --- a/charts/ledger/values.yaml +++ b/charts/ledger/values.yaml @@ -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