diff --git a/execution/helm/.helmignore b/execution/helm/theodolite-infrastructure/.helmignore similarity index 100% rename from execution/helm/.helmignore rename to execution/helm/theodolite-infrastructure/.helmignore diff --git a/execution/helm/Chart.yaml b/execution/helm/theodolite-infrastructure/Chart.yaml similarity index 100% rename from execution/helm/Chart.yaml rename to execution/helm/theodolite-infrastructure/Chart.yaml diff --git a/execution/helm/README.md b/execution/helm/theodolite-infrastructure/README.md similarity index 100% rename from execution/helm/README.md rename to execution/helm/theodolite-infrastructure/README.md diff --git a/execution/helm/build-package.sh b/execution/helm/theodolite-infrastructure/build-package.sh similarity index 100% rename from execution/helm/build-package.sh rename to execution/helm/theodolite-infrastructure/build-package.sh diff --git a/execution/helm/preconfigs/one-broker-values.yaml b/execution/helm/theodolite-infrastructure/preconfigs/one-broker-values.yaml similarity index 100% rename from execution/helm/preconfigs/one-broker-values.yaml rename to execution/helm/theodolite-infrastructure/preconfigs/one-broker-values.yaml diff --git a/execution/helm/templates/NOTES.txt b/execution/helm/theodolite-infrastructure/templates/NOTES.txt similarity index 100% rename from execution/helm/templates/NOTES.txt rename to execution/helm/theodolite-infrastructure/templates/NOTES.txt diff --git a/execution/helm/templates/_helpers.tpl b/execution/helm/theodolite-infrastructure/templates/_helpers.tpl similarity index 100% rename from execution/helm/templates/_helpers.tpl rename to execution/helm/theodolite-infrastructure/templates/_helpers.tpl diff --git a/execution/helm/templates/cluster-role-binding.yaml b/execution/helm/theodolite-infrastructure/templates/cluster-role-binding.yaml similarity index 100% rename from execution/helm/templates/cluster-role-binding.yaml rename to execution/helm/theodolite-infrastructure/templates/cluster-role-binding.yaml diff --git a/execution/helm/templates/cluster-role.yaml b/execution/helm/theodolite-infrastructure/templates/cluster-role.yaml similarity index 100% rename from execution/helm/templates/cluster-role.yaml rename to execution/helm/theodolite-infrastructure/templates/cluster-role.yaml diff --git a/execution/helm/templates/dashboard-config-map.yaml b/execution/helm/theodolite-infrastructure/templates/dashboard-config-map.yaml similarity index 100% rename from execution/helm/templates/dashboard-config-map.yaml rename to execution/helm/theodolite-infrastructure/templates/dashboard-config-map.yaml diff --git a/execution/helm/templates/kafka-client.yaml b/execution/helm/theodolite-infrastructure/templates/kafka-client.yaml similarity index 100% rename from execution/helm/templates/kafka-client.yaml rename to execution/helm/theodolite-infrastructure/templates/kafka-client.yaml diff --git a/execution/helm/templates/prometheus-datasource-config-map.yaml b/execution/helm/theodolite-infrastructure/templates/prometheus-datasource-config-map.yaml similarity index 100% rename from execution/helm/templates/prometheus-datasource-config-map.yaml rename to execution/helm/theodolite-infrastructure/templates/prometheus-datasource-config-map.yaml diff --git a/execution/helm/templates/prometheus.yaml b/execution/helm/theodolite-infrastructure/templates/prometheus.yaml similarity index 100% rename from execution/helm/templates/prometheus.yaml rename to execution/helm/theodolite-infrastructure/templates/prometheus.yaml diff --git a/execution/helm/templates/service-account.yaml b/execution/helm/theodolite-infrastructure/templates/service-account.yaml similarity index 100% rename from execution/helm/templates/service-account.yaml rename to execution/helm/theodolite-infrastructure/templates/service-account.yaml diff --git a/execution/helm/templates/service-monitor.yaml b/execution/helm/theodolite-infrastructure/templates/service-monitor.yaml similarity index 100% rename from execution/helm/templates/service-monitor.yaml rename to execution/helm/theodolite-infrastructure/templates/service-monitor.yaml diff --git a/execution/helm/templates/tests/test-connection.yaml b/execution/helm/theodolite-infrastructure/templates/tests/test-connection.yaml similarity index 100% rename from execution/helm/templates/tests/test-connection.yaml rename to execution/helm/theodolite-infrastructure/templates/tests/test-connection.yaml diff --git a/execution/helm/update-index.sh b/execution/helm/theodolite-infrastructure/update-index.sh similarity index 100% rename from execution/helm/update-index.sh rename to execution/helm/theodolite-infrastructure/update-index.sh diff --git a/execution/helm/values.yaml b/execution/helm/theodolite-infrastructure/values.yaml similarity index 100% rename from execution/helm/values.yaml rename to execution/helm/theodolite-infrastructure/values.yaml diff --git a/execution/helm/theodolite-operator/.helmignore b/execution/helm/theodolite-operator/.helmignore new file mode 100644 index 0000000000000000000000000000000000000000..0e8a0eb36f4ca2c939201c0d54b5d82a1ea34778 --- /dev/null +++ b/execution/helm/theodolite-operator/.helmignore @@ -0,0 +1,23 @@ +# 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 +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/execution/helm/theodolite-operator/Chart.yaml b/execution/helm/theodolite-operator/Chart.yaml new file mode 100644 index 0000000000000000000000000000000000000000..3e029303c7e5f551eef0aa4b440d97f5a2f057ff --- /dev/null +++ b/execution/helm/theodolite-operator/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: theodolite-operator +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "1.16.0" diff --git a/execution/helm/theodolite-operator/templates/NOTES.txt b/execution/helm/theodolite-operator/templates/NOTES.txt new file mode 100644 index 0000000000000000000000000000000000000000..495545db9e73aec2f83e06c4688c81856a76169f --- /dev/null +++ b/execution/helm/theodolite-operator/templates/NOTES.txt @@ -0,0 +1,5 @@ +Welcome to Theodolite! + +This is the Theodolite operator. Deploy executions and benchmarks to start benchmarks. + +Visit https://cau-se.github.io/theodolite for getting started and more information. diff --git a/execution/helm/theodolite-operator/templates/_helpers.tpl b/execution/helm/theodolite-operator/templates/_helpers.tpl new file mode 100644 index 0000000000000000000000000000000000000000..a495f0e81d1bf3afc5399ef500a3ff6c2c0e7fc4 --- /dev/null +++ b/execution/helm/theodolite-operator/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "theodolite-operator.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "theodolite-operator.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "theodolite-operator.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "theodolite-operator.labels" -}} +helm.sh/chart: {{ include "theodolite-operator.chart" . }} +{{ include "theodolite-operator.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "theodolite-operator.selectorLabels" -}} +app.kubernetes.io/name: {{ include "theodolite-operator.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "theodolite-operator.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "theodolite-operator.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/execution/helm/theodolite-operator/templates/benchmarkCRD.yaml b/execution/helm/theodolite-operator/templates/benchmarkCRD.yaml new file mode 100644 index 0000000000000000000000000000000000000000..9d7468b490fa2f2a6cf829bdcafab8c4bd6fc5bf --- /dev/null +++ b/execution/helm/theodolite-operator/templates/benchmarkCRD.yaml @@ -0,0 +1,15 @@ +{{- if .Values.benchmarkCRD.create -}} +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: benchmarks.theodolite.com +spec: + group: theodolite.com + version: v1alpha1 + names: + kind: benchmark + plural: benchmarks + scope: Namespaced + subresources: + status: {} +{{- end }} \ No newline at end of file diff --git a/execution/helm/theodolite-operator/templates/executionCRD.yaml b/execution/helm/theodolite-operator/templates/executionCRD.yaml new file mode 100644 index 0000000000000000000000000000000000000000..73b58397b8c1fc15ffef5da74e8f1dbdabaa3a30 --- /dev/null +++ b/execution/helm/theodolite-operator/templates/executionCRD.yaml @@ -0,0 +1,15 @@ +{{- if .Values.executionCRD.create -}} +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: executions.theodolite.com +spec: + group: theodolite.com + version: v1alpha1 + names: + kind: execution + plural: executions + scope: Namespaced + subresources: + status: {} +{{- end }} \ No newline at end of file diff --git a/execution/helm/theodolite-operator/templates/role-binding.yaml b/execution/helm/theodolite-operator/templates/role-binding.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ee13c45eef973c0d2713ef56a5d03ca205985994 --- /dev/null +++ b/execution/helm/theodolite-operator/templates/role-binding.yaml @@ -0,0 +1,15 @@ +{{- if .Values.rbac.create -}} +apiVersion: rbac.authorization.k8s.io/v1beta1 +kind: RoleBinding +metadata: + name: {{ include "theodolite-operator.fullname" . }} + labels: + app: {{ include "theodolite-operator.name" . }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: {{ include "theodolite-operator.fullname" . }} +subjects: +- kind: ServiceAccount + name: {{ include "theodolite-operator.serviceAccountName" . }} +{{- end }} \ No newline at end of file diff --git a/execution/helm/theodolite-operator/templates/role.yaml b/execution/helm/theodolite-operator/templates/role.yaml new file mode 100644 index 0000000000000000000000000000000000000000..2ce70d282cf47b0a924bbe5142ecdc44f092f1e4 --- /dev/null +++ b/execution/helm/theodolite-operator/templates/role.yaml @@ -0,0 +1,56 @@ +{{- if .Values.rbac.create -}} +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: {{ include "theodolite-operator.fullname" . }} +rules: + - apiGroups: + - apps + resources: + - deployments + verbs: + - delete + - list + - get + - create + - apiGroups: + - "" + resources: + - services + - pods + - servicemonitors + - configmaps + verbs: + - delete + - list + - get + - create + - apiGroups: + - "" + resources: + - pods/exec + verbs: + - create + - get + - apiGroups: + - monitoring.coreos.com + resources: + - servicemonitors + verbs: + - delete + - list + - create + - apiGroups: + - theodolite.com + resources: + - executions + - benchmarks + verbs: + - delete + - list + - get + - create + - watch + - update + - patch +{{- end }} \ No newline at end of file diff --git a/execution/helm/theodolite-operator/templates/serviceaccount.yaml b/execution/helm/theodolite-operator/templates/serviceaccount.yaml new file mode 100644 index 0000000000000000000000000000000000000000..5f65969320e7bc62701a8c1485390559cb5e1a00 --- /dev/null +++ b/execution/helm/theodolite-operator/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "theodolite-operator.serviceAccountName" . }} + labels: + {{- include "theodolite-operator.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/execution/helm/theodolite-operator/templates/thedolite-operator.yaml b/execution/helm/theodolite-operator/templates/thedolite-operator.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6f9a57198fad59674c983d7ac017aa1371e4a4a1 --- /dev/null +++ b/execution/helm/theodolite-operator/templates/thedolite-operator.yaml @@ -0,0 +1,26 @@ +{{- if .Values.operator.enabled -}} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "theodolite-operator.fullname" . }} +spec: + selector: + matchLabels: + app: theodolite + replicas: 1 + template: + metadata: + labels: + app: theodolite + spec: + terminationGracePeriodSeconds: 0 + serviceAccountName: {{ include "theodolite-operator.serviceAccountName" . }} + containers: + - name: thedolite + image: lorenzboguhn/thedolite:latest + env: + - name: KUBECONFIG + value: "~/.kube/config" + - name: NAMESPACE + value: {{ .Values.operator.namespace}} +{{- end }} diff --git a/execution/helm/theodolite-operator/values.yaml b/execution/helm/theodolite-operator/values.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b0f8cc0bfbbe42a83f2ded8f0e1d8e441381e46d --- /dev/null +++ b/execution/helm/theodolite-operator/values.yaml @@ -0,0 +1,15 @@ +operator: + enabled: true + namespace: "default" + +executionCRD: + create: true + +benchmarkCRD: + create: true + +serviceAccount: + create: true + +rbac: + create: true \ No newline at end of file