Skip to content
Snippets Groups Projects
Commit 2adb1cf6 authored by Benedikt Wetzel's avatar Benedikt Wetzel
Browse files

Introduce a simple helm chart for the theodlite operator

parent f05634da
No related branches found
No related tags found
4 merge requests!159Re-implementation of Theodolite with Kotlin/Quarkus,!157Update Graal Image in CI pipeline,!109Introduce a Helm chart for the Theodolite operator,!83WIP: Re-implementation of Theodolite with Kotlin/Quarkus
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.
{{/*
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 }}
{{- 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
{{- 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
{{- 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
{{- 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
{{- 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
{{- 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 }}
operator:
enabled: true
namespace: "default"
executionCRD:
create: true
benchmarkCRD:
create: true
serviceAccount:
create: true
rbac:
create: true
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment