Skip to content
Merged
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
4 changes: 2 additions & 2 deletions client/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: client
description: A unified Helm chart for tracebloc on AKS, EKS, bare-metal, and OpenShift
type: application
version: 1.0.0
appVersion: "1.0.0"
version: 1.0.1
appVersion: "1.0.1"
keywords:
- tracebloc
- kubernetes
Expand Down
11 changes: 1 addition & 10 deletions client/MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@ Key change: `hostPath` section replaces per-PVC `hostPath` values.
# values-bm.yaml
hostPath:
enabled: true
dataPath: /path/to/shared_data
logsPath: /path/to/logs
mysqlPath: /path/to/mysql
initJob: true

pvcAccessMode: ReadWriteOnce

Expand All @@ -81,12 +77,7 @@ storageClass:
clusterScope: true
```

**Old → New mapping:**
| Old key | New key |
|---------|---------|
| `clientData.hostPath` | `/tracebloc/` + `hostPath.dataDir` (base path is hardcoded) |
| `clientLogsPvc.hostPath` | `/tracebloc/` + `hostPath.logsDir` (base path is hardcoded) |
| `mysqlPvc.hostPath` | `/tracebloc/` + `hostPath.mysqlDir` (base path is hardcoded) |
**PV paths (fixed):** When `hostPath.enabled` is true, PVs use `/tracebloc/data`, `/tracebloc/logs`, `/tracebloc/mysql` (e.g. map to `~/.tracebloc/{data,logs,mysql}` when that dir is mounted at `/tracebloc`).

### OpenShift → Unified

Expand Down
6 changes: 1 addition & 5 deletions client/ci/bm-values.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Bare-metal platform values
# Bare-metal platform values (PV paths are fixed: /tracebloc/data, /tracebloc/logs, /tracebloc/mysql)
hostPath:
enabled: true
dataPath: /mnt/tracebloc/shared_data
logsPath: /mnt/tracebloc/logs
mysqlPath: /mnt/tracebloc/mysql
initJob: true

pvcAccessMode: ReadWriteOnce

Expand Down
1 change: 1 addition & 0 deletions client/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
{{ "\033[1;34m" }}Image registry:{{ "\033[0m" }} {{ "\033[1;32m" }}docker.io{{ "\033[0m" }}
{{- if .Values.hostPath.enabled }}
{{ "\033[1;34m" }}Storage:{{ "\033[0m" }} {{ "\033[0;33m" }}hostPath (bare-metal){{ "\033[0m" }}
{{ "\033[1;34m" }}Host dirs:{{ "\033[0m" }} {{ "\033[0;33m" }}/tracebloc/data, /tracebloc/logs, /tracebloc/mysql (on the node){{ "\033[0m" }}
{{- else }}
{{ "\033[1;34m" }}Storage:{{ "\033[0m" }} {{ "\033[0;33m" }}dynamic PVC ({{ .Values.storageClass.name }}){{ "\033[0m" }}
{{- end }}
Expand Down
24 changes: 12 additions & 12 deletions client/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ app.kubernetes.io/instance: {{ .Release.Name }}
client-pvc
{{- end }}

{{- define "tracebloc.clientDataPvName" -}}
{{ .Release.Name }}-data-pv
{{- end }}

{{- define "tracebloc.clientDataStorage" -}}
{{ .Values.pvc.data | default "50Gi" }}
{{- end }}
Expand All @@ -41,6 +45,10 @@ client-pvc
client-logs-pvc
{{- end }}

{{- define "tracebloc.clientLogsPvName" -}}
{{ .Release.Name }}-logs-pv
{{- end }}

{{- define "tracebloc.clientLogsStorage" -}}
{{ .Values.pvc.logs | default "10Gi" }}
{{- end }}
Expand All @@ -49,20 +57,12 @@ client-logs-pvc
mysql-pvc
{{- end }}

{{- define "tracebloc.mysqlStorage" -}}
{{ .Values.pvc.mysql | default "2Gi" }}
{{- end }}

{{- define "tracebloc.hostPath.data" -}}
/tracebloc/{{ trimPrefix (toString .Values.hostPath.dataPath) "/" }}
{{- end }}

{{- define "tracebloc.hostPath.logs" -}}
/tracebloc/{{ trimPrefix (toString .Values.hostPath.logsPath) "/" }}
{{- define "tracebloc.mysqlPvName" -}}
{{ .Release.Name }}-mysql-pv
{{- end }}

{{- define "tracebloc.hostPath.mysql" -}}
/tracebloc/{{ trimPrefix (toString .Values.hostPath.mysqlPath) "/" }}
{{- define "tracebloc.mysqlStorage" -}}
{{ .Values.pvc.mysql | default "2Gi" }}
{{- end }}

{{- define "tracebloc.registrySecretName" -}}
Expand Down
37 changes: 0 additions & 37 deletions client/templates/init-container.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions client/templates/logs-pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: {{ $name }}
name: {{ include "tracebloc.clientLogsPvName" . }}
labels:
{{- include "tracebloc.labels" . | nindent 4 }}
spec:
Expand All @@ -17,7 +17,7 @@ spec:
name: {{ $name }}
namespace: {{ .Release.Namespace }}
hostPath:
path: {{ include "tracebloc.hostPath.logs" . }}
path: /tracebloc/logs
type: DirectoryOrCreate
---
{{- end }}
Expand Down
4 changes: 2 additions & 2 deletions client/templates/mysql-storage-pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: {{ $name }}
name: {{ include "tracebloc.mysqlPvName" . }}
labels:
{{- include "tracebloc.labels" . | nindent 4 }}
spec:
Expand All @@ -17,7 +17,7 @@ spec:
name: {{ $name }}
namespace: {{ .Release.Namespace }}
hostPath:
path: {{ include "tracebloc.hostPath.mysql" . }}
path: /tracebloc/mysql
type: DirectoryOrCreate
---
{{- end }}
Expand Down
4 changes: 2 additions & 2 deletions client/templates/shared-images-pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: {{ $name }}
name: {{ include "tracebloc.clientDataPvName" . }}
labels:
{{- include "tracebloc.labels" . | nindent 4 }}
spec:
Expand All @@ -17,7 +17,7 @@ spec:
name: {{ $name }}
namespace: {{ .Release.Namespace }}
hostPath:
path: {{ include "tracebloc.hostPath.data" . }}
path: /tracebloc/data
type: DirectoryOrCreate
---
{{- end }}
Expand Down
47 changes: 0 additions & 47 deletions client/tests/platform_test.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
suite: Platform Conditionals
templates:
- templates/shared-images-pvc.yaml
- templates/init-container.yaml
- templates/resource-monitor-scc.yaml
- templates/storage-class.yaml
set:
Expand All @@ -23,9 +22,6 @@ tests:
platform: bm
hostPath:
enabled: true
dataPath: /mnt/data
logsPath: /mnt/logs
mysqlPath: /mnt/mysql
asserts:
- hasDocuments:
count: 2
Expand All @@ -43,9 +39,6 @@ tests:
pvcAccessMode: ReadWriteOnce
hostPath:
enabled: true
dataPath: /mnt/data
logsPath: /mnt/logs
mysqlPath: /mnt/mysql
asserts:
- equal:
path: spec.accessModes[0]
Expand Down Expand Up @@ -77,9 +70,6 @@ tests:
set:
hostPath:
enabled: true
dataPath: /mnt/data
logsPath: /mnt/logs
mysqlPath: /mnt/mysql
asserts:
- hasDocuments:
count: 2
Expand All @@ -105,40 +95,6 @@ tests:
path: metadata.annotations["helm.sh/resource-policy"]
value: keep

# --- init Job ---
- it: should create init Job when platform is bm
template: templates/init-container.yaml
set:
platform: bm
hostPath:
enabled: true
dataPath: /mnt/data
logsPath: /mnt/logs
mysqlPath: /mnt/mysql
initJob: true
asserts:
- hasDocuments:
count: 1
- isKind:
of: Job

- it: should not create init Job when platform is aks
template: templates/init-container.yaml
set:
platform: aks
asserts:
- hasDocuments:
count: 0

- it: should not create init Job when platform is empty and hostPath disabled
template: templates/init-container.yaml
set:
hostPath:
enabled: false
asserts:
- hasDocuments:
count: 0

# --- SCC (OpenShift) ---
- it: should create SCC when platform is openshift
template: templates/resource-monitor-scc.yaml
Expand Down Expand Up @@ -226,9 +182,6 @@ tests:
pvcAccessMode: ReadWriteMany
hostPath:
enabled: true
dataPath: /mnt/data
logsPath: /mnt/logs
mysqlPath: /mnt/mysql
asserts:
- equal:
path: spec.accessModes[0]
Expand Down
29 changes: 1 addition & 28 deletions client/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,34 +88,7 @@
"properties": {
"enabled": {
"type": "boolean",
"description": "Enable hostPath PVs (bare-metal only)"
},
"dataPath": {
"type": "string",
"description": "Path segment for shared data volume; rendered as /tracebloc/<dataPath>"
},
"logsPath": {
"type": "string",
"description": "Path segment for logs volume; rendered as /tracebloc/<logsPath>"
},
"mysqlPath": {
"type": "string",
"description": "Path segment for MySQL data volume; rendered as /tracebloc/<mysqlPath>"
},
"initJob": {
"type": "boolean",
"description": "Create pre-install Job to set up host directories"
}
},
"if": {
"properties": { "enabled": { "const": true } }
},
"then": {
"required": ["dataPath", "logsPath", "mysqlPath"],
"properties": {
"dataPath": { "minLength": 1 },
"logsPath": { "minLength": 1 },
"mysqlPath": { "minLength": 1 }
"description": "Enable hostPath PVs (bare-metal only). PV paths are fixed: /tracebloc/data, /tracebloc/logs, /tracebloc/mysql. Directories are created via hostPath type: DirectoryOrCreate."
}
}
},
Expand Down
7 changes: 1 addition & 6 deletions client/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,7 @@ storageClass:
# When disabled, only dynamic PVCs are created (AKS/EKS/OC pattern).
hostPath:
enabled: false
# Path segments; when enabled, mounted under /tracebloc/ (e.g. dataPath: shared_data → /tracebloc/shared_data)
dataPath: ""
logsPath: ""
mysqlPath: ""
# Pre-install Job to create host directories with correct permissions
initJob: true
# PV paths are fixed: /tracebloc/data, /tracebloc/logs, /tracebloc/mysql (→ ~/.tracebloc/{data,logs,mysql} when HOST_DATA_DIR is mounted at /tracebloc). Directories are created automatically via hostPath type: DirectoryOrCreate.

# -- PVC storage sizes (override per-environment if needed)
pvc:
Expand Down