Add mariadb operator chart

This commit is contained in:
2024-02-05 22:46:53 +08:00
parent f05697e240
commit 42516f1f7d
172 changed files with 57277 additions and 0 deletions
+23
View File
@@ -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/
+17
View File
@@ -0,0 +1,17 @@
apiVersion: v2
appVersion: v0.0.24
description: Run and operate MariaDB in a cloud native way
home: https://github.com/mariadb-operator/mariadb-operator
icon: https://mariadb-operator.github.io/mariadb-operator/assets/mariadb.png
keywords:
- mariadb
- operator
- mariadb-operator
- database
kubeVersion: '>= 1.16.0-0'
maintainers:
- email: mariadb-operator@proton.me
name: mmontes11
name: mariadb-operator
type: application
version: 0.24.0
+125
View File
@@ -0,0 +1,125 @@
[//]: # (README.md generated by gotmpl. DO NOT EDIT.)
<p align="center">
<img src="https://mariadb-operator.github.io/mariadb-operator/assets/mariadb-operator.png" alt="mariadb" width="250"/>
</p>
![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![Version: 0.24.0](https://img.shields.io/badge/Version-0.24.0-informational?style=flat-square) ![AppVersion: v0.0.24](https://img.shields.io/badge/AppVersion-v0.0.24-informational?style=flat-square)
Run and operate MariaDB in a cloud native way
## Installing
```bash
helm repo add mariadb-operator https://mariadb-operator.github.io/mariadb-operator
helm install mariadb-operator mariadb-operator/mariadb-operator
```
## Uninstalling
```bash
helm uninstall mariadb-operator
```
## Values
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | Affinity to add to controller Pod |
| certController.affinity | object | `{}` | Affinity to add to controller Pod |
| certController.caValidity | string | `"35064h"` | CA certificate validity. It must be greater than certValidity. |
| certController.certValidity | string | `"8766h"` | Certificate validity. |
| certController.enabled | bool | `true` | Specifies whether the cert-controller should be created. |
| certController.extrArgs | list | `[]` | Extra arguments to be passed to the cert-controller entrypoint |
| certController.extraVolumeMounts | list | `[]` | Extra volumes to mount to cert-controller container |
| certController.extraVolumes | list | `[]` | Extra volumes to pass to cert-controller Pod |
| certController.ha.enabled | bool | `false` | Enable high availability |
| certController.ha.replicas | int | `3` | Number of replicas |
| certController.image.pullPolicy | string | `"IfNotPresent"` | |
| certController.image.repository | string | `"ghcr.io/mariadb-operator/mariadb-operator"` | |
| certController.image.tag | string | `""` | Image tag to use. By default the chart appVersion is used |
| certController.imagePullSecrets | list | `[]` | |
| certController.lookaheadValidity | string | `"2160h"` | Duration used to verify whether a certificate is valid or not. |
| certController.nodeSelector | object | `{}` | Node selectors to add to controller Pod |
| certController.podAnnotations | object | `{}` | Annotations to add to cert-controller Pod |
| certController.podSecurityContext | object | `{}` | Security context to add to cert-controller Pod |
| certController.requeueDuration | string | `"5m"` | Requeue duration to ensure that certificate gets renewed. |
| certController.resources | object | `{}` | Resources to add to cert-controller container |
| certController.securityContext | object | `{}` | Security context to add to cert-controller container |
| certController.serviceAccount.annotations | object | `{}` | Annotations to add to the service account |
| certController.serviceAccount.automount | bool | `true` | Automounts the service account token in all containers of the Pod |
| certController.serviceAccount.enabled | bool | `true` | Specifies whether a service account should be created |
| certController.serviceAccount.extraLabels | object | `{}` | Extra Labels to add to the service account |
| certController.serviceAccount.name | string | `""` | The name of the service account to use. If not set and enabled is true, a name is generated using the fullname template |
| certController.serviceMonitor.additionalLabels | object | `{}` | Labels to be added to the cert-controller ServiceMonitor |
| certController.serviceMonitor.enabled | bool | `true` | Enable cert-controller ServiceMonitor. Metrics must be enabled |
| certController.serviceMonitor.interval | string | `"30s"` | Interval to scrape metrics |
| certController.serviceMonitor.scrapeTimeout | string | `"25s"` | Timeout if metrics can't be retrieved in given time interval |
| certController.tolerations | list | `[]` | Tolerations to add to controller Pod |
| clusterName | string | `"cluster.local"` | Cluster DNS name |
| extrArgs | list | `[]` | Extra arguments to be passed to the controller entrypoint |
| extraEnv | list | `[]` | Extra environment variables to be passed to the controller |
| extraVolumeMounts | list | `[]` | Extra volumes to mount to the container. |
| extraVolumes | list | `[]` | Extra volumes to pass to pod. |
| fullnameOverride | string | `""` | |
| ha.enabled | bool | `false` | Enable high availability |
| ha.replicas | int | `3` | Number of replicas |
| image.pullPolicy | string | `"IfNotPresent"` | |
| image.repository | string | `"ghcr.io/mariadb-operator/mariadb-operator"` | |
| image.tag | string | `""` | Image tag to use. By default the chart appVersion is used |
| imagePullSecrets | list | `[]` | |
| logLevel | string | `"INFO"` | Controller log level |
| metrics.enabled | bool | `false` | Enable operator internal metrics. Prometheus must be installed in the cluster |
| metrics.serviceMonitor.additionalLabels | object | `{}` | Labels to be added to the controller ServiceMonitor |
| metrics.serviceMonitor.enabled | bool | `true` | Enable controller ServiceMonitor |
| metrics.serviceMonitor.interval | string | `"30s"` | Interval to scrape metrics |
| metrics.serviceMonitor.scrapeTimeout | string | `"25s"` | Timeout if metrics can't be retrieved in given time interval |
| nameOverride | string | `""` | |
| nodeSelector | object | `{}` | Node selectors to add to controller Pod |
| podAnnotations | object | `{}` | Annotations to add to controller Pod |
| podSecurityContext | object | `{}` | Security context to add to controller Pod |
| rbac.enabled | bool | `true` | Specifies whether RBAC resources should be created |
| resources | object | `{}` | Resources to add to controller container |
| securityContext | object | `{}` | Security context to add to controller container |
| serviceAccount.annotations | object | `{}` | Annotations to add to the service account |
| serviceAccount.automount | bool | `true` | Automounts the service account token in all containers of the Pod |
| serviceAccount.enabled | bool | `true` | Specifies whether a service account should be created |
| serviceAccount.extraLabels | object | `{}` | Extra Labels to add to the service account |
| serviceAccount.name | string | `""` | The name of the service account to use. If not set and enabled is true, a name is generated using the fullname template |
| tolerations | list | `[]` | Tolerations to add to controller Pod |
| webhook.affinity | object | `{}` | Affinity to add to controller Pod |
| webhook.annotations | object | `{}` | Annotations for webhook configurations. |
| webhook.cert.caPath | string | `"/tmp/k8s-webhook-server/certificate-authority"` | Path where the CA certificate will be mounted. |
| webhook.cert.certManager.duration | string | `""` | Duration to be used in the Certificate resource, |
| webhook.cert.certManager.enabled | bool | `false` | Whether to use cert-manager to issue and rotate the certificate. If set to false, mariadb-operator's cert-controller will be used instead. |
| webhook.cert.certManager.issuerRef | object | `{}` | Issuer reference to be used in the Certificate resource. If not provided, a self-signed issuer will be used. |
| webhook.cert.certManager.renewBefore | string | `""` | Renew before duration to be used in the Certificate resource. |
| webhook.cert.path | string | `"/tmp/k8s-webhook-server/serving-certs"` | Path where the certificate will be mounted. |
| webhook.cert.secretAnnotations | object | `{}` | Annotatioms to be added to webhook TLS secret. |
| webhook.extrArgs | list | `[]` | Extra arguments to be passed to the webhook entrypoint |
| webhook.extraVolumeMounts | list | `[]` | Extra volumes to mount to webhook container |
| webhook.extraVolumes | list | `[]` | Extra volumes to pass to webhook Pod |
| webhook.ha.enabled | bool | `false` | Enable high availability |
| webhook.ha.replicas | int | `3` | Number of replicas |
| webhook.hostNetwork | bool | `false` | Expose the webhook server in the host network |
| webhook.image.pullPolicy | string | `"IfNotPresent"` | |
| webhook.image.repository | string | `"ghcr.io/mariadb-operator/mariadb-operator"` | |
| webhook.image.tag | string | `""` | Image tag to use. By default the chart appVersion is used |
| webhook.imagePullSecrets | list | `[]` | |
| webhook.nodeSelector | object | `{}` | Node selectors to add to controller Pod |
| webhook.podAnnotations | object | `{}` | Annotations to add to webhook Pod |
| webhook.podSecurityContext | object | `{}` | Security context to add to webhook Pod |
| webhook.port | int | `9443` | Port to be used by the webhook server |
| webhook.resources | object | `{}` | Resources to add to webhook container |
| webhook.securityContext | object | `{}` | Security context to add to webhook container |
| webhook.serviceAccount.annotations | object | `{}` | Annotations to add to the service account |
| webhook.serviceAccount.automount | bool | `true` | Automounts the service account token in all containers of the Pod |
| webhook.serviceAccount.enabled | bool | `true` | Specifies whether a service account should be created |
| webhook.serviceAccount.extraLabels | object | `{}` | Extra Labels to add to the service account |
| webhook.serviceAccount.name | string | `""` | The name of the service account to use. If not set and enabled is true, a name is generated using the fullname template |
| webhook.serviceMonitor.additionalLabels | object | `{}` | Labels to be added to the webhook ServiceMonitor |
| webhook.serviceMonitor.enabled | bool | `true` | Enable webhook ServiceMonitor. Metrics must be enabled |
| webhook.serviceMonitor.interval | string | `"30s"` | Interval to scrape metrics |
| webhook.serviceMonitor.scrapeTimeout | string | `"25s"` | Timeout if metrics can't be retrieved in given time interval |
| webhook.tolerations | list | `[]` | Tolerations to add to controller Pod |
+26
View File
@@ -0,0 +1,26 @@
{{ $chartRepo := "https://mariadb-operator.github.io/mariadb-operator" }}
{{ $org := "mariadb-operator" }}
{{ $release := "mariadb-operator" }}
[//]: # (README.md generated by gotmpl. DO NOT EDIT.)
<p align="center">
<img src="https://mariadb-operator.github.io/mariadb-operator/assets/mariadb-operator.png" alt="mariadb" width="250"/>
</p>
{{ template "chart.typeBadge" . }}{{ template "chart.versionBadge" . }}{{ template "chart.appVersionBadge" . }}
{{ template "chart.description" . }}
## Installing
```bash
helm repo add {{ $org }} {{ $chartRepo }}
helm install {{ $release }} {{ $org }}/{{ template "chart.name" . }}
```
## Uninstalling
```bash
helm uninstall {{ $release }}
```
{{ template "chart.valuesSection" . }}
File diff suppressed because it is too large Load Diff
+4
View File
@@ -0,0 +1,4 @@
mariadb-operator has been successfully deployed! 🦭
Not sure what to do next? 😅 Check out:
https://github.com/mariadb-operator/mariadb-operator#quickstart
+124
View File
@@ -0,0 +1,124 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "mariadb-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 "mariadb-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 "mariadb-operator.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "mariadb-operator.labels" -}}
helm.sh/chart: {{ include "mariadb-operator.chart" . }}
{{ include "mariadb-operator.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "mariadb-operator.selectorLabels" -}}
app.kubernetes.io/name: {{ include "mariadb-operator.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Webhook common labels
*/}}
{{- define "mariadb-operator-webhook.labels" -}}
helm.sh/chart: {{ include "mariadb-operator.chart" . }}
{{ include "mariadb-operator-webhook.selectorLabels" . }}
{{ if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{ end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Webhook selector labels
*/}}
{{- define "mariadb-operator-webhook.selectorLabels" -}}
app.kubernetes.io/name: {{ include "mariadb-operator.name" . }}-webhook
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Cert-controller common labels
*/}}
{{- define "mariadb-operator-cert-controller.labels" -}}
helm.sh/chart: {{ include "mariadb-operator.chart" . }}
{{ include "mariadb-operator-cert-controller.selectorLabels" . }}
{{ if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{ end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Cert-controller selector labels
*/}}
{{- define "mariadb-operator-cert-controller.selectorLabels" -}}
app.kubernetes.io/name: {{ include "mariadb-operator.name" . }}-cert-controller
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "mariadb-operator.serviceAccountName" -}}
{{- if .Values.serviceAccount.enabled }}
{{- default (include "mariadb-operator.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
{{/*
Create the name of the webhook service account to use
*/}}
{{- define "mariadb-operator-webhook.serviceAccountName" -}}
{{- if .Values.webhook.serviceAccount.enabled }}
{{- default (printf "%s-webhook" (include "mariadb-operator.fullname" .)) .Values.webhook.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.webhook.serviceAccount.name }}
{{- end }}
{{- end }}
{{/*
Create the name of the cert-controller service account to use
*/}}
{{- define "mariadb-operator-cert-controller.serviceAccountName" -}}
{{- if .Values.certController.serviceAccount.enabled }}
{{- default (printf "%s-cert-controller" (include "mariadb-operator.fullname" .)) .Values.certController.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.certController.serviceAccount.name }}
{{- end }}
{{- end }}
@@ -0,0 +1,103 @@
{{- if and .Values.certController.enabled (not .Values.webhook.cert.certManager.enabled) -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "mariadb-operator.fullname" . }}-cert-controller
labels:
{{ include "mariadb-operator-cert-controller.labels" . | nindent 4 }}
spec:
{{ if .Values.certController.ha.enabled }}
replicas: {{ .Values.certController.ha.replicas}}
{{ end }}
selector:
matchLabels:
{{ include "mariadb-operator-cert-controller.selectorLabels" . | nindent 6 }}
template:
metadata:
{{ with .Values.certController.podAnnotations }}
annotations:
{{ toYaml . | nindent 8 }}
{{ end }}
labels:
{{ include "mariadb-operator-cert-controller.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.certController.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "mariadb-operator-cert-controller.serviceAccountName" . }}-cert-controller
automountServiceAccountToken: {{ .Values.certController.serviceAccount.automount }}
{{ with .Values.certController.nodeSelector }}
nodeSelector:
{{ toYaml . | nindent 8 }}
{{ end }}
{{ with .Values.certController.tolerations }}
tolerations:
{{ toYaml . | nindent 8 }}
{{ end }}
{{ with .Values.certController.affinity }}
affinity:
{{ toYaml . | nindent 8 }}
{{ end }}
{{ with .Values.certController.podSecurityContext }}
securityContext:
{{ toYaml . | nindent 8 }}
{{ end }}
containers:
- image: "{{ .Values.certController.image.repository }}:{{ .Values.certController.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.certController.image.pullPolicy }}
name: cert-controller
args:
- cert-controller
- --ca-secret-name={{ include "mariadb-operator.fullname" . }}-webhook-ca
- --ca-secret-namespace={{ .Release.Namespace }}
- --ca-validity={{ .Values.certController.caValidity }}
- --cert-secret-name={{ include "mariadb-operator.fullname" . }}-webhook-cert
- --cert-secret-namespace={{ .Release.Namespace }}
- --cert-validity={{ .Values.certController.certValidity }}
- --lookahead-validity={{ .Values.certController.lookaheadValidity }}
- --service-name={{ include "mariadb-operator.fullname" . }}-webhook
- --service-namespace={{ .Release.Namespace }}
- --requeue-duration={{ .Values.certController.requeueDuration }}
- --metrics-addr=:8080
- --health-addr=:8081
- --log-level={{ .Values.logLevel }}
{{- if .Values.certController.ha.enabled }}
- --leader-elect
{{- end }}
{{- range .Values.certController.extrArgs }}
- {{ . }}
{{- end }}
ports:
- containerPort: 8080
protocol: TCP
name: metrics
- containerPort: 8081
protocol: TCP
name: health
env:
- name: CLUSTER_NAME
value: {{ .Values.clusterName }}
{{- with .Values.certController.extraVolumeMounts }}
volumeMounts:
{{- toYaml . | nindent 12 }}
{{- end }}
readinessProbe:
httpGet:
path: /readyz
port: 8081
initialDelaySeconds: 20
periodSeconds: 5
{{ with .Values.certController.resources }}
resources:
{{ toYaml . | nindent 12 }}
{{ end }}
{{ with .Values.certController.securityContext}}
securityContext:
{{ toYaml . | nindent 12 }}
{{ end }}
{{- with .Values.certController.extraVolumes }}
volumes:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
@@ -0,0 +1,88 @@
{{- if and .Values.rbac.enabled .Values.certController.enabled (not .Values.webhook.cert.certManager.enabled) -}}
{{ $fullName := include "mariadb-operator.fullname" . }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ $fullName }}-cert-controller
rules:
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ $fullName }}-cert-controller
rules:
- apiGroups:
- admissionregistration.k8s.io
resources:
- validatingwebhookconfigurations
- mutatingwebhookconfigurations
verbs:
- get
- list
- update
- patch
- watch
- apiGroups:
- ""
resources:
- secrets
verbs:
- create
- list
- patch
- watch
- apiGroups:
- ""
resources:
- endpoints
- endpoints/restricted
verbs:
- get
- list
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ $fullName }}-cert-controller
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ $fullName }}-cert-controller
subjects:
- kind: ServiceAccount
name: {{ include "mariadb-operator-cert-controller.serviceAccountName" . }}-cert-controller
namespace: {{ .Release.Namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ $fullName }}-cert-controller
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ $fullName }}-cert-controller
subjects:
- kind: ServiceAccount
name: {{ include "mariadb-operator-cert-controller.serviceAccountName" . }}-cert-controller
namespace: {{ .Release.Namespace }}
{{- end }}
@@ -0,0 +1,15 @@
{{- if and .Values.certController.enabled (not .Values.webhook.cert.certManager.enabled) -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "mariadb-operator-cert-controller.serviceAccountName" . }}-cert-controller
labels:
{{- include "mariadb-operator-cert-controller.labels" . | nindent 4 }}
{{- with .Values.certController.serviceAccount.extraLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.certController.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
@@ -0,0 +1,36 @@
{{ if and .Values.certController.enabled (not .Values.webhook.cert.certManager.enabled) .Values.metrics.enabled .Values.certController.serviceMonitor.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "mariadb-operator.fullname" . }}-cert-controller-metrics
labels:
{{ include "mariadb-operator-cert-controller.labels" . | nindent 4 }}
spec:
ports:
- port: 8080
protocol: TCP
name: metrics
selector:
{{ include "mariadb-operator-cert-controller.selectorLabels" . | nindent 4 }}
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "mariadb-operator.fullname" . }}-cert-controller
labels:
{{ include "mariadb-operator-cert-controller.labels" . | nindent 4 }}
{{ with .Values.certController.serviceMonitor.additionalLabels }}
{{ toYaml . | nindent 4 }}
{{ end }}
spec:
selector:
matchLabels:
{{ include "mariadb-operator-cert-controller.selectorLabels" . | nindent 6 }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace | quote }}
endpoints:
- port: metrics
interval: {{ .Values.certController.serviceMonitor.interval }}
scrapeTimeout: {{ .Values.certController.serviceMonitor.scrapeTimeout }}
{{ end }}
@@ -0,0 +1,9 @@
apiVersion: v1
data:
MARIADB_OPERATOR_IMAGE: ghcr.io/mariadb-operator/mariadb-operator:v0.0.24
RELATED_IMAGE_EXPORTER: prom/mysqld-exporter:v0.15.1
RELATED_IMAGE_MARIADB: mariadb:11.2.2
kind: ConfigMap
metadata:
creationTimestamp: null
name: mariadb-operator-images
@@ -0,0 +1,97 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "mariadb-operator.fullname" . }}
labels:
{{ include "mariadb-operator.labels" . | nindent 4 }}
spec:
{{ if .Values.ha.enabled }}
replicas: {{ .Values.ha.replicas}}
{{ end }}
selector:
matchLabels:
{{ include "mariadb-operator.selectorLabels" . | nindent 6 }}
template:
metadata:
{{ with .Values.podAnnotations }}
annotations:
{{ toYaml . | nindent 8 }}
{{ end }}
labels:
{{ include "mariadb-operator.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "mariadb-operator.serviceAccountName" . }}
automountServiceAccountToken: {{ .Values.serviceAccount.automount }}
terminationGracePeriodSeconds: 10
{{ with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | nindent 8 }}
{{ end }}
{{ with .Values.tolerations }}
tolerations:
{{ toYaml . | nindent 8 }}
{{ end }}
{{ with .Values.affinity }}
affinity:
{{ toYaml . | nindent 8 }}
{{ end }}
{{ with .Values.podSecurityContext }}
securityContext:
{{ toYaml . | nindent 8 }}
{{ end }}
containers:
- image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
name: controller
args:
- --metrics-addr=:8080
- --log-level={{ .Values.logLevel }}
{{- if .Values.ha.enabled }}
- --leader-elect
{{- end }}
{{- range .Values.extrArgs }}
- {{ . }}
{{- end }}
ports:
- containerPort: 8080
protocol: TCP
name: metrics
envFrom:
- configMapRef:
name: mariadb-operator-images
env:
- name: CLUSTER_NAME
value: {{ .Values.clusterName }}
- name: MARIADB_OPERATOR_NAME
valueFrom:
fieldRef:
fieldPath: spec.serviceAccountName
- name: MARIADB_OPERATOR_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: MARIADB_OPERATOR_SA_PATH
value: /var/run/secrets/kubernetes.io/serviceaccount/token
{{- with .Values.extraEnv }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if .Values.extraVolumeMounts }}
volumeMounts:
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
{{- end }}
{{ with .Values.resources }}
resources:
{{ toYaml . | nindent 12 }}
{{ end }}
{{ with .Values.securityContext}}
securityContext:
{{ toYaml . | nindent 12 }}
{{ end }}
{{- if .Values.extraVolumes }}
volumes:
{{- toYaml .Values.extraVolumes | nindent 8 }}
{{- end }}
@@ -0,0 +1,36 @@
{{ if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "mariadb-operator.fullname" . }}-metrics
labels:
{{ include "mariadb-operator.labels" . | nindent 4 }}
spec:
ports:
- port: 8080
protocol: TCP
name: metrics
selector:
{{ include "mariadb-operator.selectorLabels" . | nindent 4 }}
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "mariadb-operator.fullname" . }}
labels:
{{ include "mariadb-operator.labels" . | nindent 4 }}
{{ with .Values.metrics.serviceMonitor.additionalLabels }}
{{ toYaml . | nindent 4 }}
{{ end }}
spec:
selector:
matchLabels:
{{ include "mariadb-operator.selectorLabels" . | nindent 6 }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace | quote }}
endpoints:
- port: metrics
interval: {{ .Values.metrics.serviceMonitor.interval }}
scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }}
{{ end }}
+443
View File
@@ -0,0 +1,443 @@
{{- if .Values.rbac.enabled -}}
{{ $fullName := include "mariadb-operator.fullname" . }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ $fullName }}
rules:
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ $fullName }}
rules:
- apiGroups:
- ""
resources:
- configmaps
verbs:
- create
- get
- list
- patch
- watch
- apiGroups:
- ""
resources:
- endpoints
- endpoints/restricted
verbs:
- create
- get
- list
- patch
- watch
- apiGroups:
- ""
resources:
- events
verbs:
- create
- list
- patch
- watch
- apiGroups:
- ""
resources:
- persistentvolumeclaims
verbs:
- create
- list
- patch
- watch
- apiGroups:
- ""
resources:
- pods
verbs:
- delete
- get
- list
- watch
- apiGroups:
- ""
resources:
- secrets
verbs:
- create
- list
- patch
- watch
- apiGroups:
- ""
resources:
- serviceaccounts
verbs:
- create
- list
- patch
- watch
- apiGroups:
- ""
resources:
- services
verbs:
- create
- list
- patch
- watch
- apiGroups:
- apps
resources:
- deployments
verbs:
- create
- list
- patch
- watch
- apiGroups:
- apps
resources:
- statefulsets
verbs:
- create
- get
- list
- patch
- watch
- apiGroups:
- batch
resources:
- cronjobs
verbs:
- create
- list
- patch
- watch
- apiGroups:
- batch
resources:
- jobs
verbs:
- create
- list
- patch
- watch
- apiGroups:
- mariadb.mmontes.io
resources:
- backups
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- mariadb.mmontes.io
resources:
- backups/finalizers
verbs:
- update
- apiGroups:
- mariadb.mmontes.io
resources:
- backups/status
verbs:
- get
- patch
- update
- apiGroups:
- mariadb.mmontes.io
resources:
- connections
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- mariadb.mmontes.io
resources:
- connections
- restores
verbs:
- create
- list
- patch
- watch
- apiGroups:
- mariadb.mmontes.io
resources:
- connections/finalizers
verbs:
- update
- apiGroups:
- mariadb.mmontes.io
resources:
- connections/status
verbs:
- get
- patch
- update
- apiGroups:
- mariadb.mmontes.io
resources:
- databases
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- mariadb.mmontes.io
resources:
- databases/finalizers
verbs:
- update
- apiGroups:
- mariadb.mmontes.io
resources:
- databases/status
verbs:
- get
- patch
- update
- apiGroups:
- mariadb.mmontes.io
resources:
- grants
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- mariadb.mmontes.io
resources:
- grants/finalizers
verbs:
- update
- apiGroups:
- mariadb.mmontes.io
resources:
- grants/status
verbs:
- get
- patch
- update
- apiGroups:
- mariadb.mmontes.io
resources:
- mariadbs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- mariadb.mmontes.io
resources:
- mariadbs/finalizers
verbs:
- update
- apiGroups:
- mariadb.mmontes.io
resources:
- mariadbs/status
verbs:
- get
- patch
- update
- apiGroups:
- mariadb.mmontes.io
resources:
- restores
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- mariadb.mmontes.io
resources:
- restores/finalizers
verbs:
- update
- apiGroups:
- mariadb.mmontes.io
resources:
- restores/status
verbs:
- get
- patch
- update
- apiGroups:
- mariadb.mmontes.io
resources:
- sqljobs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- mariadb.mmontes.io
resources:
- sqljobs/finalizers
verbs:
- update
- apiGroups:
- mariadb.mmontes.io
resources:
- sqljobs/status
verbs:
- get
- patch
- update
- apiGroups:
- mariadb.mmontes.io
resources:
- users
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- mariadb.mmontes.io
resources:
- users/finalizers
verbs:
- update
- apiGroups:
- mariadb.mmontes.io
resources:
- users/status
verbs:
- get
- patch
- update
- apiGroups:
- policy
resources:
- poddisruptionbudgets
verbs:
- create
- list
- patch
- watch
- apiGroups:
- rbac.authorization.k8s.io
resources:
- clusterrolebindings
- rolebindings
- roles
verbs:
- create
- list
- patch
- watch
- apiGroups:
- monitoring.coreos.com
resources:
- servicemonitors
verbs:
- create
- list
- patch
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ $fullName }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ $fullName }}
subjects:
- kind: ServiceAccount
name: {{ include "mariadb-operator.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ $fullName }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ $fullName }}
subjects:
- kind: ServiceAccount
name: {{ include "mariadb-operator.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ $fullName }}:auth-delegator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: system:auth-delegator
subjects:
- kind: ServiceAccount
name: {{ include "mariadb-operator.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end }}
@@ -0,0 +1,15 @@
{{- if .Values.serviceAccount.enabled -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "mariadb-operator.serviceAccountName" . }}
labels:
{{- include "mariadb-operator.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.extraLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
@@ -0,0 +1,47 @@
{{ if .Values.webhook.cert.certManager.enabled }}
{{ if not .Values.webhook.cert.certManager.issuerRef }}
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: {{ include "mariadb-operator.fullname" . }}-selfsigned-issuer
labels:
{{ include "mariadb-operator-webhook.labels" . | nindent 4 }}
spec:
selfSigned: {}
{{ end }}
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: {{ include "mariadb-operator.fullname" . }}-webhook-cert
labels:
{{ include "mariadb-operator-webhook.labels" . | nindent 4 }}
spec:
commonName: {{ include "mariadb-operator.fullname" . }}-webhook.{{ .Release.Namespace }}.svc
dnsNames:
- {{ include "mariadb-operator.fullname" . }}-webhook.{{ .Release.Namespace }}.svc.{{ .Values.clusterName }}
- {{ include "mariadb-operator.fullname" . }}-webhook.{{ .Release.Namespace }}.svc
- {{ include "mariadb-operator.fullname" . }}-webhook.{{ .Release.Namespace }}
- {{ include "mariadb-operator.fullname" . }}-webhook
issuerRef:
{{- if .Values.webhook.cert.certManager.issuerRef -}}
{{ toYaml .Values.webhook.cert.certManager.issuerRef | nindent 4 }}
{{- else }}
kind: Issuer
name: {{ include "mariadb-operator.fullname" . }}-selfsigned-issuer
{{- end }}
{{- with .Values.webhook.cert.certManager.duration }}
duration: {{ . | quote }}
{{- end }}
{{- with .Values.webhook.cert.certManager.renewBefore }}
renewBefore: {{ . | quote }}
{{- end }}
secretName: {{ include "mariadb-operator.fullname" . }}-webhook-cert
secretTemplate:
labels:
{{- include "mariadb-operator-webhook.labels" . | nindent 6 }}
{{- with .Values.webhook.cert.secretAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{ end }}
@@ -0,0 +1,214 @@
{{ $fullName := include "mariadb-operator.fullname" . }}
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
name: {{ $fullName }}-webhook
labels:
{{ include "mariadb-operator-webhook.labels" . | nindent 4 }}
annotations:
{{- if .Values.webhook.cert.certManager.enabled }}
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ include "mariadb-operator.fullname" . }}-webhook-cert
{{- else }}
mariadb.mmontes.io/webhook: ""
{{- end }}
{{ with .Values.webhook.annotations }}
{{ toYaml . | indent 4 }}
{{ end }}
webhooks:
- admissionReviewVersions:
- v1
clientConfig:
service:
name: {{ $fullName }}-webhook
namespace: {{ .Release.Namespace }}
path: /mutate-mariadb-mmontes-io-v1alpha1-mariadb
failurePolicy: Fail
name: mmariadb.kb.io
rules:
- apiGroups:
- mariadb.mmontes.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- mariadbs
sideEffects: None
---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
name: {{ $fullName }}-webhook
labels:
{{ include "mariadb-operator-webhook.labels" . | nindent 4 }}
annotations:
{{- if .Values.webhook.cert.certManager.enabled }}
cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ include "mariadb-operator.fullname" . }}-webhook-cert
{{- else }}
mariadb.mmontes.io/webhook: ""
{{- end }}
{{ with .Values.webhook.annotations }}
{{ toYaml . | indent 4 }}
{{ end }}
webhooks:
- admissionReviewVersions:
- v1
clientConfig:
service:
name: {{ $fullName }}-webhook
namespace: {{ .Release.Namespace }}
path: /validate-mariadb-mmontes-io-v1alpha1-backup
failurePolicy: Fail
name: vbackup.kb.io
rules:
- apiGroups:
- mariadb.mmontes.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- backups
sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
service:
name: {{ $fullName }}-webhook
namespace: {{ .Release.Namespace }}
path: /validate-mariadb-mmontes-io-v1alpha1-connection
failurePolicy: Fail
name: vconnection.kb.io
rules:
- apiGroups:
- mariadb.mmontes.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- connections
sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
service:
name: {{ $fullName }}-webhook
namespace: {{ .Release.Namespace }}
path: /validate-mariadb-mmontes-io-v1alpha1-database
failurePolicy: Fail
name: vdatabase.kb.io
rules:
- apiGroups:
- mariadb.mmontes.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- databases
sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
service:
name: {{ $fullName }}-webhook
namespace: {{ .Release.Namespace }}
path: /validate-mariadb-mmontes-io-v1alpha1-grant
failurePolicy: Fail
name: vgrant.kb.io
rules:
- apiGroups:
- mariadb.mmontes.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- grants
sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
service:
name: {{ $fullName }}-webhook
namespace: {{ .Release.Namespace }}
path: /validate-mariadb-mmontes-io-v1alpha1-mariadb
failurePolicy: Fail
name: vmariadb.kb.io
rules:
- apiGroups:
- mariadb.mmontes.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- mariadbs
sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
service:
name: {{ $fullName }}-webhook
namespace: {{ .Release.Namespace }}
path: /validate-mariadb-mmontes-io-v1alpha1-restore
failurePolicy: Fail
name: vrestore.kb.io
rules:
- apiGroups:
- mariadb.mmontes.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- restores
sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
service:
name: {{ $fullName }}-webhook
namespace: {{ .Release.Namespace }}
path: /validate-mariadb-mmontes-io-v1alpha1-sqljob
failurePolicy: Fail
name: vsqljob.kb.io
rules:
- apiGroups:
- mariadb.mmontes.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- sqljobs
sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
service:
name: {{ $fullName }}-webhook
namespace: {{ .Release.Namespace }}
path: /validate-mariadb-mmontes-io-v1alpha1-user
failurePolicy: Fail
name: vuser.kb.io
rules:
- apiGroups:
- mariadb.mmontes.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- users
sideEffects: None
@@ -0,0 +1,116 @@
{{ $fullName := include "mariadb-operator.fullname" . }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ $fullName }}-webhook
labels:
{{ include "mariadb-operator-webhook.labels" . | nindent 4 }}
spec:
{{ if .Values.webhook.ha.enabled }}
replicas: {{ .Values.webhook.ha.replicas}}
{{ end }}
selector:
matchLabels:
{{ include "mariadb-operator-webhook.selectorLabels" . | nindent 6 }}
template:
metadata:
{{ with .Values.webhook.podAnnotations }}
annotations:
{{ toYaml . | nindent 8 }}
{{ end }}
labels:
{{ include "mariadb-operator-webhook.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.webhook.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "mariadb-operator-webhook.serviceAccountName" . }}
automountServiceAccountToken: {{ .Values.webhook.serviceAccount.automount }}
{{ with .Values.webhook.nodeSelector }}
nodeSelector:
{{ toYaml . | nindent 8 }}
{{ end }}
{{ with .Values.webhook.tolerations }}
tolerations:
{{ toYaml . | nindent 8 }}
{{ end }}
{{ with .Values.webhook.affinity }}
affinity:
{{ toYaml . | nindent 8 }}
{{ end }}
{{ with .Values.webhook.podSecurityContext }}
securityContext:
{{ toYaml . | nindent 8 }}
{{ end }}
hostNetwork: {{ .Values.webhook.hostNetwork }}
containers:
- image: "{{ .Values.webhook.image.repository }}:{{ .Values.webhook.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.webhook.image.pullPolicy }}
name: webhook
args:
- webhook
{{- if .Values.webhook.cert.certManager.enabled }}
- --ca-cert-path={{ .Values.webhook.cert.path }}/ca.crt
{{- else }}
- --ca-cert-path={{ .Values.webhook.cert.caPath }}/tls.crt
{{- end }}
- --cert-dir={{ .Values.webhook.cert.path }}
- --dns-name={{ $fullName }}-webhook.{{ .Release.Namespace }}.svc
- --port={{ .Values.webhook.port }}
- --metrics-addr=:8080
- --health-addr=:8081
- --log-level={{ .Values.logLevel }}
{{- range .Values.webhook.extrArgs }}
- {{ . }}
{{- end }}
ports:
- containerPort: {{ .Values.webhook.port }}
protocol: TCP
name: https
- containerPort: 8080
protocol: TCP
name: metrics
- containerPort: 8081
protocol: TCP
name: health
volumeMounts:
{{- if not .Values.webhook.cert.certManager.enabled }}
- mountPath: {{ .Values.webhook.cert.caPath }}
name: ca
readOnly: true
{{- end }}
- mountPath: {{ .Values.webhook.cert.path }}
name: cert
readOnly: true
{{- if .Values.webhook.extraVolumeMounts }}
{{- toYaml .Values.webhook.extraVolumeMounts | nindent 12 }}
{{- end }}
readinessProbe:
httpGet:
path: /readyz
port: 8081
initialDelaySeconds: 20
periodSeconds: 5
{{ with .Values.webhook.resources }}
resources:
{{ toYaml . | nindent 12 }}
{{ end }}
{{ with .Values.webhook.securityContext}}
securityContext:
{{ toYaml . | nindent 12 }}
{{ end }}
volumes:
{{- if not .Values.webhook.cert.certManager.enabled }}
- name: ca
secret:
defaultMode: 420
secretName: {{ $fullName }}-webhook-ca
{{- end }}
- name: cert
secret:
defaultMode: 420
secretName: {{ $fullName }}-webhook-cert
{{- if .Values.webhook.extraVolumes }}
{{- toYaml .Values.webhook.extraVolumes | nindent 8 }}
{{- end }}
@@ -0,0 +1,25 @@
{{- if not .Values.webhook.cert.certManager.enabled }}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "mariadb-operator.fullname" . }}-webhook-ca
labels:
{{- include "mariadb-operator-webhook.labels" . | nindent 4 }}
mariadb-operator.io/component: webhook
{{- with .Values.webhook.cert.secretAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
---
apiVersion: v1
kind: Secret
metadata:
name: {{ include "mariadb-operator.fullname" . }}-webhook-cert
labels:
{{- include "mariadb-operator-webhook.labels" . | nindent 4 }}
mariadb-operator.io/component: webhook
{{- with .Values.webhook.cert.secretAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "mariadb-operator.fullname" . }}-webhook
labels:
{{ include "mariadb-operator-webhook.labels" . | nindent 4 }}
spec:
ports:
- port: 443
protocol: TCP
targetPort: {{ .Values.webhook.port }}
selector:
{{ include "mariadb-operator-webhook.selectorLabels" . | nindent 4 }}
@@ -0,0 +1,13 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "mariadb-operator-webhook.serviceAccountName" . }}
labels:
{{- include "mariadb-operator-webhook.labels" . | nindent 4 }}
{{- with .Values.webhook.serviceAccount.extraLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.webhook.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
@@ -0,0 +1,36 @@
{{ if and .Values.metrics.enabled .Values.webhook.serviceMonitor.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "mariadb-operator.fullname" . }}-webhook-metrics
labels:
{{ include "mariadb-operator-webhook.labels" . | nindent 4 }}
spec:
ports:
- port: 8080
protocol: TCP
name: metrics
selector:
{{ include "mariadb-operator-webhook.selectorLabels" . | nindent 4 }}
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "mariadb-operator.fullname" . }}-webhook
labels:
{{ include "mariadb-operator-webhook.labels" . | nindent 4 }}
{{ with .Values.webhook.serviceMonitor.additionalLabels }}
{{ toYaml . | nindent 4 }}
{{ end }}
spec:
selector:
matchLabels:
{{ include "mariadb-operator-webhook.selectorLabels" . | nindent 6 }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace | quote }}
endpoints:
- port: metrics
interval: {{ .Values.webhook.serviceMonitor.interval }}
scrapeTimeout: {{ .Values.webhook.serviceMonitor.scrapeTimeout }}
{{ end }}
+236
View File
@@ -0,0 +1,236 @@
nameOverride: ""
fullnameOverride: ""
image:
repository: ghcr.io/mariadb-operator/mariadb-operator
pullPolicy: IfNotPresent
# -- Image tag to use. By default the chart appVersion is used
tag: ""
imagePullSecrets: []
# -- Controller log level
logLevel: INFO
# -- Cluster DNS name
clusterName: cluster.local
ha:
# -- Enable high availability
enabled: false
# -- Number of replicas
replicas: 3
metrics:
# -- Enable operator internal metrics. Prometheus must be installed in the cluster
enabled: true
serviceMonitor:
# -- Enable controller ServiceMonitor
enabled: true
# -- Labels to be added to the controller ServiceMonitor
additionalLabels: {}
# release: kube-prometheus-stack
# -- Interval to scrape metrics
interval: 30s
# -- Timeout if metrics can't be retrieved in given time interval
scrapeTimeout: 25s
serviceAccount:
# -- Specifies whether a service account should be created
enabled: true
# -- Automounts the service account token in all containers of the Pod
automount: true
# -- Annotations to add to the service account
annotations: {}
# -- Extra Labels to add to the service account
extraLabels: {}
# -- The name of the service account to use.
# If not set and enabled is true, a name is generated using the fullname template
name: ""
rbac:
# -- Specifies whether RBAC resources should be created
enabled: true
# -- Extra arguments to be passed to the controller entrypoint
extrArgs: []
# -- Extra environment variables to be passed to the controller
extraEnv: []
# -- Extra volumes to pass to pod.
extraVolumes: []
# -- Extra volumes to mount to the container.
extraVolumeMounts: []
# -- Annotations to add to controller Pod
podAnnotations: {}
# -- Security context to add to controller Pod
podSecurityContext: {}
# -- Security context to add to controller container
securityContext: {}
# -- Resources to add to controller container
resources:
requests:
cpu: 10m
memory: 32Mi
# -- Node selectors to add to controller Pod
nodeSelector: {}
# -- Tolerations to add to controller Pod
tolerations: []
# -- Affinity to add to controller Pod
affinity: {}
webhook:
image:
repository: ghcr.io/mariadb-operator/mariadb-operator
pullPolicy: IfNotPresent
# -- Image tag to use. By default the chart appVersion is used
tag: ""
imagePullSecrets: []
ha:
# -- Enable high availability
enabled: false
# -- Number of replicas
replicas: 3
cert:
certManager:
# -- Whether to use cert-manager to issue and rotate the certificate. If set to false, mariadb-operator's cert-controller will be used instead.
enabled: false
# -- Issuer reference to be used in the Certificate resource. If not provided, a self-signed issuer will be used.
issuerRef: {}
# -- Duration to be used in the Certificate resource,
duration: ""
# -- Renew before duration to be used in the Certificate resource.
renewBefore: ""
# -- Annotatioms to be added to webhook TLS secret.
secretAnnotations: {}
# -- Path where the CA certificate will be mounted.
caPath: /tmp/k8s-webhook-server/certificate-authority
# -- Path where the certificate will be mounted.
path: /tmp/k8s-webhook-server/serving-certs
# -- Port to be used by the webhook server
port: 9443
# -- Expose the webhook server in the host network
hostNetwork: false
serviceMonitor:
# -- Enable webhook ServiceMonitor. Metrics must be enabled
enabled: true
# -- Labels to be added to the webhook ServiceMonitor
additionalLabels: {}
# release: kube-prometheus-stack
# -- Interval to scrape metrics
interval: 30s
# -- Timeout if metrics can't be retrieved in given time interval
scrapeTimeout: 25s
serviceAccount:
# -- Specifies whether a service account should be created
enabled: true
# -- Automounts the service account token in all containers of the Pod
automount: true
# -- Annotations to add to the service account
annotations: {}
# -- Extra Labels to add to the service account
extraLabels: {}
# -- The name of the service account to use.
# If not set and enabled is true, a name is generated using the fullname template
name: ""
# -- Annotations for webhook configurations.
annotations: {}
# -- Extra arguments to be passed to the webhook entrypoint
extrArgs: []
# -- Extra volumes to pass to webhook Pod
extraVolumes: []
# -- Extra volumes to mount to webhook container
extraVolumeMounts: []
# -- Annotations to add to webhook Pod
podAnnotations: {}
# -- Security context to add to webhook Pod
podSecurityContext: {}
# -- Security context to add to webhook container
securityContext: {}
# -- Resources to add to webhook container
resources: {}
# requests:
# cpu: 10m
# memory: 32Mi
# -- Node selectors to add to controller Pod
nodeSelector: {}
# -- Tolerations to add to controller Pod
tolerations: []
# -- Affinity to add to controller Pod
affinity: {}
certController:
# -- Specifies whether the cert-controller should be created.
enabled: true
image:
repository: ghcr.io/mariadb-operator/mariadb-operator
pullPolicy: IfNotPresent
# -- Image tag to use. By default the chart appVersion is used
tag: ""
imagePullSecrets: []
ha:
# -- Enable high availability
enabled: false
# -- Number of replicas
replicas: 3
# -- CA certificate validity. It must be greater than certValidity.
caValidity: 35064h
# -- Certificate validity.
certValidity: 8766h
# -- Duration used to verify whether a certificate is valid or not.
lookaheadValidity: 2160h
# -- Requeue duration to ensure that certificate gets renewed.
requeueDuration: 5m
serviceMonitor:
# -- Enable cert-controller ServiceMonitor. Metrics must be enabled
enabled: true
# -- Labels to be added to the cert-controller ServiceMonitor
additionalLabels: {}
# release: kube-prometheus-stack
# -- Interval to scrape metrics
interval: 30s
# -- Timeout if metrics can't be retrieved in given time interval
scrapeTimeout: 25s
serviceAccount:
# -- Specifies whether a service account should be created
enabled: true
# -- Automounts the service account token in all containers of the Pod
automount: true
# -- Annotations to add to the service account
annotations: {}
# -- Extra Labels to add to the service account
extraLabels: {}
# -- The name of the service account to use.
# If not set and enabled is true, a name is generated using the fullname template
name: ""
# -- Extra arguments to be passed to the cert-controller entrypoint
extrArgs: []
# -- Extra volumes to pass to cert-controller Pod
extraVolumes: []
# -- Extra volumes to mount to cert-controller container
extraVolumeMounts: []
# -- Annotations to add to cert-controller Pod
podAnnotations: {}
# -- Security context to add to cert-controller Pod
podSecurityContext: {}
# -- Security context to add to cert-controller container
securityContext: {}
# -- Resources to add to cert-controller container
resources: {}
# requests:
# cpu: 10m
# memory: 32Mi
# -- Node selectors to add to controller Pod
nodeSelector: {}
# -- Tolerations to add to controller Pod
tolerations: []
# -- Affinity to add to controller Pod
affinity: {}
+236
View File
@@ -0,0 +1,236 @@
nameOverride: ""
fullnameOverride: ""
image:
repository: ghcr.io/mariadb-operator/mariadb-operator
pullPolicy: IfNotPresent
# -- Image tag to use. By default the chart appVersion is used
tag: ""
imagePullSecrets: []
# -- Controller log level
logLevel: INFO
# -- Cluster DNS name
clusterName: cluster.local
ha:
# -- Enable high availability
enabled: false
# -- Number of replicas
replicas: 3
metrics:
# -- Enable operator internal metrics. Prometheus must be installed in the cluster
enabled: false
serviceMonitor:
# -- Enable controller ServiceMonitor
enabled: true
# -- Labels to be added to the controller ServiceMonitor
additionalLabels: {}
# release: kube-prometheus-stack
# -- Interval to scrape metrics
interval: 30s
# -- Timeout if metrics can't be retrieved in given time interval
scrapeTimeout: 25s
serviceAccount:
# -- Specifies whether a service account should be created
enabled: true
# -- Automounts the service account token in all containers of the Pod
automount: true
# -- Annotations to add to the service account
annotations: {}
# -- Extra Labels to add to the service account
extraLabels: {}
# -- The name of the service account to use.
# If not set and enabled is true, a name is generated using the fullname template
name: ""
rbac:
# -- Specifies whether RBAC resources should be created
enabled: true
# -- Extra arguments to be passed to the controller entrypoint
extrArgs: []
# -- Extra environment variables to be passed to the controller
extraEnv: []
# -- Extra volumes to pass to pod.
extraVolumes: []
# -- Extra volumes to mount to the container.
extraVolumeMounts: []
# -- Annotations to add to controller Pod
podAnnotations: {}
# -- Security context to add to controller Pod
podSecurityContext: {}
# -- Security context to add to controller container
securityContext: {}
# -- Resources to add to controller container
resources: {}
# requests:
# cpu: 10m
# memory: 32Mi
# -- Node selectors to add to controller Pod
nodeSelector: {}
# -- Tolerations to add to controller Pod
tolerations: []
# -- Affinity to add to controller Pod
affinity: {}
webhook:
image:
repository: ghcr.io/mariadb-operator/mariadb-operator
pullPolicy: IfNotPresent
# -- Image tag to use. By default the chart appVersion is used
tag: ""
imagePullSecrets: []
ha:
# -- Enable high availability
enabled: false
# -- Number of replicas
replicas: 3
cert:
certManager:
# -- Whether to use cert-manager to issue and rotate the certificate. If set to false, mariadb-operator's cert-controller will be used instead.
enabled: false
# -- Issuer reference to be used in the Certificate resource. If not provided, a self-signed issuer will be used.
issuerRef: {}
# -- Duration to be used in the Certificate resource,
duration: ""
# -- Renew before duration to be used in the Certificate resource.
renewBefore: ""
# -- Annotatioms to be added to webhook TLS secret.
secretAnnotations: {}
# -- Path where the CA certificate will be mounted.
caPath: /tmp/k8s-webhook-server/certificate-authority
# -- Path where the certificate will be mounted.
path: /tmp/k8s-webhook-server/serving-certs
# -- Port to be used by the webhook server
port: 9443
# -- Expose the webhook server in the host network
hostNetwork: false
serviceMonitor:
# -- Enable webhook ServiceMonitor. Metrics must be enabled
enabled: true
# -- Labels to be added to the webhook ServiceMonitor
additionalLabels: {}
# release: kube-prometheus-stack
# -- Interval to scrape metrics
interval: 30s
# -- Timeout if metrics can't be retrieved in given time interval
scrapeTimeout: 25s
serviceAccount:
# -- Specifies whether a service account should be created
enabled: true
# -- Automounts the service account token in all containers of the Pod
automount: true
# -- Annotations to add to the service account
annotations: {}
# -- Extra Labels to add to the service account
extraLabels: {}
# -- The name of the service account to use.
# If not set and enabled is true, a name is generated using the fullname template
name: ""
# -- Annotations for webhook configurations.
annotations: {}
# -- Extra arguments to be passed to the webhook entrypoint
extrArgs: []
# -- Extra volumes to pass to webhook Pod
extraVolumes: []
# -- Extra volumes to mount to webhook container
extraVolumeMounts: []
# -- Annotations to add to webhook Pod
podAnnotations: {}
# -- Security context to add to webhook Pod
podSecurityContext: {}
# -- Security context to add to webhook container
securityContext: {}
# -- Resources to add to webhook container
resources: {}
# requests:
# cpu: 10m
# memory: 32Mi
# -- Node selectors to add to controller Pod
nodeSelector: {}
# -- Tolerations to add to controller Pod
tolerations: []
# -- Affinity to add to controller Pod
affinity: {}
certController:
# -- Specifies whether the cert-controller should be created.
enabled: true
image:
repository: ghcr.io/mariadb-operator/mariadb-operator
pullPolicy: IfNotPresent
# -- Image tag to use. By default the chart appVersion is used
tag: ""
imagePullSecrets: []
ha:
# -- Enable high availability
enabled: false
# -- Number of replicas
replicas: 3
# -- CA certificate validity. It must be greater than certValidity.
caValidity: 35064h
# -- Certificate validity.
certValidity: 8766h
# -- Duration used to verify whether a certificate is valid or not.
lookaheadValidity: 2160h
# -- Requeue duration to ensure that certificate gets renewed.
requeueDuration: 5m
serviceMonitor:
# -- Enable cert-controller ServiceMonitor. Metrics must be enabled
enabled: true
# -- Labels to be added to the cert-controller ServiceMonitor
additionalLabels: {}
# release: kube-prometheus-stack
# -- Interval to scrape metrics
interval: 30s
# -- Timeout if metrics can't be retrieved in given time interval
scrapeTimeout: 25s
serviceAccount:
# -- Specifies whether a service account should be created
enabled: true
# -- Automounts the service account token in all containers of the Pod
automount: true
# -- Annotations to add to the service account
annotations: {}
# -- Extra Labels to add to the service account
extraLabels: {}
# -- The name of the service account to use.
# If not set and enabled is true, a name is generated using the fullname template
name: ""
# -- Extra arguments to be passed to the cert-controller entrypoint
extrArgs: []
# -- Extra volumes to pass to cert-controller Pod
extraVolumes: []
# -- Extra volumes to mount to cert-controller container
extraVolumeMounts: []
# -- Annotations to add to cert-controller Pod
podAnnotations: {}
# -- Security context to add to cert-controller Pod
podSecurityContext: {}
# -- Security context to add to cert-controller container
securityContext: {}
# -- Resources to add to cert-controller container
resources: {}
# requests:
# cpu: 10m
# memory: 32Mi
# -- Node selectors to add to controller Pod
nodeSelector: {}
# -- Tolerations to add to controller Pod
tolerations: []
# -- Affinity to add to controller Pod
affinity: {}