diff --git a/stable/cosbench/.helmignore b/stable/cosbench/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/stable/cosbench/.helmignore @@ -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 diff --git a/stable/cosbench/Chart.yaml b/stable/cosbench/Chart.yaml new file mode 100644 index 0000000000..a8ed90999e --- /dev/null +++ b/stable/cosbench/Chart.yaml @@ -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: giacomoguiulfo@gmail.com +engine: gotpl diff --git a/stable/cosbench/README.md b/stable/cosbench/README.md new file mode 100644 index 0000000000..b1724cb51b --- /dev/null +++ b/stable/cosbench/README.md @@ -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) diff --git a/stable/cosbench/templates/NOTES.txt b/stable/cosbench/templates/NOTES.txt new file mode 100644 index 0000000000..0893d6af00 --- /dev/null +++ b/stable/cosbench/templates/NOTES.txt @@ -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 }} diff --git a/stable/cosbench/templates/_helpers.tpl b/stable/cosbench/templates/_helpers.tpl new file mode 100644 index 0000000000..152f853481 --- /dev/null +++ b/stable/cosbench/templates/_helpers.tpl @@ -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 -}} diff --git a/stable/cosbench/templates/controller-deployment.yaml b/stable/cosbench/templates/controller-deployment.yaml new file mode 100644 index 0000000000..a9a18d9dc4 --- /dev/null +++ b/stable/cosbench/templates/controller-deployment.yaml @@ -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'] diff --git a/stable/cosbench/templates/controller-ingress.yaml b/stable/cosbench/templates/controller-ingress.yaml new file mode 100644 index 0000000000..9c7e0a1c61 --- /dev/null +++ b/stable/cosbench/templates/controller-ingress.yaml @@ -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 }} diff --git a/stable/cosbench/templates/controller-service.yaml b/stable/cosbench/templates/controller-service.yaml new file mode 100644 index 0000000000..29448d62ba --- /dev/null +++ b/stable/cosbench/templates/controller-service.yaml @@ -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 }} diff --git a/stable/cosbench/templates/controller-serviceaccount.yaml b/stable/cosbench/templates/controller-serviceaccount.yaml new file mode 100644 index 0000000000..b728618f30 --- /dev/null +++ b/stable/cosbench/templates/controller-serviceaccount.yaml @@ -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 }} diff --git a/stable/cosbench/templates/driver-service.yaml b/stable/cosbench/templates/driver-service.yaml new file mode 100644 index 0000000000..c65c3a308f --- /dev/null +++ b/stable/cosbench/templates/driver-service.yaml @@ -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 }} diff --git a/stable/cosbench/templates/driver-serviceaccount.yaml b/stable/cosbench/templates/driver-serviceaccount.yaml new file mode 100644 index 0000000000..846d19ddd8 --- /dev/null +++ b/stable/cosbench/templates/driver-serviceaccount.yaml @@ -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 }} diff --git a/stable/cosbench/templates/driver-statefulset.yaml b/stable/cosbench/templates/driver-statefulset.yaml new file mode 100644 index 0000000000..bd0318d1c7 --- /dev/null +++ b/stable/cosbench/templates/driver-statefulset.yaml @@ -0,0 +1,65 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: {{ template "cosbench.driver.fullname" . }} + labels: + app: {{ template "cosbench.name" . }} + chart: {{ template "cosbench.chart" . }} + component: driver + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} +spec: + serviceName: {{ template "cosbench.driver.fullname" . }} + replicas: {{ .Values.driver.replicaCount }} + selector: + matchLabels: + app: {{ template "cosbench.name" . }} + component: driver + release: "{{ .Release.Name }}" + template: + metadata: + labels: + app: {{ template "cosbench.name" . }} + component: driver + release: "{{ .Release.Name }}" + spec: + serviceAccountName: {{ template "cosbench.serviceAccountName.driver" . }} + containers: + - name: {{ template "cosbench.driver.fullname" . }} + image: "{{ .Values.driver.image.repository }}:{{ .Values.driver.image.tag }}" + imagePullPolicy: {{ .Values.driver.image.pullPolicy }} + ports: + - name: driver + containerPort: 18088 + protocol: TCP + env: + - name: LOG_LEVEL + value: "{{ .Values.driver.logLevel }}" + args: ['java','-Dcosbench.tomcat.config=conf/driver-tomcat-server.xml','-server','-cp','main/*','org.eclipse.equinox.launcher.Main','-configuration','conf/.driver','-console','18089'] + resources: +{{ toYaml .Values.driver.resources | indent 12 }} + affinity: + podAntiAffinity: + {{- if eq .Values.driver.antiAffinity "hard" }} + requiredDuringSchedulingIgnoredDuringExecution: + - topologyKey: "kubernetes.io/hostname" + labelSelector: + matchLabels: + app: {{ template "cosbench.name" . }} + component: driver + release: {{ .Release.Name | quote }} + {{- else if eq .Values.driver.antiAffinity "soft" }} + preferredDuringSchedulingIgnoredDuringExecution: + - weight: {{ .Values.driver.antiAffinityWeight }} + podAffinityTerm: + topologyKey: "kubernetes.io/hostname" + labelSelector: + matchLabels: + app: {{ template "cosbench.name" . }} + component: driver + release: {{ .Release.Name | quote }} + {{- end }} + {{- if .Values.driver.hostAliases }} + hostAliases: +{{ toYaml .Values.driver.hostAliases | indent 8 }} + {{- end }} diff --git a/stable/cosbench/values.yaml b/stable/cosbench/values.yaml new file mode 100644 index 0000000000..956895c584 --- /dev/null +++ b/stable/cosbench/values.yaml @@ -0,0 +1,85 @@ +## Define serviceAccount names for components. Defaults to component's fully +## qualified name. +## +serviceAccounts: + controller: + create: true + name: + driver: + create: true + name: + +# ------------------------------------------------------------------------------ +# Controller: +# ------------------------------------------------------------------------------ + +controller: + ## controller container image + ## + image: + repository: zenko/zenko-cosbench + tag: 0.0.6 + pullPolicy: IfNotPresent + + service: + type: ClusterIP + port: 19088 + + ingress: + enabled: false + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: [] + # - cosbench.local + tls: [] + # - secretName: cosbench-tls + # hosts: + # - cosbench.local + + logLevel: DEBUG + +# ------------------------------------------------------------------------------ +# Driver: +# ------------------------------------------------------------------------------ + +driver: + replicaCount: 1 + + ## driver container image + ## + image: + repository: zenko/zenko-cosbench + tag: 0.0.6 + pullPolicy: IfNotPresent + + service: + type: ClusterIP + port: 18088 + + ## driver log level + ## + logLevel: DEBUG + + ## Pod anitAffinity ["soft", "hard"] + ## + antiAffinity: soft + antiAffinityWeight: 5 + + ## hostAliases allow the modification of the hosts file inside a container + ## + hostAliases: [] + # - ip: "127.0.0.1" + # hostnames: + # - "cosbench.local" + + ## driver resource requests and limits + ## Ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## + resources: + requests: + cpu: 500m + memory: 2Gi + limits: + cpu: 1 + memory: 4Gi