Skip to content

Commit

Permalink
[stable/cosbench]: add Cosbench chart (helm#8235)
Browse files Browse the repository at this point in the history
* [stable/cosbench]: add Cosbench chart

Signed-off-by: Giacomo Guiulfo <[email protected]>

* [stable/cosbench]: update apiVersions

Signed-off-by: Giacomo Guiulfo <[email protected]>

* [stable/cosbench]: use default weight from values

Signed-off-by: Giacomo Guiulfo <[email protected]>

* [stable/cosbench]: add service accounts

Signed-off-by: Giacomo Guiulfo <[email protected]>
  • Loading branch information
giacomoguiulfo authored and k8s-ci-robot committed Oct 16, 2018
1 parent 1b8749b commit 8c1fa7b
Show file tree
Hide file tree
Showing 13 changed files with 491 additions and 0 deletions.
21 changes: 21 additions & 0 deletions stable/cosbench/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
13 changes: 13 additions & 0 deletions stable/cosbench/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: cosbench
version: 1.0.0
appVersion: 0.0.6
kubeVersion: "^1.8.0-0"
description: A benchmark tool for cloud object storage services
home: https://github.com/intel-cloud/cosbench
sources:
- https://github.com/intel-cloud/cosbench
- https://github.com/scality/zenko-cosbench
maintainers:
- name: giacomoguiulfo
email: [email protected]
engine: gotpl
82 changes: 82 additions & 0 deletions stable/cosbench/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# COSBench Helm Chart

[COSBench](https://github.com/intel-cloud/cosbench), is a benchmark tool for cloud object storage services. It is compatible with OpenStack Swift, Amazon S3, Scality Zenko, Ceph, CDMI, Google Cloud Storage, and other services.

## TL;DR;

```console
$ helm install stable/cosbench
```

## Introduction

This chart bootstraps a [COSBench](https://github.com/intel-cloud/cosbench) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.

## Installing the Chart

To install the chart with the release name `my-release`:

```console
$ helm install --name my-release stable/cosbench
```

The command above deploys COSBench on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation.

> **Tip**: List all releases using `helm list`
## Uninstalling the Chart

To uninstall/delete the `my-release` deployment:

```console
$ helm delete my-release
```

The command above removes all the Kubernetes components associated with the chart and deletes the release.

## Configuration

The following table lists the configurable parameters of the COSBench chart and their default values.

Parameter | Description | Default
--------- | ----------- | -------
`serviceAccounts.controller.create` | If true, create the controller service account | `true`
`serviceAccounts.controller.name` | name of the controller service account to use or create | `{{ cosbench.controller.fullname }}`
`serviceAccounts.driver.create` | If true, create the driver service account | `true`
`serviceAccounts.driver.name` | name of the driver service account to use or create | `{{ cosbench.driver.fullname }}`
`controller.image.repository` | controller image repository | `zenko/zenko-cosbench`
`controller.image.tag` | controller image tag | `0.0.6`
`controller.image.pullPolicy` | controller image pullPolicy | `IfNotPresent`
`controller.service.type` | controller service type | `ClusterIP`
`controller.service.port` | controller service port | `19088`
`controller.ingress.enabled` | If true, controller ingress will be created | `false`
`controller.ingress.annotations` | controller ingress annotations | `{}`
`controller.ingress.hosts` | controller ingress hostnames | `[]`
`controller.ingress.tls` | controller ingress TLS configuration | `[]`
`controller.logLevel` | controller log level | `DEBUG`
`driver.replicaCount` | number of driver replicas | `3`
`driver.image.repository` | driver image repository | `zenko/zenko-cosbench`
`driver.image.tag` | driver image tag | `0.0.6`
`driver.image.pullPolicy` | driver image pullPolicy | `IfNotPresent`
`driver.service.type` | driver service type | `ClusterIP`
`driver.service.port` | driver service port | `18088`
`driver.logLevel` | driver log level | `DEBUG`
`driver.antiAffinity` | driver antiAffinity type | `soft`
`driver.hostAliases` | driver aliases for IPs in /etc/hosts | `[]`
`driver.resources.requests` | driver resource requests | Memory: `2Gi`, CPU: `500m`
`driver.resources.limits` | driver resource limits | Memory: `4Gi`, CPU: `1`

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,

```console
$ helm install stable/cosbench --name my-release \
--set driver.replicaCount=5
```

Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example,

```console
$ helm install stable/cosbench --name my-release -f values.yaml
```

> **Tip**: You can use the default [values.yaml](values.yaml)
19 changes: 19 additions & 0 deletions stable/cosbench/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
1. Get the application URL by running these commands:
{{- if .Values.controller.ingress.enabled }}
{{- range .Values.controller.ingress.hosts }}
http{{ if $.Values.controller.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.controller.ingress.path }}
{{- end }}
{{- else if contains "NodePort" .Values.controller.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "cosbench.controller.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.controller.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get svc -w {{ template "cosbench.controller.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "cosbench.controller.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP:{{ .Values.controller.service.port }}
{{- else if contains "ClusterIP" .Values.controller.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "cosbench.name" . }},component=controller,release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080/controller/index.html to use your application"
kubectl port-forward $POD_NAME 8080:19088
{{- end }}
61 changes: 61 additions & 0 deletions stable/cosbench/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "cosbench.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified controller name
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "cosbench.controller.fullname" -}}
{{- printf "%s-cosbench-controller" .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified driver name
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "cosbench.driver.fullname" -}}
{{- printf "%s-cosbench-driver" .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "cosbench.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create the name of the service account to use for the controller component
*/}}
{{- define "cosbench.serviceAccountName.controller" -}}
{{- if .Values.serviceAccounts.controller.create -}}
{{ default (include "cosbench.controller.fullname" .) .Values.serviceAccounts.controller.name }}
{{- else -}}
{{ default "default" .Values.serviceAccounts.controller.name }}
{{- end -}}
{{- end -}}

{{/*
Create the name of the service account to use for the driver component
*/}}
{{- define "cosbench.serviceAccountName.driver" -}}
{{- if .Values.serviceAccounts.driver.create -}}
{{ default (include "cosbench.driver.fullname" .) .Values.serviceAccounts.driver.name }}
{{- else -}}
{{ default "default" .Values.serviceAccounts.driver.name }}
{{- end -}}
{{- end -}}

{{/*
Create a comma seperated list of drivers
*/}}
{{- define "cosbench.driversList" -}}
{{- $count := (int .Values.driver.replicaCount) -}}
{{- $release := .Release.Name -}}
{{- range $v := until $count }}{{ $release }}-cosbench-driver-{{ $v }}.{{ $release }}-cosbench-driver{{ if ne $v (sub $count 1) }},{{- end -}}{{- end -}}
{{- end -}}
39 changes: 39 additions & 0 deletions stable/cosbench/templates/controller-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "cosbench.controller.fullname" . }}
labels:
app: {{ template "cosbench.name" . }}
chart: {{ template "cosbench.chart" . }}
component: controller
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
spec:
replicas: 1
selector:
matchLabels:
app: {{ template "cosbench.name" . }}
release: {{ .Release.Name }}
component: controller
template:
metadata:
labels:
app: {{ template "cosbench.name" . }}
release: {{ .Release.Name }}
component: controller
spec:
serviceAccountName: {{ template "cosbench.serviceAccountName.controller" . }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.controller.image.repository }}:{{ .Values.controller.image.tag }}"
imagePullPolicy: {{ .Values.controller.image.pullPolicy }}
ports:
- name: controller
containerPort: 19088
protocol: TCP
env:
- name: LOG_LEVEL
value: "{{ .Values.controller.logLevel }}"
- name: DRIVERS
value: "{{ template "cosbench.driversList" . }}"
args: ['java','-Dcosbench.tomcat.config=conf/controller-tomcat-server.xml','-server','-cp','main/*','org.eclipse.equinox.launcher.Main','-configuration','conf/.controller','-console','19089']
40 changes: 40 additions & 0 deletions stable/cosbench/templates/controller-ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{{- if .Values.controller.ingress.enabled -}}
{{- $fullName := include "cosbench.controller.fullname" . -}}
{{- $servicePort := .Values.controller.service.port -}}
{{- $ingressPath := .Values.controller.ingress.path -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
app: {{ template "cosbench.name" . }}
chart: {{ template "cosbench.chart" . }}
component: controller
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
{{- with .Values.controller.ingress.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if .Values.controller.ingress.tls }}
tls:
{{- range .Values.controller.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.controller.ingress.hosts }}
- host: {{ . }}
http:
paths:
- path: {{ $ingressPath }}
backend:
serviceName: {{ $fullName }}
servicePort: controller
{{- end }}
{{- end }}
21 changes: 21 additions & 0 deletions stable/cosbench/templates/controller-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "cosbench.controller.fullname" . }}
labels:
app: {{ template "cosbench.name" . }}
chart: {{ template "cosbench.chart" . }}
component: controller
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
spec:
type: {{ .Values.controller.type }}
ports:
- name: controller
port: {{ .Values.controller.service.port }}
targetPort: controller
protocol: TCP
selector:
app: {{ template "cosbench.name" . }}
component: controller
release: {{ .Release.Name }}
12 changes: 12 additions & 0 deletions stable/cosbench/templates/controller-serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if .Values.serviceAccounts.controller.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app: {{ template "cosbench.name" . }}
chart: {{ template "cosbench.chart" . }}
component: controller
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: {{ template "cosbench.serviceAccountName.controller" . }}
{{- end }}
21 changes: 21 additions & 0 deletions stable/cosbench/templates/driver-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "cosbench.driver.fullname" . }}
labels:
app: {{ template "cosbench.name" . }}
chart: {{ template "cosbench.chart" . }}
component: driver
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
spec:
clusterIP: None
ports:
- name: driver
port: {{ .Values.driver.service.port }}
targetPort: driver
protocol: TCP
selector:
app: {{ template "cosbench.name" . }}
component: driver
release: {{ .Release.Name }}
12 changes: 12 additions & 0 deletions stable/cosbench/templates/driver-serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if .Values.serviceAccounts.driver.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app: {{ template "cosbench.name" . }}
chart: {{ template "cosbench.chart" . }}
component: driver
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: {{ template "cosbench.serviceAccountName.driver" . }}
{{- end }}
Loading

0 comments on commit 8c1fa7b

Please sign in to comment.