-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
35e1348
commit 6c9566f
Showing
13 changed files
with
543 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# ================================================ | ||
# === boilerplate to get a bootable deployment === | ||
# ================================================ | ||
config: | ||
encryptionKey: '000000000' | ||
jwtSecret: '000000000' | ||
|
||
licenseKey: "EXPIRED-LICENSE-KEY-TRIAL" | ||
|
||
image: | ||
tag: 'latest' | ||
|
||
resources: | ||
requests: | ||
cpu: 500m | ||
memory: 1024Mi | ||
limits: | ||
cpu: 1000m | ||
memory: 4096Mi | ||
|
||
workflows: | ||
resources: | ||
requests: | ||
cpu: 500m | ||
memory: 1024Mi | ||
limits: | ||
cpu: 1000m | ||
memory: 2048Mi | ||
|
||
env: | ||
NUM_WORKERS: '1' | ||
# NODE_DEBUG: 'module' | ||
|
||
ingress: | ||
kubernetes.io/ingress.class: nginx | ||
hosts: | ||
- host: retool.example.com | ||
paths: | ||
- path: / | ||
|
||
livenessProbe: | ||
timeoutSeconds: 60 | ||
periodSeconds: 2 | ||
failureThreshold: 60 | ||
readinessProbe: | ||
timeoutSeconds: 30 | ||
periodSeconds: 5 | ||
|
||
replicaCount: 1 | ||
|
||
persistentVolumeClaim: | ||
size: '3Gi' | ||
# ================================================ | ||
|
||
# === New telemetry stuff === | ||
telemetry: | ||
enabled: true | ||
image: | ||
repository: 'tryretool/telemetry' | ||
# tag: | ||
sendToRetool: | ||
enabled: true | ||
customVectorConfig: | ||
foo: bar | ||
customGrafanaAgentConfig: | | ||
// wee woo custom text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{{/* | ||
Reusable name for telemetry-related chart resources. | ||
*/}} | ||
{{- define "retool.telemetry.fullname" -}} | ||
{{- $name := default "telemetry" .Values.telemetry.nameOverride -}} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Labels to include on telemetry pods. | ||
*/}} | ||
{{- define "retool.telemetry.labels" -}} | ||
helm.sh/chart: {{ include "retool.chart" . }} | ||
{{ include "retool.telemetry.selectorLabels" . }} | ||
app.kubernetes.io/version: {{ .Chart.Version | quote }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end -}} | ||
|
||
{{/* | ||
Labels to use as selector for telemetry pods and deployment. Note these become | ||
immutable once deployed, so changes here will require recreating the deployment. | ||
*/}} | ||
{{- define "retool.telemetry.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ default "telemetry" .Values.telemetry.nameOverride }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end -}} | ||
|
||
|
||
{{/* | ||
The name of the service account to use. | ||
*/}} | ||
{{- define "retool.telemetry.serviceAccountName" -}} | ||
{{- if .Values.telemetry.serviceAccount.create }} | ||
{{- default (include "retool.telemetry.fullname" .) .Values.telemetry.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.telemetry.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
|
||
{{/* | ||
The labels to use for scoping log collection to only the pods in the same | ||
release, as a single comma-separated string. The label(s) below should be | ||
present on all relevant pods, or else logs won't be collected. */}} | ||
{{- define "retool.telemetry.logSourcePodLabels" -}} | ||
app.kubernetes.io/instance={{ .Release.Name }} | ||
{{- end }} | ||
{{/* | ||
Env vars to include on retool pods to collect telemetry via telemetry pod. | ||
*/}} | ||
{{- define "retool.telemetry.includeEnvVars" -}} | ||
{{- if .Values.telemetry.enabled }} | ||
- name: RTEL_ENABLED | ||
value: 'true' | ||
- name: RTEL_SERVICE_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.labels['telemetry.retool.com/service-name'] | ||
- name: K8S_POD_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.name | ||
- name: K8S_NODE_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: spec.nodeName | ||
- name: STATSD_HOST | ||
value: {{ printf "%s.%s" (include "retool.telemetry.fullname" .) .Release.Namespace | quote }} | ||
- name: STATSD_PORT | ||
value: "9125" | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{{- if .Values.telemetry.enabled }} | ||
|
||
{{- if or .Values.telemetry.customVectorConfig .Values.telemetry.customGrafanaAgentConfig }} | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ include "retool.fullname" . }}-telemetry | ||
labels: | ||
{{- include "retool.telemetry.labels" . | nindent 4 }} | ||
data: | ||
{{- if .Values.telemetry.customVectorConfig }} | ||
vector-custom.yaml: | | ||
{{- tpl (toYaml .Values.telemetry.customVectorConfig) . | nindent 4 }} | ||
{{- end }} | ||
{{- if .Values.telemetry.customGrafanaAgentConfig }} | ||
grafana-agent-custom.river: | | ||
{{- .Values.telemetry.customGrafanaAgentConfig | nindent 4 }} | ||
{{- end }} | ||
|
||
{{- end }} | ||
|
||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
{{- if .Values.telemetry.enabled }} | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "retool.fullname" . }}-telemetry | ||
labels: | ||
{{- include "retool.telemetry.labels" . | nindent 4 }} | ||
spec: | ||
selector: | ||
matchLabels: | ||
{{- include "retool.telemetry.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
labels: | ||
{{- include "retool.telemetry.selectorLabels" . | nindent 8 }} | ||
annotations: | ||
{{- if or .Values.telemetry.customVectorConfig .Values.telemetry.customGrafanaAgentConfig }} | ||
checksum/custom-config: {{ include (print $.Template.BasePath "/telemetry_configmap.yaml") . | sha256sum | quote }} | ||
{{- end }} | ||
spec: | ||
serviceAccountName: {{ include "retool.telemetry.serviceAccountName" . }} | ||
containers: | ||
- name: telemetry | ||
image: '{{ .Values.telemetry.image.repository }}:{{ .Values.telemetry.image.tag | default .Values.image.tag }}' | ||
imagePullPolicy: {{ .Values.telemetry.image.pullPolicy }} | ||
command: ['retool-telemetry'] | ||
resources: | ||
{{ toYaml .Values.telemetry.resources | nindent 10 }} | ||
env: | ||
- name: VECTOR_SELF_NODE_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: spec.nodeName | ||
- name: VECTOR_SELF_POD_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.name | ||
- name: VECTOR_SELF_POD_NAMESPACE | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
- name: PROCFS_ROOT | ||
value: "/host/proc" | ||
- name: SYSFS_ROOT | ||
value: "/host/sys" | ||
{{- if and (not .Values.externalSecrets.enabled) (not .Values.externalSecrets.externalSecretsOperator.enabled) }} | ||
- name: LICENSE_KEY | ||
valueFrom: | ||
secretKeyRef: | ||
{{- if .Values.config.licenseKeySecretName }} | ||
name: {{ .Values.config.licenseKeySecretName }} | ||
key: {{ .Values.config.licenseKeySecretKey | default "license-key" }} | ||
{{- else }} | ||
name: {{ template "retool.fullname" . }} | ||
key: license-key | ||
{{- end }} | ||
{{- end }} | ||
- name: RTEL_DEPLOYMENT_MODE | ||
value: 'kubernetes-helm' | ||
- name: RTEL_HELM_RELEASE_NAME | ||
value: {{ .Release.Name | quote }} | ||
- name: RTEL_KUBE_POD_PREFIX | ||
value: {{ include "retool.fullname" . | quote }} | ||
- name: RTEL_KUBE_NAMESPACE | ||
value: {{ .Release.Namespace | quote }} | ||
- name: RTEL_KUBE_LABEL_SELECTOR | ||
value: {{ include "retool.telemetry.logSourcePodLabels" . | quote }} | ||
- name: RTEL_SEND_TO_RETOOL | ||
value: {{ .Values.telemetry.sendToRetool.enabled | quote }} | ||
{{- if .Values.externalSecrets.enabled }} | ||
envFrom: | ||
- secretRef: | ||
name: {{ .Values.externalSecrets.name }} | ||
{{- end }} | ||
{{- if .Values.externalSecrets.externalSecretsOperator.enabled }} | ||
envFrom: | ||
{{- range .Values.externalSecrets.externalSecretsOperator.secretRef }} | ||
- secretRef: | ||
name: {{ .name }} | ||
{{- end }} | ||
{{- end }} | ||
volumeMounts: | ||
- name: vector-data | ||
mountPath: {{ .Values.telemetry.customVectorConfig | dig "data_dir" "/vector-data" | quote }} | ||
- name: grafana-agent-data | ||
mountPath: /grafana-agent-data | ||
{{- if .Values.telemetry.customVectorConfig }} | ||
- name: custom-config | ||
mountPath: "/etc/vector-custom/vector-custom.yaml" | ||
subPath: "vector-custom.yaml" | ||
readOnly: true | ||
{{- end }} | ||
{{- if .Values.telemetry.customGrafanaAgentConfig }} | ||
- name: custom-config | ||
mountPath: "/etc/grafana-agent-custom/grafana-agent-custom.river" | ||
subPath: "grafana-agent-custom.river" | ||
readOnly: true | ||
{{- end }} | ||
- name: var-log | ||
mountPath: "/var/log/" | ||
readOnly: true | ||
- name: var-lib | ||
mountPath: "/var/lib" | ||
readOnly: true | ||
- name: procfs | ||
mountPath: "/host/proc" | ||
readOnly: true | ||
- name: sysfs | ||
mountPath: "/host/sys" | ||
readOnly: true | ||
ports: | ||
- containerPort: 9125 | ||
# hostPort: 9125 | ||
name: statsd-udp | ||
protocol: UDP | ||
volumes: | ||
- name: vector-data | ||
emptyDir: | ||
sizeLimit: 100Mi | ||
- name: grafana-agent-data | ||
emptyDir: | ||
sizeLimit: 100Mi | ||
{{- if or .Values.telemetry.customVectorConfig .Values.telemetry.customGrafanaAgentConfig }} | ||
- name: custom-config | ||
configMap: | ||
name: {{ include "retool.fullname" . }}-telemetry | ||
{{- end }} | ||
- name: var-log | ||
hostPath: | ||
path: "/var/log/" | ||
- name: var-lib | ||
hostPath: | ||
path: "/var/lib/" | ||
- name: procfs | ||
hostPath: | ||
path: "/proc" | ||
- name: sysfs | ||
hostPath: | ||
path: "/sys" | ||
|
||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "retool.telemetry.fullname" . }} | ||
labels: | ||
{{- include "retool.telemetry.labels" . | nindent 4 }} | ||
spec: | ||
ports: | ||
- name: statsd-udp | ||
port: 9125 | ||
protocol: UDP | ||
selector: | ||
{{- include "retool.telemetry.selectorLabels" . | nindent 4 }} | ||
type: ClusterIP | ||
|
||
|
||
{{- end }} |
Oops, something went wrong.