Skip to content

Commit

Permalink
[stable/stellar-core]: Release 1.0.0 (initial release) (helm#7266)
Browse files Browse the repository at this point in the history
* [incubator/stellar-core]: Release 0.1.0 (initial release)

Signed-off-by: André Gaul <[email protected]>

* [incubator/stellar-core]: use http readiness probe

Signed-off-by: André Gaul <[email protected]>

* [incubator/stellar-core]: update NOTES

Signed-off-by: André Gaul <[email protected]>

* [incubator/stellar-core]: update requirements.yaml with repo url

Signed-off-by: André Gaul <[email protected]>

* [incubator/stellar-core]: add rendhalver as maintainer/owner

Signed-off-by: André Gaul <[email protected]>

* [incubator/stellar-core]: properly handle postgresql name override in helpers

Signed-off-by: André Gaul <[email protected]>

* [stable/stellar-core]: move stellar-core to stable

Signed-off-by: André Gaul <[email protected]>

* [stable/stellar-core]: adapt install command in README

Signed-off-by: André Gaul <[email protected]>

* [stable/stellar-core]: enable 10.0.0-2 features (flavors, archive init)

Signed-off-by: André Gaul <[email protected]>

* [stable/stellar-core]: use deployment strategy recreate

Signed-off-by: André Gaul <[email protected]>

* [stable/stellar-core]: add serviceaccount

Signed-off-by: André Gaul <[email protected]>

* [stable/stellar-core]: add default timeout for postgres

Signed-off-by: André Gaul <[email protected]>

* [stable/stellar-core]: fix versions

Signed-off-by: André Gaul <[email protected]>

* [stable/stellar-core]: update postgresql

Signed-off-by: André Gaul <[email protected]>

* [stable/stellar-core]: fix version in readme

Signed-off-by: André Gaul <[email protected]>

* [stable/stellar-core]: fix bug in secret template

Signed-off-by: André Gaul <[email protected]>
  • Loading branch information
andrenarchy authored and k8s-ci-robot committed Oct 10, 2018
1 parent f5feb79 commit adea94f
Show file tree
Hide file tree
Showing 14 changed files with 724 additions and 0 deletions.
21 changes: 21 additions & 0 deletions stable/stellar-core/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: v1
appVersion: "10.0.0"
description: Backbone node of the Stellar cryptocurrency network.
name: stellar-core
version: 1.0.0
icon: https://www.stellar.org/developers/images/favicon/rocket-180x180.png
home: https://www.stellar.org
maintainers:
- name: andrenarchy
email: [email protected]
url: https://github.com/andrenarchy
- name: rendhalver
email: [email protected]
sources:
- https://github.com/satoshipay/docker-stellar-core/
keywords:
- stellar
- stellar-core
- cryptocurrency
- blockchain
engine: gotpl
6 changes: 6 additions & 0 deletions stable/stellar-core/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
approvers:
- andrenarchy
- rendhalver
reviewers:
- andrenarchy
- rendhalver
101 changes: 101 additions & 0 deletions stable/stellar-core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# Stellar Core

[Stellar](https://www.stellar.org) is an open-source and distributed payments infrastructure. Stellar Core is the software that powers the backbone of the Stellar network and validates and agrees on transactions. For more information see the [Stellar network overview](https://www.stellar.org/developers/guides/get-started/).

## Introduction

This chart bootstraps a [Stellar Core](https://github.com/stellar/stellar-core/) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. By default the deployment includes a PostgreSQL database. The chart is based on the Kubernetes-ready [Stellar Core images provided by SatoshiPay](https://github.com/satoshipay/docker-stellar-core/).

## Prerequisites

- You need a node seed to run Stellar Core. If you don't have one you can generate one with the following command:
```bash
$ docker run --rm -it --entrypoint '' satoshipay/stellar-core stellar-core --genseed
```
The output will look like
```
Secret seed: SDUFQA7YL3KTWZNKOXX7XXIYU4R5R6JKELMREKHDQOYY2WPUGXFVJN52
Public: GDJFYQK2VFVMQAOFSBM7RVE4I5HCUT7VNWOKSJKGI5JEODIH6F3EM6YX
```
The node seed must be kept secret but the public key can (and should) be shared with other Stellar node operators.
- Kubernetes 1.8+ with Beta APIs enabled
- PV provisioner support in the underlying infrastructure (Only when persisting data)

## Installing the Chart

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

```bash
$ helm install --name my-release stable/stellar-core
```

🚨 **Warning:** Make sure to use your own node seed, either via setting `nodeSeed` or `existingNodeSeedSecret`. See [prerequisites](#prerequisites) for how to generate a new node seed.

## Configuration

The following table lists the configurable parameters of the Stellar Core chart and their default values.

| Parameter | Description | Default |
| ----------------------- | --------------------------------------------- | --------------------------------------------- |
| `nodeSeed` | Stellar Core node seed (if `existingNodeSeedSecret` is not set) | Not set |
| `existingNodeSeedSecret` | Existing secret with the node seed (if `nodeSeed` is not set) | Not set |
| `existingNodeSeedSecret.name` | Secret containing the node seed | Not set |
| `existingNodeSeedSecret.key` | Key of the node seed in the secret | Not set |
| `nodeIsValidator` | Should the node participate in SCP? Otherwise it is only observing | `true` |
| `networkPassphrase` | The network this instance should talk to | `Public Global Stellar Network ; September 2015` |
| `catchupRecent` | Number of ledgers to catch up (`0` means minimal catchup) | `0` |
| `maxPeerConnections` | Maximum number of connections to other peers | `50` |
| `knownPeers` | List of hostnames/IPs and ports of peers to connect to initially | Default peers, see `values.yaml` |
| `preferredPeers` | List of hostnames/IPs and ports of peers to stay connected to | Default peers, see `values.yaml` |
| `nodeNames` | List of node public keys and node names | Default node names, see `values.yaml` |
| `nodeNames[].publicKey` | Public key of a node | See above |
| `nodeNames[].name` | Name of a node | See above |
| `quorumSet` | List of quorum set definitions | Default quorum set, see `values.yaml` |
| `quorumSet.thresholdPercent` | Threshold in percent for the quorum set | See above |
| `quorumSet.validators` | List of node names (prefixed with `$$`) or public keys in this set | See above |
| `quorumSet.path` | Path for sub-quorum-sets | See above |
| `history` | Definition for fetching and storing the history of the network | Default history, see `values.yaml` |
| `history.$name.get` | Command for fetching from the history archive | See above |
| `history.$name.put` | Command for storing the history in an archive | See above |
| `initializeHistoryArchives` | Set to `true` if you want history archives to be initialized | `false` |
| `gcloudServiceAccountKey` | Gcloud service account key for `gcloud` flavor | Not set |
| `environment` | Additional environment variables for Stellar Core | `{}` |
| `postgresql.enabled` | Enable PostgreSQL database | `true` |
| `postgresql.postgresDatabase` | PostgreSQL database name | `stellar-core` |
| `postgresql.postgresUser` | PostgreSQL username | `postgres` |
| `postgresql.postgresPassword` | PostgreSQL password | Random password (see PostgreSQL chart) |
| `postgresql.persistence` | PostgreSQL persistence options | See PostgreSQL chart |
| `postgresql.*` | Any PostgreSQL option | See PostgreSQL chart |
| `existingDatabase` | Provide existing database (used if `postgresql.enabled` is `false`)| |
| `existingDatabase.passwordSecret` | Existing secret with the database password | `{name: 'postgresql-core', value: 'password'}` |
| `existingDatabase.url` | Existing database URL (use `$(DATABASE_PASSWORD` as the password) | Not set |
| `image.repository` | `stellar-core` image repository | `satoshipay/stellar-core` |
| `image.tag` | `stellar-core` image tag | `10.0.0-2` |
| `image.flavor` | `stellar-core` flavor (e.g., `aws` or `gcloud`) | Not set |
| `image.pullPolicy` | Image pull policy | `IfNotPresent` |
| `peerService.type` | p2p service type | `LoadBalancer` |
| `peerService.port` | p2p service TCP port | `11625` |
| `peerService.loadBalancerIP` | p2p service load balancer IP | Not set |
| `peerService.externalTrafficPolicy` | p2p service traffic policy | Not set |
| `httpService.type` | Non-public HTTP admin endpoint service type | `ClusterIP` |
| `httpService.port` | Non-public HTTP admin endpoint TCP port | `11626` |
| `persistence.enabled` | Use a PVC to persist data | `true` |
| `persistence.existingClaim` | Provide an existing PersistentVolumeClaim | Not set |
| `persistence.storageClass` | Storage class of backing PVC | Not set (uses alpha storage class annotation) |
| `persistence.accessMode` | Use volume as ReadOnly or ReadWrite | `ReadWriteOnce` |
| `persistence.annotations` | Persistent Volume annotations | `{}` |
| `persistence.size` | Size of data volume | `8Gi` |
| `persistence.subPath` | Subdirectory of the volume to mount at | `stellar-core` |
| `persistence.mountPath` | Mount path of data volume | `/data` |
| `resources` | CPU/Memory resource requests/limits | Requests: `512Mi` memory, `100m` CPU |
| `nodeSelector` | Node labels for pod assignment | {} |
| `tolerations` | Toleration labels for pod assignment | [] |
| `affinity` | Affinity settings for pod assignment | {} |
| `serviceAccount.create` | Specifies whether a ServiceAccount should be created | `true` |
| `serviceAccount.name` | The name of the ServiceAccount to create | Generated using the fullname template |

## Persistence

Both Stellar Core and PostgreSQL (if `postgresql.enabled` is `true`) need to store data and thus this chart creates [Persistent Volumes](http://kubernetes.io/docs/user-guide/persistent-volumes/) by default. Make sure to size them properly for your needs and use an appropriate storage class, e.g. SSDs.

You can also use existing claims with the `persistence.existingClaim` and `postgresql.persistence.existingClaim` options.
6 changes: 6 additions & 0 deletions stable/stellar-core/requirements.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: postgresql
repository: https://kubernetes-charts.storage.googleapis.com/
version: 0.19.0
digest: sha256:31a2190b81ff68c4c1793c17fd4cbf6157683cc6d2f9fef66a1423938593e93d
generated: 2018-10-09T16:15:19.465844319+02:00
5 changes: 5 additions & 0 deletions stable/stellar-core/requirements.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dependencies:
- name: postgresql
version: ^0.19.0
repository: "https://kubernetes-charts.storage.googleapis.com/"
condition: postgresql.enabled
15 changes: 15 additions & 0 deletions stable/stellar-core/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
1. The node will take a while to sync with the network (~1h or more
is not unusual for the default config).

2. Allow other nodes to connect to you

You can publish your external IP address and port as well as your
node's public key so other validators can include your node in
their quorum sets.

{{- if contains "LoadBalancer" .Values.peerService.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 svc -w {{ template "stellar-core.fullname" . }}-peer'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "stellar-core.fullname" . }}-peer -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo $SERVICE_IP:{{ .Values.peerService.port }}
{{- end }}
60 changes: 60 additions & 0 deletions stable/stellar-core/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "stellar-core.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 "stellar-core.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 "stellar-core.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create the name of the service account to use
*/}}
{{- define "stellar-core.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{ default (include "stellar-core.fullname" .) .Values.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- 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).
*/}}
{{- define "stellar-core.postgresql.fullname" -}}
{{- if .Values.postgresql.fullnameOverride -}}
{{- .Values.postgresql.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default "postgresql" .Values.postgresql.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
Loading

0 comments on commit adea94f

Please sign in to comment.