-
Notifications
You must be signed in to change notification settings - Fork 7
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
lotus bundle chart #84
Changes from all commits
a6e5a6a
0821f1e
0662246
7d38159
4f7fa3a
7814e57
8ae0f16
9b98fc4
da43c72
ac35927
14487be
b2e607f
385f595
6eef741
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: v2 | ||
name: lotus-bundle | ||
description: bundle your application with lotus | ||
type: application | ||
version: 0.0.1 | ||
appVersion: 0.0.1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Lotus Bundle | ||
|
||
If you are writing a lotus application, bundle your application with a lotus node. | ||
|
||
|
||
## Default behaviors: | ||
|
||
Lotus will run as a sidecar to your application. You can access lotus at 127.0.0.1:1234. | ||
There is no authentication, and lotus will not be accessible outside of your pod. | ||
|
||
Lotus wallets are managed by kubernetes secrets. Any lotus wallet found in the secret | ||
provided will be imported and available for use by your application. | ||
|
||
TODO: Configure lotus to use a wallet service. | ||
|
||
|
||
## Options: | ||
|
||
lite-mode: Run lotus lite. | ||
lite-backend: if running in lite-mode, use this service backend. By default, api.chain.love. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe add a note that api.chain.love is a lotus-gateway service and has a limited api surface area. |
||
|
||
See values.yaml for examples. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{{ .Values.application.name }} with lotus sidecars | ||
|
||
Release ---------- {{ .Release.Name }} | ||
Namespace -------- {{ .Release.Namespace }} | ||
Application ------ {{ .Values.application.container.image }} | ||
Bundled with ----- {{ .Values.lotus.image }} | ||
|
||
The following following initial wallets will be imported: | ||
|
||
{{ range $wallet := .Values.wallets }} | ||
{{ $wallet.address }} | ||
{{ end }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{{- range $cm := .Values.application.configMaps }} | ||
{{- if not $cm.external }} | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ $.Release.Name }}-{{ $cm.name }} | ||
data: | ||
{{- range $k, $v := .keys }} | ||
{{ $k }}: {{ $v }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{- range $cm := .Values.filebeat.configMaps }} | ||
{{- if not $cm.external }} | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ $.Release.Name }}-{{ $cm.name }} | ||
data: | ||
{{- range $k, $v := .keys }} | ||
{{ $k }}: {{ $v }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{{- if and .Values.filebeat.enabled (not .Values.filebeat.external) }} | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: {{ .Release.Name }}-filebeat-config | ||
data: | ||
filebeat.yaml: {{ .Values.filebeat.config | b64enc }} | ||
{{- end }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{{- if .Values.application.ingress.enabled }} | ||
--- | ||
apiVersion: networking.k8s.io/v1beta1 | ||
kind: Ingress | ||
metadata: | ||
name: {{ .Release.Name }}-{{ .Values.application.name }} | ||
annotations: | ||
kubernetes.io/ingress.class: {{ .Values.application.ingress.class }} | ||
{{- with .Values.application.ingress.annotations }} | ||
{{ toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
rules: | ||
{{- range $rule := .Values.application.ingress.httpRules }} | ||
- host: {{ $rule.host }} | ||
http: | ||
paths: | ||
- path: {{ $rule.path }} | ||
backend: | ||
serviceName: {{ .Release.Name }}-{{ .Values.application.name }} | ||
servicePort: $rule.servicePort | ||
{{- end }} | ||
{{- end }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{{- range $sec := .Values.application.secrets }} | ||
{{- if not $sec.external }} | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: {{ $.Release.Name }}-{{ $sec.name }} | ||
data: | ||
{{- range $k, $v := .keys }} | ||
{{ $k }}: {{ $v | b64enc }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{- if and .Values.filebeat.enabled }} | ||
{{- range $sec := .Values.filebeat.secrets }} | ||
{{- if not $sec.external }} | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: {{ $.Release.Name }}-{{ $sec.name }} | ||
data: | ||
{{- range $k, $v := .keys }} | ||
{{ $k }}: {{ $v | b64enc }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{{- if .Values.prometheus.serviceMonitor }} | ||
--- | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
name: {{ .Release.Name }}-{{ .Values.application.name }} | ||
namespace: {{ .Release.Namespace }} | ||
spec: | ||
namespaceSelector: | ||
matchNames: | ||
- {{ .Release.Namespace }} | ||
selector: | ||
matchLabels: | ||
app: {{ .Values.application.name }} | ||
release: {{ .Release.Name }} | ||
endpoints: | ||
- port: {{ .Values.prometheus.port }} | ||
path: {{ .Values.prometheus.path }} | ||
interval: 30s | ||
{{- end }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wondering if we should include a service monitor for lotus, don't know what it exports in lite mode, but it would help with at least basic go metrics, and would be beneficial when not running in lite mode. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{{ if .Values.application.service.enabled }} | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ .Release.Name }}-{{ .Values.application.name }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
app: {{ .Values.application.name }} | ||
release: {{ .Release.Name }} | ||
{{- with .Values.application.labels }} | ||
{{ toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
type: {{ .Values.application.service.type }} | ||
selector: | ||
app: {{ .Values.application.name }} | ||
release: {{ .Release.Name }} | ||
ports: | ||
{{- with .Values.application.service.ports }} | ||
{{ toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{ end }} |
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.
What do you mean by no authentication? To use any write APIs the user will still need to be able to read the
$LOTUS_PATH/token
, this is required for wallet interaction so I think we will need to find a way to ensure access to the token. On first review I don't see there is any access.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.
This might be as simple as
This would require that the backing volume support multiple readers and I don't remember if this is common or not. This is the same as your shared volume, which is required for this chart at the moment, so it could work. If the share volume ends up being optional and this feature isnt' common we may need to find another approach.
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.
I want to say that because they are in the same pod this isn't an issue, and should just work as long as there is only one writer.
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.
You're right. Adding the lotus-path into the application container as read-only.