-
Notifications
You must be signed in to change notification settings - Fork 52
Restore LN functionality with helm #664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
5112e03
BREAKING REFACTOR: move some values to global, add lnd as subchart
pinheadmz 89009bf
store channel data from network.yaml in configmaps to open channels
pinheadmz df70c2a
import LN json
pinheadmz c38d7dc
ln: same macaroon and cert for all nodes
pinheadmz 0843703
ln: open rest api and ensure scenarios can open channels
pinheadmz bdf6fdb
use k8s client in commander to get pods instead of warnet.json
pinheadmz 10f6ae2
namespaces: give wargames accounts auth to create commander roles
pinheadmz c3530f9
add ln nodes and channels along with tanks to commander
pinheadmz 731c53d
minor: lint and remove duplicate config maps
pinheadmz 6dc4024
update namespace permissions
mplsgrant fe1c2ee
lnd: slow down startup probe to create wallet
pinheadmz 5e69110
Move LND out of commander and refactor ln_init for new architecture
pinheadmz 9209a5e
test LN
pinheadmz acac14b
make ln_init part of deploy() if ln channels are defined
pinheadmz e7c1628
allow undefined channel policy
pinheadmz c18298d
lint
pinheadmz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
apiVersion: v2 | ||
name: lnd | ||
|
||
description: A Helm chart for LND | ||
|
||
# A chart can be either an 'application' or a 'library' chart. | ||
# | ||
# Application charts are a collection of templates that can be packaged into versioned archives | ||
# to be deployed. | ||
# | ||
# Library charts provide useful utilities or functions for the chart developer. They're included as | ||
# a dependency of application charts to inject those utilities and functions into the rendering | ||
# pipeline. Library charts do not define any templates and therefore cannot be deployed. | ||
type: application | ||
|
||
# This is the chart version. This version number should be incremented each time you make changes | ||
# to the chart and its templates, including the app version. | ||
# Versions are expected to follow Semantic Versioning (https://semver.org/) | ||
version: 0.1.0 | ||
|
||
# This is the version number of the application being deployed. This version number should be | ||
# incremented each time you make changes to the application. Versions are not expected to | ||
# follow Semantic Versioning. They should reflect the version the application is using. | ||
# It is recommended to use it with quotes. | ||
appVersion: 0.1.0 |
78 changes: 78 additions & 0 deletions
78
resources/charts/bitcoincore/charts/lnd/templates/_helpers.tpl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
{{/* | ||
Expand the name of the PARENT chart. | ||
*/}} | ||
{{- define "bitcoincore.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create a default fully qualified PARENT 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 "bitcoincore.fullname" -}} | ||
{{- if .Values.fullnameOverride }} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- printf "%s" .Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
|
||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "lnd.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}-ln | ||
{{- 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 "lnd.fullname" -}} | ||
{{- if .Values.fullnameOverride }} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- printf "%s" .Release.Name | trunc 63 | trimSuffix "-" }}-ln | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "lnd.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "lnd.labels" -}} | ||
helm.sh/chart: {{ include "lnd.chart" . }} | ||
{{ include "lnd.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "lnd.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "lnd.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "lnd.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "lnd.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} |
52 changes: 52 additions & 0 deletions
52
resources/charts/bitcoincore/charts/lnd/templates/configmap.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ include "lnd.fullname" . }} | ||
labels: | ||
{{- include "lnd.labels" . | nindent 4 }} | ||
data: | ||
lnd.conf: | | ||
{{- .Values.baseConfig | nindent 4 }} | ||
{{- .Values.defaultConfig | nindent 4 }} | ||
{{- .Values.config | nindent 4 }} | ||
bitcoin.{{ .Values.global.chain }}=1 | ||
bitcoind.rpcpass={{ .Values.global.rpcpassword }} | ||
bitcoind.rpchost={{ include "bitcoincore.fullname" . }}:{{ index .Values.global .Values.global.chain "RPCPort" }} | ||
bitcoind.zmqpubrawblock=tcp://{{ include "bitcoincore.fullname" . }}:{{ .Values.global.ZMQBlockPort }} | ||
bitcoind.zmqpubrawtx=tcp://{{ include "bitcoincore.fullname" . }}:{{ .Values.global.ZMQTxPort }} | ||
alias={{ include "lnd.fullname" . }} | ||
externalhosts={{ include "lnd.fullname" . }} | ||
tlsextradomain={{ include "lnd.fullname" . }} | ||
tls.cert: | | ||
-----BEGIN CERTIFICATE----- | ||
MIIB8TCCAZagAwIBAgIUJDsR6mmY+TaO9pCfjtotlbOkzJMwCgYIKoZIzj0EAwIw | ||
MjEfMB0GA1UECgwWbG5kIGF1dG9nZW5lcmF0ZWQgY2VydDEPMA0GA1UEAwwGd2Fy | ||
bmV0MB4XDTI0MTExMTE2NTM1MFoXDTM0MTEwOTE2NTM1MFowMjEfMB0GA1UECgwW | ||
bG5kIGF1dG9nZW5lcmF0ZWQgY2VydDEPMA0GA1UEAwwGd2FybmV0MFkwEwYHKoZI | ||
zj0CAQYIKoZIzj0DAQcDQgAEBVltIvaTlAQI/3FFatTqVflZuZdRJ0SmRMSJrFLP | ||
tp0fxE7hmteSt6gjQriy90fP8j9OJXBNAjt915kLY4zVvqOBiTCBhjAOBgNVHQ8B | ||
Af8EBAMCAqQwEwYDVR0lBAwwCgYIKwYBBQUHAwEwDwYDVR0TAQH/BAUwAwEB/zAd | ||
BgNVHQ4EFgQU5d8QMrwhLgTkDjWA+eXZGz+dybUwLwYDVR0RBCgwJoIJbG9jYWxo | ||
b3N0ggEqhwR/AAABhxAAAAAAAAAAAAAAAAAAAAABMAoGCCqGSM49BAMCA0kAMEYC | ||
IQDPofN0fEl5gTwCYhk3nZbjMqJhZ8BsSJ6K8XRhxr7zbwIhAPsgQCFOqUWg632O | ||
NEO53OQ6CIqnpxSskjsFNH4ZBQOE | ||
-----END CERTIFICATE----- | ||
tls.key: | | ||
-----BEGIN EC PRIVATE KEY----- | ||
MHcCAQEEIIcFtWTLQv5JaRRxdkPKkO98OrvgeztbZ7h8Ev/4UbE4oAoGCCqGSM49 | ||
AwEHoUQDQgAEBVltIvaTlAQI/3FFatTqVflZuZdRJ0SmRMSJrFLPtp0fxE7hmteS | ||
t6gjQriy90fP8j9OJXBNAjt915kLY4zVvg== | ||
-----END EC PRIVATE KEY----- | ||
|
||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ include "lnd.fullname" . }}-channels | ||
labels: | ||
channels: "true" | ||
{{- include "lnd.labels" . | nindent 4 }} | ||
data: | ||
source: {{ include "lnd.fullname" . }} | ||
channels: | | ||
{{ .Values.channels | toJson }} |
82 changes: 82 additions & 0 deletions
82
resources/charts/bitcoincore/charts/lnd/templates/pod.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: {{ include "lnd.fullname" . }} | ||
labels: | ||
{{- include "lnd.labels" . | nindent 4 }} | ||
{{- with .Values.podLabels }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
app: {{ include "lnd.fullname" . }} | ||
{{- if .Values.collectLogs }} | ||
collect_logs: "true" | ||
{{- end }} | ||
chain: {{ .Values.global.chain }} | ||
spec: | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
securityContext: | ||
{{- toYaml .Values.podSecurityContext | nindent 4 }} | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
securityContext: | ||
{{- toYaml .Values.securityContext | nindent 8 }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
ports: | ||
- name: rpc | ||
containerPort: {{ .Values.RPCPort }} | ||
protocol: TCP | ||
- name: p2p | ||
containerPort: {{ .Values.P2PPort }} | ||
protocol: TCP | ||
- name: rest | ||
containerPort: {{ .Values.RestPort }} | ||
protocol: TCP | ||
livenessProbe: | ||
{{- toYaml .Values.livenessProbe | nindent 8 }} | ||
readinessProbe: | ||
{{- toYaml .Values.readinessProbe | nindent 8 }} | ||
startupProbe: | ||
{{- toYaml .Values.startupProbe | nindent 8 }} | ||
resources: | ||
{{- toYaml .Values.resources | nindent 8 }} | ||
volumeMounts: | ||
{{- with .Values.volumeMounts }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
- mountPath: /root/.lnd/lnd.conf | ||
name: config | ||
subPath: lnd.conf | ||
- mountPath: /root/.lnd/tls.key | ||
name: config | ||
subPath: tls.key | ||
- mountPath: /root/.lnd/tls.cert | ||
name: config | ||
subPath: tls.cert | ||
{{- if .Values.circuitBreaker }} | ||
- name: circuitbreaker | ||
image: pinheadmz/circuitbreaker:278737d | ||
imagePullPolicy: IfNotPresent | ||
{{- end}} | ||
volumes: | ||
{{- with .Values.volumes }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
- configMap: | ||
name: {{ include "lnd.fullname" . }} | ||
name: config | ||
{{- with .Values.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with .Values.affinity }} | ||
affinity: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with .Values.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} |
24 changes: 24 additions & 0 deletions
24
resources/charts/bitcoincore/charts/lnd/templates/service.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "lnd.fullname" . }} | ||
labels: | ||
{{- include "lnd.labels" . | nindent 4 }} | ||
app: {{ include "lnd.fullname" . }} | ||
spec: | ||
type: {{ .Values.service.type }} | ||
ports: | ||
- port: {{ .Values.RPCPort }} | ||
targetPort: rpc | ||
protocol: TCP | ||
name: rpc | ||
- port: {{ .Values.P2PPort }} | ||
targetPort: p2p | ||
protocol: TCP | ||
name: p2p | ||
- port: {{ .Values.RestPort }} | ||
targetPort: rest | ||
protocol: TCP | ||
name: rest | ||
selector: | ||
{{- include "lnd.selectorLabels" . | nindent 4 }} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the plan to have this removed before this PR is merged? Or shortly after? Circuit breaker feels like a
serviceplugin.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, this is leftover from Italy. ill need circuit breaker together with simln eventually either in this PR or a follow up, so this'll get cleaned up before merge