mirror of
https://github.com/helm/charts.git
synced 2026-08-23 22:37:45 +00:00
Add bitcoind cryptocurrency chart (#3644)
* Add bitcoind cryptocurrency chart * Add fixes from PR #3644 comments * Update source Docker image and volumes mounts * Update readme with default values, add docker source * Add test net p2p port: 18333 * Fix/apply requested changes * Update image values and README, add default helmignore * Fix typo
This commit is contained in:
committed by
k8s-ci-robot
parent
6b277a2200
commit
cd560e4f44
@@ -0,0 +1,21 @@
|
||||
# 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
|
||||
@@ -0,0 +1,21 @@
|
||||
apiVersion: v1
|
||||
name: bitcoind
|
||||
version: 0.1.0
|
||||
appVersion: "0.15.1"
|
||||
description: Bitcoin is an innovative payment network and a new kind of money.
|
||||
keywords:
|
||||
- bitcoind
|
||||
- cryptocurrency
|
||||
- blockchain
|
||||
home: https://bitcoin.org/
|
||||
icon: https://bitcoin.org/img/icons/logotop.svg
|
||||
sources:
|
||||
- https://github.com/kubernetes/charts
|
||||
- https://github.com/kuberstack/bitcoind
|
||||
- https://github.com/kylemanna/docker-bitcoind
|
||||
maintainers:
|
||||
- name: daniel-yavorovich
|
||||
email: daniel@arilot.com
|
||||
- name: govale
|
||||
email: shiyanval@gmail.com
|
||||
engine: gotpl
|
||||
@@ -0,0 +1,91 @@
|
||||
# Bitcoind
|
||||
|
||||
[Bitcoin](https://bitcoin.org/) uses peer-to-peer technology to operate with no central authority or banks;
|
||||
managing transactions and the issuing of bitcoins is carried out collectively by the network.
|
||||
|
||||
## Introduction
|
||||
|
||||
This chart bootstraps a single node Bitcoin deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
|
||||
Docker image was taken from [Bitcoind for Docker](https://github.com/kylemanna/docker-bitcoind) - many thanks!
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Kubernetes 1.8+
|
||||
- PV provisioner support in the underlying infrastructure
|
||||
|
||||
## Installing the Chart
|
||||
|
||||
To install the chart with the release name `my-release`:
|
||||
|
||||
```bash
|
||||
$ helm install --name my-release stable/bitcoind
|
||||
```
|
||||
|
||||
The command deploys bitcoind on the Kubernetes cluster in the default configuration.
|
||||
The [configuration](#configuration) 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:
|
||||
|
||||
```bash
|
||||
$ helm delete my-release
|
||||
```
|
||||
|
||||
The command removes all the Kubernetes components associated with the chart and deletes the release.
|
||||
|
||||
## Configuration
|
||||
|
||||
The following tables lists the configurable parameters of the bitcoind chart and their default values.
|
||||
|
||||
Parameter | Description | Default
|
||||
----------------------- | ---------------------------------- | ----------------------------------------------------------
|
||||
`image.repository` | Image source repository name | `kuberstack/bitcoind`
|
||||
`image.tag` | `bitcoind` release tag. | `0.15.1`
|
||||
`image.pullPolicy` | Image pull policy | `IfNotPresent`
|
||||
`service.rpcPort` | RPC port | `8332`
|
||||
`service.p2pPort` | P2P port | `8333`
|
||||
`service.testnetPort` | Testnet port | `18332`
|
||||
`service.testnetP2pPort` | Testnet p2p ports | `18333`
|
||||
`service.selector` | Node selector | `tx-broadcast-svc`
|
||||
`persistence.enabled` | Create a volume to store data | `true`
|
||||
`persistence.accessMode` | ReadWriteOnce or ReadOnly | `ReadWriteOnce`
|
||||
`persistence.size` | Size of persistent volume claim | `300Gi`
|
||||
`resources` | CPU/Memory resource requests/limits| `{}`
|
||||
`configurationFile` | Config file ConfigMap entry |
|
||||
|
||||
For more information about Bitcoin configuration please see [Bitcoin.conf_Configuration_File](https://en.bitcoin.it/wiki/Running_Bitcoin#Bitcoin.conf_Configuration_File).
|
||||
|
||||
Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,
|
||||
|
||||
```bash
|
||||
$ helm install --name my-release -f values.yaml stable/bitcoind
|
||||
```
|
||||
|
||||
> **Tip**: You can use the default [values.yaml](values.yaml)
|
||||
|
||||
## Persistence
|
||||
|
||||
The bitcoind image stores the Bitcoind node data (Blockchain and wallet) and configurations at the `/bitcoin` path of the container.
|
||||
|
||||
By default a PersistentVolumeClaim is created and mounted into that directory. In order to disable this functionality
|
||||
you can change the values.yaml to disable persistence and use an emptyDir instead.
|
||||
|
||||
> *"An emptyDir volume is first created when a Pod is assigned to a Node, and exists as long as that Pod is running on that node. When a Pod is removed from a node for any reason, the data in the emptyDir is deleted forever."*
|
||||
|
||||
!!! WARNING !!!
|
||||
|
||||
Please NOT use emptyDir for production cluster! Your wallets will be lost on container restart!
|
||||
|
||||
## Customize bitcoind configuration file
|
||||
|
||||
```yaml
|
||||
configurationFile:
|
||||
bitcoind.conf: |-
|
||||
server=1
|
||||
printtoconsole=1
|
||||
rpcuser=rpcuser
|
||||
rpcpassword=rpcpassword
|
||||
```
|
||||
@@ -0,0 +1,12 @@
|
||||
bitcoind RPC can be accessed via port {{ .Values.service.rpcPort }} on the following DNS name from within your cluster:
|
||||
{{ template "bitcoind.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local
|
||||
|
||||
To connect to bitcoind RPC:
|
||||
|
||||
1. Forward the port for the node:
|
||||
|
||||
$ kubectl port-forward --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "bitcoind.name" . }},release={{ .Release.Name }}" -o jsonpath="{ .items[0].metadata.name }") {{ .Values.service.rpcPort }}
|
||||
|
||||
2. Test connection with user and password provided in configuration file:
|
||||
|
||||
$ curl --user rpcuser:rpcpassword -k http://127.0.0.1:{{ .Values.service.rpcPort }} --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getinfo", "params": [] }' -H 'content-type: text/plain;'
|
||||
@@ -0,0 +1,32 @@
|
||||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "bitcoind.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 "bitcoind.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 "bitcoind.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ template "bitcoind.fullname" . }}
|
||||
labels:
|
||||
app: {{ template "bitcoind.name" . }}
|
||||
chart: {{ template "bitcoind.chart" . }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
data:
|
||||
{{ toYaml .Values.configurationFile | indent 2 }}
|
||||
@@ -0,0 +1,56 @@
|
||||
apiVersion: apps/v1beta2
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ template "bitcoind.fullname" . }}
|
||||
labels:
|
||||
app: {{ template "bitcoind.name" . }}
|
||||
chart: {{ template "bitcoind.chart" . }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ template "bitcoind.name" . }}
|
||||
release: {{ .Release.Name }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ template "bitcoind.name" . }}
|
||||
release: {{ .Release.Name }}
|
||||
spec:
|
||||
containers:
|
||||
- name: {{ template "bitcoind.fullname" . }}
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
|
||||
resources:
|
||||
{{ toYaml .Values.resources | indent 10 }}
|
||||
ports:
|
||||
- name: rpc
|
||||
containerPort: {{ .Values.service.rpcPort }}
|
||||
- name: p2p
|
||||
containerPort: {{ .Values.service.p2pPort }}
|
||||
- name: testnet
|
||||
containerPort: {{ .Values.service.testnetPort }}
|
||||
- name: testnetp2pport
|
||||
containerPort: {{ .Values.service.testnetP2pPort }}
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /bitcoin
|
||||
{{- if .Values.configurationFile }}
|
||||
- name: config
|
||||
mountPath: /bitcoin/.bitcoin/bitcoin.conf
|
||||
subPath: bitcoin.conf
|
||||
{{- end }}
|
||||
volumes:
|
||||
{{- if .Values.configurationFile }}
|
||||
- name: config
|
||||
configMap:
|
||||
name: {{ template "bitcoind.fullname" . }}
|
||||
{{- end }}
|
||||
- name: data
|
||||
{{- if .Values.persistence.enabled }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ .Values.persistence.existingClaim | default (include "bitcoind.fullname" .) }}
|
||||
{{- else }}
|
||||
emptyDir: {}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,26 @@
|
||||
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: {{ template "bitcoind.fullname" . }}
|
||||
annotations:
|
||||
"helm.sh/resource-policy": keep
|
||||
labels:
|
||||
app: {{ template "bitcoind.name" . }}
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
release: "{{ .Release.Name }}"
|
||||
heritage: "{{ .Release.Service }}"
|
||||
spec:
|
||||
accessModes:
|
||||
- {{ .Values.persistence.accessMode | quote }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.persistence.size | quote }}
|
||||
{{- if .Values.persistence.storageClass }}
|
||||
{{- if (eq "-" .Values.persistence.storageClass) }}
|
||||
storageClassName: ""
|
||||
{{- else }}
|
||||
storageClassName: "{{ .Values.persistence.storageClass }}"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,25 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ template "bitcoind.fullname" . }}
|
||||
labels:
|
||||
app: {{ template "bitcoind.name" . }}
|
||||
chart: {{ template "bitcoind.chart" . }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
spec:
|
||||
ports:
|
||||
- name: rpc
|
||||
port: {{ .Values.service.rpcPort }}
|
||||
targetPort: rpc
|
||||
- name: p2p
|
||||
port: {{ .Values.service.p2pPort }}
|
||||
targetPort: p2p
|
||||
- name: testnet
|
||||
port: {{ .Values.service.testnetPort }}
|
||||
- name: testnet-p2p
|
||||
port: {{ .Values.service.testnetP2pPort }}
|
||||
selector:
|
||||
app: {{ template "bitcoind.name" . }}
|
||||
release: {{ .Release.Name }}
|
||||
bitcoind-rotation: {{ .Values.service.selector }}
|
||||
@@ -0,0 +1,44 @@
|
||||
# Default values for bitcoind.
|
||||
# This is a YAML-formatted file.
|
||||
# Declare variables to be passed into your templates.
|
||||
|
||||
image:
|
||||
repository: kuberstack/bitcoind
|
||||
tag: 0.15.1
|
||||
pullPolicy: IfNotPresent
|
||||
|
||||
service:
|
||||
rpcPort: 8332
|
||||
p2pPort: 8333
|
||||
testnetPort: 18332
|
||||
testnetP2pPort: 18333
|
||||
selector: tx-broadcast-svc
|
||||
|
||||
persistence:
|
||||
enabled: true
|
||||
## database data Persistent Volume Storage Class
|
||||
## If defined, storageClassName: <storageClass>
|
||||
## If set to "-", storageClassName: "", which disables dynamic provisioning
|
||||
## If undefined (the default) or set to null, no storageClassName spec is
|
||||
## set, choosing the default provisioner. (gp2 on AWS, standard on
|
||||
## GKE, AWS & OpenStack)
|
||||
##
|
||||
# storageClass: "-"
|
||||
accessMode: ReadWriteOnce
|
||||
size: 300Gi
|
||||
|
||||
## Configure resource requests and limits
|
||||
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
|
||||
##
|
||||
resources: {}
|
||||
# requests:
|
||||
# memory: 512Mi
|
||||
# cpu: 300m
|
||||
|
||||
# Custom bitcoind configuration file used to override default bitcoind settings
|
||||
configurationFile:
|
||||
bitcoin.conf: |-
|
||||
server=1
|
||||
printtoconsole=1
|
||||
rpcuser=rpcuser
|
||||
rpcpassword=rpcpassword
|
||||
Reference in New Issue
Block a user