diff --git a/charts/strfry/Chart.yaml b/charts/strfry/Chart.yaml index 68285b0e..c065f99f 100644 --- a/charts/strfry/Chart.yaml +++ b/charts/strfry/Chart.yaml @@ -15,7 +15,7 @@ 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.3 +version: 1.0.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 diff --git a/charts/strfry/templates/configmap.yml b/charts/strfry/templates/configmap.yml index 875d0fc3..78cd055c 100644 --- a/charts/strfry/templates/configmap.yml +++ b/charts/strfry/templates/configmap.yml @@ -60,16 +60,16 @@ data: info { # NIP-11: Name of this server. Short/descriptive (< 30 characters) - name = "Flash Relay" + name = {{ .Values.strfry.nip11.name | quote }} # NIP-11: Detailed information about relay, free-form - description = "For enhancing the payment experience for Flash users with other Lightning users.This relay is meant to serve the Flash application and it's users. Unrelated notes may not be persisted or relayed." + description = {{ .Values.strfry.nip11.description | quote }} # NIP-11: Administrative nostr pubkey, for contact purposes - pubkey = "" + pubkey = {{ .Values.strfry.nip11.pubkey | quote }} # NIP-11: Alternative administrative contact (email, website, etc) - contact = "" + contact = {{ .Values.strfry.nip11.contact | quote }} } # Maximum accepted incoming websocket frame size (should be larger than max event) (restart required) @@ -92,7 +92,7 @@ data: writePolicy { # If non-empty, path to an executable script that implements the writePolicy plugin logic - plugin = "/app/whitelist.js" + plugin = {{ .Values.strfry.writePolicy.plugin | quote }} } compression { diff --git a/charts/strfry/templates/deployment.yaml b/charts/strfry/templates/deployment.yaml index dd801a8a..af8da607 100644 --- a/charts/strfry/templates/deployment.yaml +++ b/charts/strfry/templates/deployment.yaml @@ -25,24 +25,35 @@ spec: - name: strfry-conf mountPath: /etc/strfry.conf subPath: strfry.conf + {{- if .Values.vector.enabled }} - name: strfry-logs mountPath: /app/logs + {{- end }} + {{- if .Values.vector.enabled }} - name: vector image: timberio/vector:0.34.X-debian env: - name: VECTOR_CONFIG value: /etc/vector/vector.toml + {{- if .Values.vector.sinks.honeycomb.apiKey }} + - name: HONEYCOMB_API_KEY + valueFrom: + secretKeyRef: + name: {{ include "strfry.fullname" . }}-honeycomb + key: apiKey + {{- end }} resources: limits: memory: 100Mi cpu: 100m volumeMounts: - name: strfry-logs - mountPath: /app/logs # changed from /logs to /app/logs + mountPath: /app/logs - name: vector-config mountPath: /etc/vector readOnly: true + {{- end }} volumes: - name: strfry-db @@ -51,8 +62,10 @@ spec: - name: strfry-conf configMap: name: {{ include "strfry.fullname" . }}-configmap + {{- if .Values.vector.enabled }} - name: strfry-logs emptyDir: {} - name: vector-config configMap: name: vector-config + {{- end }} diff --git a/charts/strfry/templates/secrets.yaml b/charts/strfry/templates/secrets.yaml new file mode 100644 index 00000000..6dce25b5 --- /dev/null +++ b/charts/strfry/templates/secrets.yaml @@ -0,0 +1,9 @@ +{{- if and .Values.vector.enabled .Values.vector.sinks.honeycomb.apiKey }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "strfry.fullname" . }}-honeycomb +type: Opaque +data: + apiKey: {{ .Values.vector.sinks.honeycomb.apiKey | b64enc | quote }} +{{- end }} diff --git a/charts/strfry/templates/vector-configmap.yml b/charts/strfry/templates/vector-configmap.yml index b81ec3b8..2a3e6131 100644 --- a/charts/strfry/templates/vector-configmap.yml +++ b/charts/strfry/templates/vector-configmap.yml @@ -1,3 +1,4 @@ +{{- if .Values.vector.enabled }} apiVersion: v1 kind: ConfigMap metadata: @@ -39,11 +40,14 @@ data: . = encode_json(event) ''' + {{- if .Values.vector.sinks.console.enabled }} [sinks.console] type = "console" inputs = ["format_event"] encoding.codec = "text" + {{- end }} + {{- if .Values.vector.sinks.honeycomb.apiKey }} [sinks.honeycomb_raw] type = "http" inputs = ["format_event"] @@ -56,6 +60,8 @@ data: batch.timeout_secs = 1 [sinks.honeycomb_raw.request] - headers.X-Honeycomb-Team = "{{ .Values.honeycomb.apiKey }}" + headers.X-Honeycomb-Team = "${HONEYCOMB_API_KEY}" headers.Content-Type = "application/json" timeout_secs = 30 + {{- end }} +{{- end }} diff --git a/charts/strfry/values.yaml b/charts/strfry/values.yaml index 0af43a98..dcb7559e 100644 --- a/charts/strfry/values.yaml +++ b/charts/strfry/values.yaml @@ -1,15 +1,11 @@ -# Default values for strfry-chart. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 1 - image: - repository: lnflash/strfry-custom - tag: latest - digest: e433d1ac4cc23a4e9a40ef97bcb2d5477b42bea99694d0ef5f08b2f6f4facfcd + repository: dockurr/strfry + tag: 1.0.4 + digest: df140472554e5a0b5bbe08ec417805d283098621833e44827d8018c98b74243d pullPolicy: IfNotPresent +replicaCount: 1 + persistence: enabled: true size: 1Gi @@ -21,6 +17,22 @@ fullnameOverride: "" strfry: name: "strfry" fullname: "strfry-chart" + nip11: + name: "" + description: "" + pubkey: "" + contact: "" + writePolicy: + plugin: "" # path to write policy plugin script; empty disables + +# vector: sidecar log shipper for strfry. Disabled by default. +vector: + enabled: false + sinks: + console: + enabled: true # emit filtered errors to stdout + honeycomb: + apiKey: "" # set to enable Honeycomb shipping serviceAccount: # Specifies whether a service account should be created