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
63 changes: 61 additions & 2 deletions k8s/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Running *warp* on kubernetes

This document describes with simple examples on how to automate running *warp* on Kubernetes with `yaml` files. You can also use [Warp Helm Chart](./helm) to
deploy Warp. For details on Helm chart based deployment, refer the [document here](./helm/README.md).
This document describes with simple examples on how to automate running *warp* on Kubernetes with `yaml` files. You can also use [Warp Helm Chart](./helm) to
deploy Warp with advanced configuration options. For details on Helm chart based deployment, refer the [document here](./helm/README.md).

## Create *warp* client listeners

Expand Down Expand Up @@ -65,3 +65,62 @@ Aggregated Throughput, split into 268 x 1s time segments:
* 50% Median: 866.4MiB/s, 27.08 obj/s (1s, starting 19:18:46 UTC)
* Slowest: 851.4MiB/s, 26.61 obj/s (1s, starting 19:17:37 UTC)
```

## Using Helm Chart with Configuration File

The Warp Helm chart now supports two configuration methods:

### Method 1: Traditional Configuration (Simple)
Edit `values.yaml` with basic configuration:
```yaml
warpConfiguration:
s3ServerURL: minio-{0...3}.minio.default.svc.cluster.local:9000
s3AccessKey: "minio"
s3SecretKey: "minio123"
operationToBenchmark: mixed
```

### Method 2: Full YAML Configuration File (Advanced)
Use the `configFile` option in `values.yaml` for complete control over Warp configuration:
```yaml
configFile: |
warp:
api: v1
benchmark: mixed
remote:
region: us-east-1
access-key: 'minioadmin'
secret-key: 'minioadmin'
host:
- 'minio-{0...3}.minio.default.svc.cluster.local:9000'
tls: true
insecure: true
params:
duration: 5m
concurrent: 16
objects: 2500
obj:
size: 10MiB
```

This method provides access to all Warp YAML configuration options including:
- Advanced IO settings
- Auto-termination
- Analysis configuration
- Custom prefixes and storage classes
- And more

For complete configuration examples, see:
- [Warp YAML Samples](https://github.com/minio/warp/tree/master/yml-samples)
- [Helm Configuration Guide](./helm/CONFIG.md)
- [Example values file](./helm/values-configfile-example.yaml)

### Installing with Custom Configuration

```bash
# Using the example configuration file
helm install warp -n warp --create namespace ./helm -f ./helm/values-configfile-example.yaml

# Or provide your own YAML config file
helm install warp -n warp --create namespace ./helm --set-file configFile=my-warp-config.yml
```
111 changes: 111 additions & 0 deletions k8s/helm/CONFIG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# Warp Helm Chart Configuration

This Helm chart now supports two ways to configure Warp benchmarks:

## Option 1: Using `configFile` (Recommended)

The new method allows you to provide a complete YAML configuration file following the Warp YAML format:

```yaml
configFile: |
warp:
api: v1
benchmark: mixed
remote:
region: us-east-1
access-key: 'minio'
secret-key: 'minio123'
host:
- 'minio-{0...3}.minio.default.svc.cluster.local:9000'
tls: false
params:
duration: 5m
concurrent: 16
objects: 2500
obj:
size: 10MiB
```

### Benefits of Using `configFile`

- **Full Feature Access**: Access to all Warp configuration options available in the YAML format
- **Direct Mapping**: Uses the same format as Warp's native YAML configuration files
- **Complex Configurations**: Better support for advanced features like:
- Multiple hosts configuration
- Analysis settings
- IO customization
- Advanced networking options
- Auto-termination settings

### How It Works

1. When `configFile` is provided, the Helm chart:
- Creates a ConfigMap with your YAML configuration
- Automatically injects the `warp-client` property with the correct pod addresses based on `replicaCount`
- Mounts it as `/config/warp-config.yml` in the container
- Runs warp with `warp run /config/warp-config.yml` command

2. If both `configFile` and `warpConfiguration` are defined, `configFile` takes precedence

3. The `warp-client` property is automatically generated as:
```
warp-client: <release-name>-{0...<replicaCount-1>}.<release-name>.<namespace>
```
You don't need to specify this in your config file as it's added automatically

### Example Usage

Install the chart with a custom config file:

```bash
helm install my-warp ./k8s/helm -f values-configfile-example.yaml
```

Or provide the config inline:

```bash
helm install my-warp ./k8s/helm --set-file configFile=my-warp-config.yml
```

### Sample Configuration Files

For complete examples of YAML configuration files, see:
- [Warp YAML Samples](https://github.com/minio/warp/tree/master/yml-samples)
- `values-configfile-example.yaml` in this directory

### Migration Guide

To migrate from `warpConfiguration` to `configFile`:

1. Take your existing `warpConfiguration` values
2. Map them to the corresponding fields in the YAML format
3. Add any additional configuration options you need
4. Set the `configFile` value in your values.yaml

Example mapping:
- `warpConfiguration.s3ServerURL` → `warp.remote.host`
- `warpConfiguration.s3AccessKey` → `warp.remote.access-key`
- `warpConfiguration.s3SecretKey` → `warp.remote.secret-key`
- `warpConfiguration.operationToBenchmark` → `warp.benchmark`
- `warpJobArgs.duration` → `warp.params.duration`
- `warpJobArgs.objects` → `warp.params.objects`

## Option 2: Using `warpConfiguration` (Legacy Method)

The traditional method uses individual configuration fields in `values.yaml`, simpler for basic setups where the hostname is compatible with elipsis notation:

```yaml
warpConfiguration:
s3ServerURL: minio-{0...3}.minio.default.svc.cluster.local:9000
s3ServerTLSEnabled: false
s3ServerRegion: "us-east-1"
s3AccessKey: "minio"
s3SecretKey: "minio123"
operationToBenchmark: get

