-
Notifications
You must be signed in to change notification settings - Fork 150
Update the helm chart to use config file by default #419
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,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 | ||
``` |
This file contains hidden or 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 hidden or 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,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 }} |
This file contains hidden or 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,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 }} | ||
{{- $_ := 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 }} |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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 ofset
, but this creates an unused variable. Consider using a more explicit approach or add a comment explaining why the return value is discarded.Copilot uses AI. Check for mistakes.