Skip to content

Commit 46df2b3

Browse files
authored
Add sh in Dockerfile (#319)
Also remove runAsUser, and separate secret for local and s3 mode for simpler usage in Helm Chart
1 parent ddb8e7e commit 46df2b3

File tree

4 files changed

+29
-4
lines changed

4 files changed

+29
-4
lines changed

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ RUN cargo build --release
2929
FROM gcr.io/distroless/cc-debian11:nonroot
3030

3131
WORKDIR /parseable
32+
33+
COPY --from=busybox:1.35.0-uclibc /bin/sh /bin/sh
3234
COPY --from=builder /parseable/target/release/parseable /usr/bin/parseable
3335

3436
CMD ["parseable"]

helm/templates/deployment.yaml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ spec:
4343
- name: {{ $key }}
4444
value: {{ tpl $value $ | quote }}
4545
{{- end }}
46-
{{- range $secret := .Values.parseable.secrets }}
46+
{{- if .Values.parseable.local }}
47+
{{- range $secret := .Values.parseable.localModeSecret }}
4748
{{- range $key := $secret.keys }}
4849
{{- $envPrefix := $secret.prefix | default "" | upper }}
4950
{{- $envKey := $key | upper | replace "." "_" | replace "-" "_" }}
@@ -54,6 +55,19 @@ spec:
5455
key: {{ $key }}
5556
{{- end }}
5657
{{- end }}
58+
{{- else}}
59+
{{- range $secret := .Values.parseable.s3ModeSecret }}
60+
{{- range $key := $secret.keys }}
61+
{{- $envPrefix := $secret.prefix | default "" | upper }}
62+
{{- $envKey := $key | upper | replace "." "_" | replace "-" "_" }}
63+
- name: {{ $envPrefix }}{{ $envKey }}
64+
valueFrom:
65+
secretKeyRef:
66+
name: {{ $secret.name }}
67+
key: {{ $key }}
68+
{{- end }}
69+
{{- end }}
70+
{{- end }}
5771
ports:
5872
- containerPort: 8000
5973
resources:

helm/values.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,17 @@ parseable:
1515
storageClass: ""
1616
accessMode: ReadWriteOnce
1717
size: 1Gi
18-
secrets:
18+
localModeSecret:
19+
- type: env
20+
name: parseable-env-secret
21+
prefix: P_
22+
keys:
23+
- addr
24+
- username
25+
- password
26+
- staging.dir
27+
- fs.dir
28+
s3ModeSecret:
1929
- type: env
2030
name: parseable-env-secret
2131
prefix: P_
@@ -52,7 +62,6 @@ parseable:
5262
cpu: 500m
5363
memory: 1Gi
5464
securityContext:
55-
runAsUser: 10001
5665
allowPrivilegeEscalation: false
5766
podAnnotations: {}
5867
podSecurityContext: {}

server/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ async fn main() -> anyhow::Result<()> {
105105
_ = &mut localsync_outbox => {
106106
// crash the server if localsync fails for any reason
107107
// panic!("Local Sync thread died. Server will fail now!")
108-
return Err(anyhow::Error::msg("Failed to sync local data to disc. This can happen due to critical error in disc or environment. Please restart the Parseable server.\n\nJoin us on Parseable Slack if the issue persists after restart : https://launchpass.com/parseable"))
108+
return Err(anyhow::Error::msg("Failed to sync local data to drive. Please restart the Parseable server.\n\nJoin us on Parseable Slack if the issue persists after restart : https://launchpass.com/parseable"))
109109
},
110110
_ = &mut remote_sync_outbox => {
111111
// remote_sync failed, this is recoverable by just starting remote_sync thread again

0 commit comments

Comments
 (0)