warpJobArgs:
objects: 1000
obj.size: 10MiB
duration: 5m0s
concurrent: 10
```
19 changes: 19 additions & 0 deletions k8s/helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ The [configuration](./values.yaml) file lists the configuration parameters. If y

We recommend setting `replicaCount` as the same number of MinIO Pods.

#### Configuration Methods

The chart supports two configuration methods:

1. **Traditional Configuration** (Simple): Use the `warpConfiguration` section in `values.yaml` for basic setup
2. **YAML Configuration File** (Advanced): Use the `configFile` option to provide a complete Warp YAML configuration

For detailed information about both methods, see the [Configuration Guide](./CONFIG.md).

### Installing the Chart

After configuring the `values.yaml` file, install this chart using:
Expand All @@ -24,6 +33,16 @@ cd /home/warp/k8s/
helm install warp helm/
```

Or use a custom configuration file:

```bash
# Using the example configuration with full YAML config
helm install warp helm/ -f helm/values-configfile-example.yaml

# Or provide your own YAML config file
helm install warp helm/ --set-file configFile=my-warp-config.yml
```

The command deploys a StatefulSet with `replicaCount` number of Warp client pods and a Job with Warp Server.

### Benchmark results
Expand Down
34 changes: 34 additions & 0 deletions k8s/helm/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{{- $jobName := include "warp.fullname" . -}}
{{- if .Values.job.restartOnUpgrade -}}
{{- $jobName = printf "%s-%d" (include "warp.fullname" .) .Release.Revision -}}
{{- end }}
1. Warp has been deployed successfully!

2. The benchmark job is running. To view and follow the benchmark results, run:

kubectl logs -f job/{{ $jobName }} -n {{ .Release.Namespace }}

3. To check the status of all warp pods:

kubectl get pods -l app.kubernetes.io/name={{ include "warp.name" . }} -n {{ .Release.Namespace }}

4. To view completed benchmark results (if job has finished):

kubectl logs job/{{ $jobName }} -n {{ .Release.Namespace }}

5. Configuration details:
- Warp clients: {{ .Values.replicaCount }}
{{- if .Values.configFile }}
- Configuration method: YAML config file
{{- else }}
- Configuration method: Legacy warpConfiguration
{{- end }}
- Job restart on upgrade: {{ .Values.job.restartOnUpgrade }}

