Skip to content

Commit 4b22b50

Browse files
authored
feature: adding lightening service to helm chart (#107)
* feature: adding lightening service to helm chart * update chart version * fixing lightening deployment * add security context * set user to 1000 in security context, need to test * update chart version again * fix indentation in lightening service template * fix indentation * fix double -- on lightening deployment * fix spelling of lightning and remove args * remove unused args * make other ports dynamic * fix ports in lightening deployment * add LIGHTNING_URL to config
1 parent 30ea8c8 commit 4b22b50

File tree

6 files changed

+204
-2
lines changed

6 files changed

+204
-2
lines changed

charts/multiwoven/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ description: |
44
Multiwoven is an open-source reverse ETL tool, offering an alternative to qHightouch, Census, and similar platforms. 🔥
55
# kubeVersion: ">=1.16.0"
66
type: application
7-
version: 0.69.0
8-
appVersion: "0.69.0"
7+
version: 0.71.0
8+
appVersion: "0.71.0"
99
home: https://github.com/Multiwoven/multiwoven
1010
sources:
1111
- https://docs.squared.ai/open-source/guides/setup/helm
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{{- if .Values.lightning.enabled }}
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
name: {{ include "chart.fullname" . }}-lightning
6+
namespace: {{ .Values.kubernetesNamespace }}
7+
labels:
8+
io.kompose.service: {{ include "chart.fullname" . }}-lightning
9+
{{- include "chart.labels" . | nindent 4 }}
10+
annotations:
11+
{{- with .Values.lightning.annotations }}
12+
{{- toYaml . | nindent 4 }}
13+
{{- end }}
14+
spec:
15+
replicas: {{ .Values.lightning.replicas }}
16+
selector:
17+
matchLabels:
18+
io.kompose.service: {{ include "chart.fullname" . }}-lightning
19+
{{- include "chart.selectorLabels" . | nindent 6 }}
20+
template:
21+
metadata:
22+
labels:
23+
io.kompose.network/multiwoven-server-default: "true"
24+
io.kompose.service: {{ include "chart.fullname" . }}-lightning
25+
{{- include "chart.selectorLabels" . | nindent 8 }}
26+
annotations:
27+
{{- with .Values.lightning.annotations }}
28+
{{- toYaml . | nindent 8 }}
29+
{{- end }}
30+
spec:
31+
containers:
32+
- env:
33+
- name: VERSION
34+
value: {{ .Values.lightningConfig.version | quote}}
35+
- name: HF_TOKEN
36+
value: {{ .Values.lightningConfig.hfToken | quote }}
37+
- name: HUGGINGFACE_BILLING_ACCOUNT
38+
value: {{ .Values.lightningConfig.hfBillingAccount | quote }}
39+
- name: NANONETS_API_KEY
40+
value: {{ .Values.lightningConfig.nanonetsApiKey | quote }}
41+
- name: PORT
42+
value: {{ (index .Values.lightning.ports 0).port | quote }}
43+
image: {{ .Values.lightning.lightning.image.repository }}:{{ .Values.lightning.lightning.image.tag | default .Chart.AppVersion }}
44+
securityContext:
45+
runAsUser: {{ .Values.lightning.lightning.containerSecurityContext.runAsUser }}
46+
runAsGroup: {{ .Values.lightning.lightning.containerSecurityContext.runAsGroup }}
47+
privileged: false
48+
allowPrivilegeEscalation: {{ .Values.securityContext.allowPrivilegeEscalation }}
49+
readOnlyRootFilesystem: {{ .Values.securityContext.readOnlyRootFilesystem }}
50+
capabilities:
51+
drop:
52+
{{- if .Values.securityContext.capabilities.drop.permissions }}
53+
{{- range .Values.securityContext.capabilities.drop.permissions }}
54+
- {{ . }}
55+
{{- end }}
56+
{{- end }}
57+
livenessProbe:
58+
initialDelaySeconds: 30
59+
periodSeconds: 10
60+
tcpSocket:
61+
port: {{ (index .Values.lightning.ports 0).port }}
62+
name: {{ include "chart.fullname" . }}-lightning
63+
ports:
64+
- containerPort: {{ (index .Values.lightning.ports 0).port }}
65+
readinessProbe:
66+
initialDelaySeconds: 5
67+
periodSeconds: 10
68+
tcpSocket:
69+
port: {{ (index .Values.lightning.ports 0).port }}
70+
resources: {{- toYaml .Values.lightning.lightning.resources | nindent 10 }}
71+
restartPolicy: Always
72+
{{ if .Values.multiwovenConfig.privateRepo }}
73+
imagePullSecrets:
74+
- name: {{ .Values.multiwovenConfig.registrySecretName }}
75+
{{ end }}
76+
{{ end }}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{{ if and .Values.hpa.enabled .Values.lightning.enabled }}
2+
apiVersion: autoscaling/v2
3+
kind: HorizontalPodAutoscaler
4+
metadata:
5+
name: {{ include "chart.fullname" . }}-lightning-hpa
6+
namespace: {{ .Values.kubernetesNamespace }}
7+
labels:
8+
{{- include "chart.labels" . | nindent 4 }}
9+
app.kubernetes.io/component: lightning-hpa
10+
spec:
11+
scaleTargetRef:
12+
apiVersion: apps/v1
13+
kind: Deployment
14+
name: {{ include "chart.fullname" . }}-lightning
15+
minReplicas: {{ .Values.hpa.lightning.minReplicas }}
16+
maxReplicas: {{ .Values.hpa.lightning.maxReplicas }}
17+
behavior:
18+
scaleDown:
19+
stabilizationWindowSeconds: {{ .Values.hpa.lightning.behavior.scaleDown.stabilizationWindowSeconds }}
20+
policies:
21+
- type: {{ .Values.hpa.lightning.behavior.scaleDown.policies.percentPolicy.type }}
22+
value: {{ .Values.hpa.lightning.behavior.scaleDown.policies.percentPolicy.value }}
23+
periodSeconds: {{ .Values.hpa.lightning.behavior.scaleDown.policies.percentPolicy.periodSeconds }}
24+
scaleUp:
25+
stabilizationWindowSeconds: {{ .Values.hpa.lightning.behavior.scaleUp.stabilizationWindowSeconds }}
26+
policies:
27+
- type: {{ .Values.hpa.lightning.behavior.scaleUp.policies.percentPolicy.type }}
28+
value: {{ .Values.hpa.lightning.behavior.scaleUp.policies.percentPolicy.value }}
29+
periodSeconds: {{ .Values.hpa.lightning.behavior.scaleUp.policies.percentPolicy.periodSeconds }}
30+
- type: {{ .Values.hpa.lightning.behavior.scaleUp.policies.podPolicy.type }}
31+
value: {{ .Values.hpa.lightning.behavior.scaleUp.policies.podPolicy.value }}
32+
periodSeconds: {{ .Values.hpa.lightning.behavior.scaleUp.policies.podPolicy.periodSeconds }}
33+
selectPolicy: {{ .Values.hpa.lightning.behavior.scaleUp.policies.selectPolicy }}
34+
metrics:
35+
- type: Resource
36+
resource:
37+
name: cpu
38+
target:
39+
type: Utilization
40+
averageUtilization: {{ .Values.hpa.lightning.cpuAverageUtilizationPercentageThreshold }}
41+
- type: Resource
42+
resource:
43+
name: memory
44+
target:
45+
type: Utilization
46+
averageUtilization: {{ .Values.hpa.lightning.memoryAverageUtilizationPercentageThreshold }}
47+
{{ end }}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{{- if .Values.lightning.enabled }}
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
name: {{ include "chart.fullname" . }}-lightning
6+
namespace: {{ .Values.kubernetesNamespace }}
7+
labels:
8+
{{- include "chart.labels" . | nindent 4 }}
9+
spec:
10+
type: {{ .Values.lightning.type }}
11+
selector:
12+
io.kompose.service: {{ include "chart.fullname" . }}-lightning
13+
{{- include "chart.selectorLabels" . | nindent 4 }}
14+
ports:
15+
{{- toYaml .Values.lightning.ports | nindent 4 }}
16+
{{- end }}

charts/multiwoven/templates/multiwoven-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ data:
3838
HUBSPOT_API_KEY: {{ .Values.multiwovenConfig.hubspotApiKey | quote }}
3939
JWT_SECRET: {{ .Values.multiwovenConfig.jwtSecret | quote }}
4040
LEAD_CAPTURE_ENABLED: {{ .Values.multiwovenConfig.leadCaptureEnabled | quote }}
41+
LIGHTNING_URL: {{ .Values.lightningConfig.lightningUrl | quote }}
4142
NEW_RELIC_KEY: {{ .Values.multiwovenConfig.newRelicKey | quote }}
4243
RAILS_ENV: {{ .Values.multiwovenConfig.railsEnv | quote }}
4344
RAILS_LOG_LEVEL: {{ .Values.multiwovenConfig.railsLogLevel | quote }}

charts/multiwoven/values.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@ multiwovenConfig:
9595

9696
workerHost: worker.multiwoven.com
9797

98+
lightningConfig:
99+
version: ""
100+
hfToken: ""
101+
hfBillingAccount: ""
102+
lightningUrl: http://multiwoven-lightning:6000
103+
nanonetsApiKey: ""
104+
98105
automountServiceAccountToken:
99106
enabled: true
100107

@@ -288,6 +295,36 @@ hpa:
288295
value: 4
289296
periodSeconds: 15
290297
selectPolicy: Max
298+
lightning:
299+
minReplicas: 1
300+
maxReplicas: 10
301+
cpuAverageUtilizationPercentageThreshold: 80
302+
memoryAverageUtilizationPercentageThreshold: 60
303+
behavior:
304+
scaleDown:
305+
stabilizationWindowSeconds: 300
306+
policies:
307+
percentPolicy:
308+
type: Percent
309+
value: 100
310+
periodSeconds: 15
311+
podPolicy:
312+
type: Percent
313+
value: 100
314+
periodSeconds: 15
315+
selectPolicy: Max
316+
scaleUp:
317+
stabilizationWindowSeconds: 45
318+
policies:
319+
percentPolicy:
320+
type: Percent
321+
value: 100
322+
periodSeconds: 15
323+
podPolicy:
324+
type: Pods
325+
value: 4
326+
periodSeconds: 15
327+
selectPolicy: Max
291328

292329
multiwovenPostgresql:
293330
enabled: true
@@ -484,3 +521,28 @@ temporalUi:
484521
cpu: "500m"
485522
memory: "512Mi"
486523
type: ClusterIP
524+
lightning:
525+
enabled: true
526+
annotations: {}
527+
podSecurityContext:
528+
fsGroup: 1000
529+
ports:
530+
- name: "6000"
531+
port: 6000
532+
targetPort: 6000
533+
replicas: 1
534+
lightning:
535+
containerSecurityContext:
536+
runAsUser: 1000
537+
runAsGroup: 1000
538+
image:
539+
repository: multiwoven/lightning
540+
tag: "latest"
541+
resources:
542+
limits:
543+
cpu: "2"
544+
memory: "3Gi"
545+
requests:
546+
cpu: "1"
547+
memory: "1Gi"
548+
type: ClusterIP

0 commit comments

Comments
 (0)