Skip to content

Add support for K8s TLS terminated reverse-proxy scenarios #8

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions charts/hdx-oss-v2/templates/configmaps/app-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ metadata:
labels:
{{- include "hdx-oss.labels" . | nindent 4 }}
data:
APP_PORT: {{ .Values.hyperdx.appPort | quote }}
API_PORT: {{ .Values.hyperdx.apiPort | quote }}
FRONTEND_URL: "{{ .Values.hyperdx.appUrl }}:{{ .Values.hyperdx.appPort }}"
HYPERDX_API_PORT: "{{ .Values.hyperdx.apiPort }}"
HYPERDX_APP_PORT: "{{ .Values.hyperdx.appPort }}"
HYPERDX_APP_URL: "{{ .Values.hyperdx.appUrl }}"
APP_PORT: {{ .Values.hyperdx.app.port | quote }}
API_PORT: {{ .Values.hyperdx.api.port | quote }}
FRONTEND_URL: "{{ .Values.hyperdx.app.url }}{{if .Values.hyperdx.app.appendPort }}:{{ .Values.hyperdx.app.port }}{{ end }}"
HYPERDX_API_PORT: "{{ .Values.hyperdx.api.port }}"
HYPERDX_APP_PORT: "{{ .Values.hyperdx.app.port }}"
HYPERDX_APP_URL: "{{ .Values.hyperdx.app.url }}"
HYPERDX_LOG_LEVEL: "{{ .Values.hyperdx.logLevel }}"
MINER_API_URL: "http://{{ include "hdx-oss.fullname" . }}-miner:5123"
MONGO_URI: "mongodb://{{ include "hdx-oss.fullname" . }}-mongodb:{{ .Values.mongodb.port }}/hyperdx"
NEXT_PUBLIC_SERVER_URL: "http://localhost:{{ .Values.hyperdx.apiPort }}"
NEXT_PUBLIC_SERVER_URL: "http://localhost:{{ .Values.hyperdx.api.port }}"
OTEL_SERVICE_NAME: "hdx-oss-api"
REDIS_URL: "redis://{{ include "hdx-oss.fullname" . }}-redis:{{ .Values.redis.port }}"
USAGE_STATS_ENABLED: "{{ .Values.hyperdx.usageStatsEnabled | default true }}"
Expand Down
2 changes: 1 addition & 1 deletion charts/hdx-oss-v2/templates/cronjobs/task-checkAlerts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
- name: NODE_ENV
value: "production"
- name: OTEL_SERVICE_NAME
value: "hdx-oss-task-check-alerts"
value: "{{ include "hdx-oss.fullname" . }}-alerts"
resources:
{{- toYaml .Values.tasks.checkAlerts.resources | nindent 16 }}
{{- end }}
20 changes: 17 additions & 3 deletions charts/hdx-oss-v2/templates/hyperdx-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,34 @@ spec:
containers:
- name: app
image: "{{ .Values.hyperdx.image }}"
securityContext:
allowPrivilegeEscalation: {{ .Values.hyperdx.securityContext.allowPrivilegeEscalation | default false }}
appArmorProfile:
type: {{ .Values.hyperdx.securityContext.appArmorProfile.type | default "RuntimeDefault" }}
capabilities:
add: {{ .Values.hyperdx.securityContext.capabilities.add | default "[]" }}
drop: {{ .Values.hyperdx.securityContext.capabilities.drop | default "[]" }}
privileged: {{ .Values.hyperdx.securityContext.privileged | default false }}
readOnlyRootFilesystem: {{ .Values.hyperdx.securityContext.readOnlyRootFilesystem | default false }}
runAsGroup: {{ .Values.hyperdx.securityContext.runAsGroup | default 0 }}
runAsUser: {{ .Values.hyperdx.securityContext.runAsUser | default 0 }}
runAsNonRoot: {{ .Values.hyperdx.securityContext.runAsNonRoot | default false }}
ports:
- name: app-port
containerPort: {{ .Values.hyperdx.appPort }}
containerPort: {{ .Values.hyperdx.app.port }}
- name: api-port
containerPort: {{ .Values.hyperdx.apiPort }}
containerPort: {{ .Values.hyperdx.api.port }}
envFrom:
- configMapRef:
name: {{ include "hdx-oss.fullname" . }}-app-config
env:
{{- if .Values.hyperdx.api.generateKeySecret}}
- name: HYPERDX_API_KEY
valueFrom:
secretKeyRef:
name: {{ include "hdx-oss.fullname" . }}-app-secrets
key: api-key
{{- end }}
{{- with .Values.hyperdx.env }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
7 changes: 5 additions & 2 deletions charts/hdx-oss-v2/templates/hyperdx-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ metadata:
spec:
type: LoadBalancer
ports:
- port: {{ .Values.hyperdx.appPort }}
targetPort: {{ .Values.hyperdx.appPort }}
- port: {{ .Values.hyperdx.app.port }}
targetPort: {{ .Values.hyperdx.app.port }}
name: app
- port: {{ .Values.hyperdx.api.port }}
targetPort: {{ .Values.hyperdx.api.port }}
name: api
selector:
{{- include "hdx-oss.selectorLabels" . | nindent 4 }}
app: {{ include "hdx-oss.fullname" . }}
4 changes: 3 additions & 1 deletion charts/hdx-oss-v2/templates/secrets.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.hyperdx.api.generateKeySecret}}
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -6,7 +7,8 @@ metadata:
{{- include "hdx-oss.labels" . | nindent 4 }}
type: Opaque
data:
api-key: {{ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" | b64enc }}
api-key: {{ .Values.hyperdx.api.key | b64enc }}
{{- end }}
{{- if .Values.clickhouse.enabled }}
---
apiVersion: v1
Expand Down
24 changes: 20 additions & 4 deletions charts/hdx-oss-v2/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,27 @@ global:

hyperdx:
image: "hyperdx/hyperdx:2-beta"
apiKey: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
apiPort: 8000
appPort: 3000
appUrl: "http://localhost"
api:
key: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
port: 8000
generateKeySecret: true # disable to manually create the secret
app:
port: 3000
url: "http://localhost"
appendPort: false # Set to true if you want to append the port to the URL in generated links
logLevel: "info"
securityContext:
allowPrivilegeEscalation:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a default here?

appArmorProfile:
type: "RuntimeDefault" # Set to "RuntimeDefault" for AppArmor support, can also use "Unconfined"
capabilities:
add: [] # add: ["NET_ADMIN", "NET_BIND_SERVICE"] for reverse proxy support
drop: []
privileged: false
readOnlyRootFilesystem: false
runAsGroup: 0
runAsUser: 0
runAsNonRoot: false
usageStatsEnabled: true
annotations: {}
# myAnnotation: "myValue"
Expand Down