{{- if .Values.configFile }}
6. The benchmark is configured to run against:
{{- $config := .Values.configFile | fromYaml }}
{{- range $config.warp.remote.host }}
- {{ . }}
{{- end }}
{{- end }}
14 changes: 14 additions & 0 deletions k8s/helm/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{- if .Values.configFile }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "warp.fullname" . }}-config
labels:
{{- include "warp.labels" . | nindent 4 }}
data:
warp-config.yml: |
{{- $config := .Values.configFile | fromYaml }}
Copy link

Copilot AI Sep 27, 2025

Choose a reason for hiding this comment

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

The variable $_ is used to discard the return value of set, but this creates an unused variable. Consider using a more explicit approach or add a comment explaining why the return value is discarded.

Suggested change
{{- $config := .Values.configFile | fromYaml }}
{{- $config := .Values.configFile | fromYaml }}
{{- /* Discarding the return value of set; only the mutation side effect is needed. */ -}}

Copilot uses AI. Check for mistakes.

{{- $_ := set $config.warp "warp-client" (printf "%s-{0...%d}.%s.%s" (include "warp.fullname" .) (sub .Values.replicaCount 1) (include "warp.fullname" .) .Release.Namespace) }}
{{ $config | toYaml | indent 4 }}
{{- end }}
32 changes: 32 additions & 0 deletions k8s/helm/templates/job.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,42 @@
apiVersion: batch/v1
kind: Job
metadata:
{{- if .Values.job.restartOnUpgrade }}
name: {{ include "warp.fullname" . }}-{{ .Release.Revision }}
{{- else }}
name: {{ include "warp.fullname" . }}
{{- end }}
labels:
{{- include "warp.labels" . | nindent 4 }}
{{- if .Values.job.restartOnUpgrade }}
revision: "{{ .Release.Revision }}"
{{- end }}
spec:
template:
{{- if .Values.job.restartOnUpgrade }}
metadata:
annotations:
# Force pod restart on upgrade by including a timestamp or revision
rollme: {{ .Release.Revision | quote }}
{{- end }}
spec:
restartPolicy: Never
containers:
- name: {{ include "warp.fullname" . }}
image: "{{ .Values.image.repository }}:{{ include "warp.imageVersion" . }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
{{- if .Values.configFile }}
- run
- /config/warp-config.yml
{{- else }}
- "{{ .Values.warpConfiguration.operationToBenchmark }}"
- "--warp-client={{ include "warp.fullname" . }}-{0...{{ sub .Values.replicaCount 1 }}}.{{ include "warp.fullname" . }}.{{ .Release.Namespace }}"
{{- range $k, $v := .Values.warpJobArgs }}
- --{{ $k }}={{ $v }}
{{- end }}
{{- end }}
{{- if not .Values.configFile }}
env:
- name: WARP_HOST
value: {{ .Values.warpConfiguration.s3ServerURL | quote }}
Expand All @@ -37,12 +56,19 @@ spec:
secretKeyRef:
name: {{ include "warp.fullname" . }}-credentials
key: secret_key
{{- end }}
{{- if .Values.serverResources }}
resources: {{- toYaml .Values.serverResources | nindent 12 }}
{{- end }}
{{- if .Values.securityContext }}
securityContext: {{- toYaml .Values.securityContext | nindent 12 }}
{{- end }}
{{- if .Values.configFile }}
volumeMounts:
- name: config
mountPath: /config
readOnly: true
{{- end }}
{{- if .Values.serviceAccount.create }}
serviceAccountName: {{ include "warp.serviceAccountName" . }}
{{- end }}
Expand All @@ -58,4 +84,10 @@ spec:
{{- if .Values.tolerations }}
tolerations: {{- .Values.tolerations | toYaml | nindent 8 }}
{{- end }}
{{- if .Values.configFile }}
volumes:
- name: config
configMap:
name: {{ include "warp.fullname" . }}-config
{{- end }}
backoffLimit: 4
2 changes: 2 additions & 0 deletions k8s/helm/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.warpConfiguration }}
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -7,3 +8,4 @@ metadata:
data:
access_key: {{ .Values.warpConfiguration.s3AccessKey | b64enc }}
secret_key: {{ .Values.warpConfiguration.s3SecretKey | b64enc }}
{{- end }}
Loading
Loading