mirror of
https://github.com/outbackdingo/cozystack.git
synced 2026-01-28 18:18:41 +00:00
Compare commits
1 Commits
v0.31.0-rc
...
grafana-on
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4cac2191ea |
@@ -56,7 +56,7 @@ spec:
|
||||
mountPath: /var/lib/grafana
|
||||
containers:
|
||||
- name: grafana
|
||||
image: grafana/grafana:10.1.0
|
||||
image: grafana/grafana:11.2.0
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
readOnlyRootFilesystem: false
|
||||
@@ -64,7 +64,7 @@ spec:
|
||||
failureThreshold: 3
|
||||
env:
|
||||
- name: GF_INSTALL_PLUGINS
|
||||
value: grafana-worldmap-panel,flant-statusmap-panel,grafana-oncall-app,natel-discrete-panel
|
||||
value: grafana-worldmap-panel,flant-statusmap-panel,grafana-oncall-app,natel-discrete-panel,grafana-oncall-app
|
||||
- name: ONCALL_API_URL
|
||||
value: http://grafana-oncall-engine:8080
|
||||
- name: GF_DATABASE_HOST
|
||||
@@ -87,6 +87,13 @@ spec:
|
||||
secretKeyRef:
|
||||
key: password
|
||||
name: grafana-admin-password
|
||||
volumeMounts:
|
||||
- name: grafana-plugins
|
||||
mountPath: /usr/share/grafana/conf/provisioning/plugins/
|
||||
volumes:
|
||||
- name: grafana-plugins
|
||||
configMap:
|
||||
name: grafana-plugins-provisioning
|
||||
ingress:
|
||||
metadata:
|
||||
annotations:
|
||||
@@ -109,3 +116,20 @@ spec:
|
||||
- hosts:
|
||||
- "{{ .Values.host | default (printf "grafana.%s" $host) }}"
|
||||
secretName: grafana-ingress-tls
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: grafana-plugins-provisioning
|
||||
data:
|
||||
on-call.yaml: |
|
||||
apiVersion: 1
|
||||
apps:
|
||||
- type: grafana-oncall-app
|
||||
name: grafana-oncall-app
|
||||
version: v1.9.0
|
||||
disabled: false
|
||||
jsonData:
|
||||
grafanaUrl: "https://grafana.infra.aenix.org"
|
||||
license: "OpenSource"
|
||||
onCallApiUrl: "http://grafana-oncall-engine:8080"
|
||||
|
||||
@@ -24,7 +24,7 @@ spec:
|
||||
oncall:
|
||||
fullnameOverride: grafana-oncall
|
||||
externalGrafana:
|
||||
url: "https://{{ .Values.host | default (printf "grafana.%s" $host) }}/"
|
||||
url: "http://grafana-service:3000"
|
||||
|
||||
externalPostgresql:
|
||||
host: grafana-oncall-db-rw
|
||||
@@ -35,6 +35,6 @@ spec:
|
||||
|
||||
externalRedis:
|
||||
host: rfrm-grafana-oncall
|
||||
existingSecret: {{ .Release.Name }}-oncall-redis-password
|
||||
existingSecret: grafana-oncall-redis-password
|
||||
passwordKey: password
|
||||
{{- end }}
|
||||
|
||||
@@ -18,7 +18,7 @@ stringData:
|
||||
receivers:
|
||||
- name: 'webhook'
|
||||
webhook_configs:
|
||||
- url: http://{{ .Release.Name }}-oncall-engine.{{ .Release.Namespace }}.svc:8080/integrations/v1/alertmanager/Kjb2NWxxSlgGtxz9F4ihovQBB/
|
||||
- url: http://grafana-oncall-engine:8080/integrations/v1/alertmanager/fD8cZuXGPvDyQSNYbUwJgHB6H/
|
||||
---
|
||||
apiVersion: operator.victoriametrics.com/v1beta1
|
||||
kind: VMAlertmanager
|
||||
|
||||
@@ -24,4 +24,4 @@ dependencies:
|
||||
repository: https://prometheus-community.github.io/helm-charts
|
||||
version: 25.8.2
|
||||
digest: sha256:edc9fef449a694cd319135e37ac84f8247ac9ad0c48ac86099dae4e428beb7b7
|
||||
generated: "2024-01-26T17:54:48.132209769Z"
|
||||
generated: "2024-09-04T18:52:49.709787897Z"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
apiVersion: v2
|
||||
appVersion: v1.3.94
|
||||
appVersion: v1.9.22
|
||||
dependencies:
|
||||
- condition: cert-manager.enabled
|
||||
name: cert-manager
|
||||
@@ -36,4 +36,4 @@ dependencies:
|
||||
description: Developer-friendly incident response with brilliant Slack integration
|
||||
name: oncall
|
||||
type: application
|
||||
version: 1.3.94
|
||||
version: 1.9.22
|
||||
|
||||
@@ -65,8 +65,6 @@
|
||||
- name: FEATURE_SLACK_INTEGRATION_ENABLED
|
||||
value: {{ .Values.oncall.slack.enabled | toString | title | quote }}
|
||||
{{- if .Values.oncall.slack.enabled }}
|
||||
- name: SLACK_SLASH_COMMAND_NAME
|
||||
value: "/{{ .Values.oncall.slack.commandName | default "oncall" }}"
|
||||
{{- if .Values.oncall.slack.existingSecret }}
|
||||
- name: SLACK_CLIENT_OAUTH_ID
|
||||
valueFrom:
|
||||
@@ -603,6 +601,13 @@ when broker.type != rabbitmq, we do not need to include rabbitmq environment var
|
||||
{{- end }}
|
||||
|
||||
{{- define "snippet.oncall.smtp.env" -}}
|
||||
{{- $smtpTLS:=.Values.oncall.smtp.tls | default true | toString | title | quote }}
|
||||
{{- $smtpSSL:=.Values.oncall.smtp.ssl | default false | toString | title | quote }}
|
||||
{{- if eq $smtpTLS "\"True\"" }}
|
||||
{{- if eq $smtpSSL "\"True\"" }}
|
||||
{{- fail "cannot set Email (SMTP) to use SSL and TLS at the same time" }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
- name: FEATURE_EMAIL_INTEGRATION_ENABLED
|
||||
value: {{ .Values.oncall.smtp.enabled | toString | title | quote }}
|
||||
{{- if .Values.oncall.smtp.enabled }}
|
||||
@@ -619,7 +624,9 @@ when broker.type != rabbitmq, we do not need to include rabbitmq environment var
|
||||
key: smtp-password
|
||||
optional: true
|
||||
- name: EMAIL_USE_TLS
|
||||
value: {{ .Values.oncall.smtp.tls | default true | toString | title | quote }}
|
||||
value: {{ $smtpTLS }}
|
||||
- name: EMAIL_USE_SSL
|
||||
value: {{ $smtpSSL }}
|
||||
- name: EMAIL_FROM_ADDRESS
|
||||
value: {{ .Values.oncall.smtp.fromEmail | quote }}
|
||||
- name: EMAIL_NOTIFICATIONS_LIMIT
|
||||
|
||||
@@ -12,8 +12,8 @@ metadata:
|
||||
{{- end }}
|
||||
type: Opaque
|
||||
data:
|
||||
{{ include "snippet.oncall.secret.secretKey" . }}: {{ randAlphaNum 40 | b64enc | quote }}
|
||||
{{ include "snippet.oncall.secret.mirageSecretKey" . }}: {{ randAlphaNum 40 | b64enc | quote }}
|
||||
{{ include "snippet.oncall.secret.secretKey" . }}: {{ (.Values.oncall.secrets.secretKey | default (randAlphaNum 40)) | b64enc | quote }}
|
||||
{{ include "snippet.oncall.secret.mirageSecretKey" . }}: {{ (.Values.oncall.secrets.mirageSecretKey | default (randAlphaNum 40)) | b64enc | quote }}
|
||||
---
|
||||
{{- end }}
|
||||
{{- if and (eq .Values.database.type "mysql") (not .Values.mariadb.enabled) (not .Values.externalMysql.existingSecret) }}
|
||||
@@ -46,7 +46,7 @@ data:
|
||||
postgres-password: {{ required "externalPostgresql.password is required if not postgresql.enabled and not externalPostgresql.existingSecret" .Values.externalPostgresql.password | b64enc | quote }}
|
||||
---
|
||||
{{- end }}
|
||||
{{- if and (eq .Values.broker.type "rabbitmq") (not .Values.rabbitmq.enabled) (not .Values.externalRabbitmq.existingSecret) }}
|
||||
{{- if and (eq .Values.broker.type "rabbitmq") (.Values.externalRabbitmq.password) (not .Values.rabbitmq.enabled) (not .Values.externalRabbitmq.existingSecret) }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
@@ -61,7 +61,7 @@ data:
|
||||
rabbitmq-password: {{ required "externalRabbitmq.password is required if not rabbitmq.enabled and not externalRabbitmq.existingSecret" .Values.externalRabbitmq.password | b64enc | quote }}
|
||||
---
|
||||
{{- end }}
|
||||
{{- if and (eq .Values.broker.type "redis") (not .Values.redis.enabled) (not .Values.externalRedis.existingSecret) }}
|
||||
{{- if and (.Values.externalRedis.host) (not .Values.redis.enabled) (not .Values.externalRedis.existingSecret) }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
|
||||
@@ -176,7 +176,7 @@ detached_integrations:
|
||||
# Celery workers pods configuration
|
||||
celery:
|
||||
replicaCount: 1
|
||||
worker_queue: "default,critical,long,slack,telegram,webhook,celery,grafana"
|
||||
worker_queue: "default,critical,long,slack,telegram,webhook,celery,grafana,retry"
|
||||
worker_concurrency: "1"
|
||||
worker_max_tasks_per_child: "100"
|
||||
worker_beat_enabled: "True"
|
||||
@@ -305,8 +305,6 @@ oncall:
|
||||
slack:
|
||||
# Enable the Slack ChatOps integration for the Oncall Engine.
|
||||
enabled: false
|
||||
# Sets the Slack bot slash-command
|
||||
commandName: oncall
|
||||
# clientId configures the Slack app OAuth2 client ID.
|
||||
# api.slack.com/apps/<yourApp> -> Basic Information -> App Credentials -> Client ID
|
||||
clientId: ~
|
||||
@@ -343,6 +341,7 @@ oncall:
|
||||
username: ~
|
||||
password: ~
|
||||
tls: ~
|
||||
ssl: ~
|
||||
fromEmail: ~
|
||||
exporter:
|
||||
enabled: false
|
||||
|
||||
@@ -15,10 +15,10 @@ 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.2
|
||||
version: 0.3.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: "v5.6.0"
|
||||
appVersion: "v5.12.0"
|
||||
|
||||
@@ -7,18 +7,45 @@ linkTitle: "Helm installation"
|
||||
|
||||
[grafana-operator](https://github.com/grafana/grafana-operator) for Kubernetes to manage Grafana instances and grafana resources.
|
||||
|
||||
  
|
||||
  
|
||||
|
||||
## Installation
|
||||
|
||||
This is a OCI helm chart, helm started support OCI in version 3.8.0.
|
||||
|
||||
```shell
|
||||
helm upgrade -i grafana-operator oci://ghcr.io/grafana/helm-charts/grafana-operator --version v5.6.0
|
||||
helm upgrade -i grafana-operator oci://ghcr.io/grafana/helm-charts/grafana-operator --version v5.12.0
|
||||
```
|
||||
|
||||
Sadly helm OCI charts currently don't support searching for available versions of a helm [oci registry](https://github.com/helm/helm/issues/11000).
|
||||
|
||||
### Using Terraform
|
||||
|
||||
To install the helm chart using terraform, make sure you use the right values for `repository` and `name` as shown below:
|
||||
|
||||
```hcl
|
||||
resource "helm_release" "grafana_kubernetes_operator" {
|
||||
name = "grafana-operator"
|
||||
namespace = "default"
|
||||
repository = "oci://ghcr.io/grafana/helm-charts"
|
||||
chart = "grafana-operator"
|
||||
verify = false
|
||||
version = "v5.12.0"
|
||||
}
|
||||
```
|
||||
|
||||
## Upgrading
|
||||
|
||||
Helm does not provide functionality to update custom resource definitions. This can result in the operator misbehaving when a release contains updates to the custom resource definitions.
|
||||
To avoid issues due to outdated or missing definitions, run the following command before updating an existing installation:
|
||||
|
||||
```shell
|
||||
kubectl apply --server-side --force-conflicts -f https://github.com/grafana/grafana-operator/releases/download/v5.12.0/crds.yaml
|
||||
```
|
||||
|
||||
The `--server-side` and `--force-conflict` flags are required to avoid running into issues with the `kubectl.kubernetes.io/last-applied-configuration` annotation.
|
||||
By using server side apply, this annotation is not considered. `--force-conflict` allows kubectl to modify fields previously managed by helm.
|
||||
|
||||
## Development
|
||||
|
||||
For general and helm specific development instructions please read the [CONTRIBUTING.md](../../../CONTRIBUTING.md)
|
||||
@@ -38,24 +65,39 @@ It's easier to just manage this configuration outside of the operator.
|
||||
| additionalLabels | object | `{}` | additional labels to add to all resources |
|
||||
| affinity | object | `{}` | pod affinity |
|
||||
| env | list | `[]` | Additional environment variables |
|
||||
| fullnameOverride | string | `""` | |
|
||||
| extraObjects | list | `[]` | Array of extra K8s objects to deploy |
|
||||
| fullnameOverride | string | `""` | Overrides the fully qualified app name. |
|
||||
| image.pullPolicy | string | `"IfNotPresent"` | The image pull policy to use in grafana operator container |
|
||||
| image.repository | string | `"ghcr.io/grafana/grafana-operator"` | grafana operator image repository |
|
||||
| image.tag | string | `""` | Overrides the image tag whose default is the chart appVersion. |
|
||||
| imagePullSecrets | list | `[]` | image pull secrets |
|
||||
| isOpenShift | bool | `false` | Determines if the target cluster is OpenShift. Additional rbac permissions for routes will be added on OpenShift |
|
||||
| leaderElect | bool | `false` | If you want to run multiple replicas of the grafana-operator, this is not recommended. |
|
||||
| metricsService.metricsPort | int | `9090` | metrics service port |
|
||||
| metricsService.pprofPort | int | `8888` | port for the pprof profiling endpoint |
|
||||
| metricsService.type | string | `"ClusterIP"` | metrics service type |
|
||||
| nameOverride | string | `""` | |
|
||||
| nameOverride | string | `""` | Overrides the name of the chart. |
|
||||
| namespaceOverride | string | `""` | Overrides the namespace name. |
|
||||
| namespaceScope | bool | `false` | If the operator should run in namespace-scope or not, if true the operator will only be able to manage instances in the same namespace |
|
||||
| nodeSelector | object | `{}` | pod node selector |
|
||||
| podAnnotations | object | `{}` | pod annotations |
|
||||
| podSecurityContext | object | `{}` | pod security context |
|
||||
| priorityClassName | string | `""` | pod priority class name |
|
||||
| rbac.create | bool | `true` | Specifies whether to create the ClusterRole and ClusterRoleBinding. If "namespaceScope" is true or "watchNamespaces" is set, this will create Role and RoleBinding instead. |
|
||||
| resources | object | `{}` | grafana operator container resources |
|
||||
| securityContext | object | `{"capabilities":{"drop":["ALL"]},"readOnlyRootFilesystem":true,"runAsNonRoot":true}` | grafana operator container security context |
|
||||
| serviceAccount.annotations | object | `{}` | Annotations to add to the service account |
|
||||
| serviceAccount.create | bool | `true` | Specifies whether a service account should be created |
|
||||
| serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template |
|
||||
| serviceMonitor | object | `{"additionalLabels":{},"enabled":false,"interval":"1m","metricRelabelings":[],"relabelings":[],"scrapeTimeout":"10s","targetLabels":[],"telemetryPath":"/metrics"}` | Enable this to use with Prometheus Operator |
|
||||
| serviceMonitor.additionalLabels | object | `{}` | Set of labels to transfer from the Kubernetes Service onto the target |
|
||||
| serviceMonitor.enabled | bool | `false` | When set true then use a ServiceMonitor to configure scraping |
|
||||
| serviceMonitor.interval | string | `"1m"` | Set how frequently Prometheus should scrape |
|
||||
| serviceMonitor.metricRelabelings | list | `[]` | MetricRelabelConfigs to apply to samples before ingestion |
|
||||
| serviceMonitor.relabelings | list | `[]` | Set relabel_configs as per https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config |
|
||||
| serviceMonitor.scrapeTimeout | string | `"10s"` | Set timeout for scrape |
|
||||
| serviceMonitor.targetLabels | list | `[]` | Set of labels to transfer from the Kubernetes Service onto the target |
|
||||
| serviceMonitor.telemetryPath | string | `"/metrics"` | Set path to metrics path |
|
||||
| tolerations | list | `[]` | pod tolerations |
|
||||
| watchNamespaceSelector | string | `""` | Sets the WATCH_NAMESPACE_SELECTOR environment variable, it defines which namespaces the operator should be listening for based on label and key value pair added on namespace kind. By default it's all namespaces. |
|
||||
| watchNamespaces | string | `""` | Sets the WATCH_NAMESPACE environment variable, it defines which namespaces the operator should be listening for. By default it's all namespaces, if you only want to listen for the same namespace as the operator is deployed to look at namespaceScope. |
|
||||
|
||||
@@ -19,6 +19,34 @@ helm upgrade -i grafana-operator oci://ghcr.io/grafana/helm-charts/grafana-opera
|
||||
|
||||
Sadly helm OCI charts currently don't support searching for available versions of a helm [oci registry](https://github.com/helm/helm/issues/11000).
|
||||
|
||||
### Using Terraform
|
||||
|
||||
To install the helm chart using terraform, make sure you use the right values for `repository` and `name` as shown below:
|
||||
|
||||
```hcl
|
||||
resource "helm_release" "grafana_kubernetes_operator" {
|
||||
name = "grafana-operator"
|
||||
namespace = "default"
|
||||
repository = "oci://ghcr.io/grafana/helm-charts"
|
||||
chart = "grafana-operator"
|
||||
verify = false
|
||||
version = "{{ template "chart.appVersion" . }}"
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## Upgrading
|
||||
|
||||
Helm does not provide functionality to update custom resource definitions. This can result in the operator misbehaving when a release contains updates to the custom resource definitions.
|
||||
To avoid issues due to outdated or missing definitions, run the following command before updating an existing installation:
|
||||
|
||||
```shell
|
||||
kubectl apply --server-side --force-conflicts -f https://github.com/grafana/grafana-operator/releases/download/{{ template "chart.appVersion" . }}/crds.yaml
|
||||
```
|
||||
|
||||
The `--server-side` and `--force-conflict` flags are required to avoid running into issues with the `kubectl.kubernetes.io/last-applied-configuration` annotation.
|
||||
By using server side apply, this annotation is not considered. `--force-conflict` allows kubectl to modify fields previously managed by helm.
|
||||
|
||||
## Development
|
||||
|
||||
For general and helm specific development instructions please read the [CONTRIBUTING.md](../../../CONTRIBUTING.md)
|
||||
|
||||
@@ -0,0 +1,311 @@
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.14.0
|
||||
name: grafanaalertrulegroups.grafana.integreatly.org
|
||||
spec:
|
||||
group: grafana.integreatly.org
|
||||
names:
|
||||
categories:
|
||||
- grafana-operator
|
||||
kind: GrafanaAlertRuleGroup
|
||||
listKind: GrafanaAlertRuleGroupList
|
||||
plural: grafanaalertrulegroups
|
||||
singular: grafanaalertrulegroup
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- name: v1beta1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: GrafanaAlertRuleGroup is the Schema for the grafanaalertrulegroups
|
||||
API
|
||||
properties:
|
||||
apiVersion:
|
||||
description: |-
|
||||
APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
|
||||
type: string
|
||||
kind:
|
||||
description: |-
|
||||
Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated.
|
||||
In CamelCase.
|
||||
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
spec:
|
||||
description: GrafanaAlertRuleGroupSpec defines the desired state of GrafanaAlertRuleGroup
|
||||
properties:
|
||||
allowCrossNamespaceImport:
|
||||
type: boolean
|
||||
folderRef:
|
||||
description: Match GrafanaFolders CRs to infer the uid
|
||||
type: string
|
||||
folderUID:
|
||||
description: |-
|
||||
UID of the folder containing this rule group
|
||||
Overrides the FolderSelector
|
||||
type: string
|
||||
instanceSelector:
|
||||
description: selects Grafanas for import
|
||||
properties:
|
||||
matchExpressions:
|
||||
description: matchExpressions is a list of label selector requirements.
|
||||
The requirements are ANDed.
|
||||
items:
|
||||
description: |-
|
||||
A label selector requirement is a selector that contains values, a key, and an operator that
|
||||
relates the key and values.
|
||||
properties:
|
||||
key:
|
||||
description: key is the label key that the selector applies
|
||||
to.
|
||||
type: string
|
||||
operator:
|
||||
description: |-
|
||||
operator represents a key's relationship to a set of values.
|
||||
Valid operators are In, NotIn, Exists and DoesNotExist.
|
||||
type: string
|
||||
values:
|
||||
description: |-
|
||||
values is an array of string values. If the operator is In or NotIn,
|
||||
the values array must be non-empty. If the operator is Exists or DoesNotExist,
|
||||
the values array must be empty. This array is replaced during a strategic
|
||||
merge patch.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
x-kubernetes-list-type: atomic
|
||||
required:
|
||||
- key
|
||||
- operator
|
||||
type: object
|
||||
type: array
|
||||
x-kubernetes-list-type: atomic
|
||||
matchLabels:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: |-
|
||||
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
|
||||
map is equivalent to an element of matchExpressions, whose key field is "key", the
|
||||
operator is "In", and the values array contains only "value". The requirements are ANDed.
|
||||
type: object
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
x-kubernetes-validations:
|
||||
- message: Value is immutable
|
||||
rule: self == oldSelf
|
||||
interval:
|
||||
format: duration
|
||||
pattern: ^([0-9]+(\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$
|
||||
type: string
|
||||
resyncPeriod:
|
||||
default: 10m
|
||||
format: duration
|
||||
pattern: ^([0-9]+(\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$
|
||||
type: string
|
||||
rules:
|
||||
items:
|
||||
description: AlertRule defines a specific rule to be evaluated.
|
||||
It is based on the upstream model with some k8s specific type
|
||||
mappings
|
||||
properties:
|
||||
annotations:
|
||||
additionalProperties:
|
||||
type: string
|
||||
type: object
|
||||
condition:
|
||||
type: string
|
||||
data:
|
||||
items:
|
||||
properties:
|
||||
datasourceUid:
|
||||
description: Grafana data source unique identifier; it
|
||||
should be '__expr__' for a Server Side Expression operation.
|
||||
type: string
|
||||
model:
|
||||
description: JSON is the raw JSON query and includes the
|
||||
above properties as well as custom properties.
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
queryType:
|
||||
description: |-
|
||||
QueryType is an optional identifier for the type of query.
|
||||
It can be used to distinguish different types of queries.
|
||||
type: string
|
||||
refId:
|
||||
description: RefID is the unique identifier of the query,
|
||||
set by the frontend call.
|
||||
type: string
|
||||
relativeTimeRange:
|
||||
description: relative time range
|
||||
properties:
|
||||
from:
|
||||
description: from
|
||||
format: int64
|
||||
type: integer
|
||||
to:
|
||||
description: to
|
||||
format: int64
|
||||
type: integer
|
||||
type: object
|
||||
type: object
|
||||
type: array
|
||||
execErrState:
|
||||
enum:
|
||||
- OK
|
||||
- Alerting
|
||||
- Error
|
||||
- KeepLast
|
||||
type: string
|
||||
for:
|
||||
format: duration
|
||||
pattern: ^([0-9]+(\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$
|
||||
type: string
|
||||
isPaused:
|
||||
type: boolean
|
||||
labels:
|
||||
additionalProperties:
|
||||
type: string
|
||||
type: object
|
||||
noDataState:
|
||||
enum:
|
||||
- Alerting
|
||||
- NoData
|
||||
- OK
|
||||
- KeepLast
|
||||
type: string
|
||||
notificationSettings:
|
||||
properties:
|
||||
group_by:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
group_interval:
|
||||
type: string
|
||||
group_wait:
|
||||
type: string
|
||||
mute_time_intervals:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
receiver:
|
||||
type: string
|
||||
repeat_interval:
|
||||
type: string
|
||||
required:
|
||||
- receiver
|
||||
type: object
|
||||
title:
|
||||
example: Always firing
|
||||
maxLength: 190
|
||||
minLength: 1
|
||||
type: string
|
||||
uid:
|
||||
pattern: ^[a-zA-Z0-9-_]+$
|
||||
type: string
|
||||
required:
|
||||
- condition
|
||||
- data
|
||||
- execErrState
|
||||
- for
|
||||
- noDataState
|
||||
- title
|
||||
- uid
|
||||
type: object
|
||||
type: array
|
||||
required:
|
||||
- instanceSelector
|
||||
- interval
|
||||
- rules
|
||||
type: object
|
||||
x-kubernetes-validations:
|
||||
- message: Only one of FolderUID or FolderRef can be set
|
||||
rule: (has(self.folderUID) && !(has(self.folderRef))) || (has(self.folderRef)
|
||||
&& !(has(self.folderUID)))
|
||||
status:
|
||||
description: GrafanaAlertRuleGroupStatus defines the observed state of
|
||||
GrafanaAlertRuleGroup
|
||||
properties:
|
||||
conditions:
|
||||
items:
|
||||
description: "Condition contains details for one aspect of the current
|
||||
state of this API Resource.\n---\nThis struct is intended for
|
||||
direct use as an array at the field path .status.conditions. For
|
||||
example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
|
||||
observations of a foo's current state.\n\t // Known .status.conditions.type
|
||||
are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
|
||||
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
|
||||
\ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
|
||||
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
|
||||
\ // other fields\n\t}"
|
||||
properties:
|
||||
lastTransitionTime:
|
||||
description: |-
|
||||
lastTransitionTime is the last time the condition transitioned from one status to another.
|
||||
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
|
||||
format: date-time
|
||||
type: string
|
||||
message:
|
||||
description: |-
|
||||
message is a human readable message indicating details about the transition.
|
||||
This may be an empty string.
|
||||
maxLength: 32768
|
||||
type: string
|
||||
observedGeneration:
|
||||
description: |-
|
||||
observedGeneration represents the .metadata.generation that the condition was set based upon.
|
||||
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
|
||||
with respect to the current state of the instance.
|
||||
format: int64
|
||||
minimum: 0
|
||||
type: integer
|
||||
reason:
|
||||
description: |-
|
||||
reason contains a programmatic identifier indicating the reason for the condition's last transition.
|
||||
Producers of specific condition types may define expected values and meanings for this field,
|
||||
and whether the values are considered a guaranteed API.
|
||||
The value should be a CamelCase string.
|
||||
This field may not be empty.
|
||||
maxLength: 1024
|
||||
minLength: 1
|
||||
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
|
||||
type: string
|
||||
status:
|
||||
description: status of the condition, one of True, False, Unknown.
|
||||
enum:
|
||||
- "True"
|
||||
- "False"
|
||||
- Unknown
|
||||
type: string
|
||||
type:
|
||||
description: |-
|
||||
type of condition in CamelCase or in foo.example.com/CamelCase.
|
||||
---
|
||||
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
|
||||
useful (see .node.status.conditions), the ability to deconflict is important.
|
||||
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
|
||||
maxLength: 316
|
||||
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
|
||||
type: string
|
||||
required:
|
||||
- lastTransitionTime
|
||||
- message
|
||||
- reason
|
||||
- status
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
required:
|
||||
- conditions
|
||||
type: object
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
subresources:
|
||||
status: {}
|
||||
@@ -0,0 +1,219 @@
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.14.0
|
||||
name: grafanacontactpoints.grafana.integreatly.org
|
||||
spec:
|
||||
group: grafana.integreatly.org
|
||||
names:
|
||||
categories:
|
||||
- grafana-operator
|
||||
kind: GrafanaContactPoint
|
||||
listKind: GrafanaContactPointList
|
||||
plural: grafanacontactpoints
|
||||
singular: grafanacontactpoint
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- name: v1beta1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: GrafanaContactPoint is the Schema for the grafanacontactpoints
|
||||
API
|
||||
properties:
|
||||
apiVersion:
|
||||
description: |-
|
||||
APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
|
||||
type: string
|
||||
kind:
|
||||
description: |-
|
||||
Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated.
|
||||
In CamelCase.
|
||||
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
spec:
|
||||
description: GrafanaContactPointSpec defines the desired state of GrafanaContactPoint
|
||||
properties:
|
||||
allowCrossNamespaceImport:
|
||||
type: boolean
|
||||
disableResolveMessage:
|
||||
type: boolean
|
||||
instanceSelector:
|
||||
description: selects Grafanas for import
|
||||
properties:
|
||||
matchExpressions:
|
||||
description: matchExpressions is a list of label selector requirements.
|
||||
The requirements are ANDed.
|
||||
items:
|
||||
description: |-
|
||||
A label selector requirement is a selector that contains values, a key, and an operator that
|
||||
relates the key and values.
|
||||
properties:
|
||||
key:
|
||||
description: key is the label key that the selector applies
|
||||
to.
|
||||
type: string
|
||||
operator:
|
||||
description: |-
|
||||
operator represents a key's relationship to a set of values.
|
||||
Valid operators are In, NotIn, Exists and DoesNotExist.
|
||||
type: string
|
||||
values:
|
||||
description: |-
|
||||
values is an array of string values. If the operator is In or NotIn,
|
||||
the values array must be non-empty. If the operator is Exists or DoesNotExist,
|
||||
the values array must be empty. This array is replaced during a strategic
|
||||
merge patch.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
x-kubernetes-list-type: atomic
|
||||
required:
|
||||
- key
|
||||
- operator
|
||||
type: object
|
||||
type: array
|
||||
x-kubernetes-list-type: atomic
|
||||
matchLabels:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: |-
|
||||
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
|
||||
map is equivalent to an element of matchExpressions, whose key field is "key", the
|
||||
operator is "In", and the values array contains only "value". The requirements are ANDed.
|
||||
type: object
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
x-kubernetes-validations:
|
||||
- message: Value is immutable
|
||||
rule: self == oldSelf
|
||||
name:
|
||||
type: string
|
||||
resyncPeriod:
|
||||
default: 10m
|
||||
format: duration
|
||||
pattern: ^([0-9]+(\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$
|
||||
type: string
|
||||
settings:
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
type:
|
||||
enum:
|
||||
- alertmanager
|
||||
- prometheus-alertmanager
|
||||
- dingding
|
||||
- discord
|
||||
- email
|
||||
- googlechat
|
||||
- kafka
|
||||
- line
|
||||
- opsgenie
|
||||
- pagerduty
|
||||
- pushover
|
||||
- sensugo
|
||||
- sensu
|
||||
- slack
|
||||
- teams
|
||||
- telegram
|
||||
- threema
|
||||
- victorops
|
||||
- webhook
|
||||
- wecom
|
||||
- hipchat
|
||||
- oncall
|
||||
type: string
|
||||
required:
|
||||
- instanceSelector
|
||||
- name
|
||||
- settings
|
||||
type: object
|
||||
status:
|
||||
description: GrafanaContactPointStatus defines the observed state of GrafanaContactPoint
|
||||
properties:
|
||||
conditions:
|
||||
description: |-
|
||||
INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
|
||||
Important: Run "make" to regenerate code after modifying this file
|
||||
items:
|
||||
description: "Condition contains details for one aspect of the current
|
||||
state of this API Resource.\n---\nThis struct is intended for
|
||||
direct use as an array at the field path .status.conditions. For
|
||||
example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
|
||||
observations of a foo's current state.\n\t // Known .status.conditions.type
|
||||
are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
|
||||
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
|
||||
\ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
|
||||
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
|
||||
\ // other fields\n\t}"
|
||||
properties:
|
||||
lastTransitionTime:
|
||||
description: |-
|
||||
lastTransitionTime is the last time the condition transitioned from one status to another.
|
||||
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
|
||||
format: date-time
|
||||
type: string
|
||||
message:
|
||||
description: |-
|
||||
message is a human readable message indicating details about the transition.
|
||||
This may be an empty string.
|
||||
maxLength: 32768
|
||||
type: string
|
||||
observedGeneration:
|
||||
description: |-
|
||||
observedGeneration represents the .metadata.generation that the condition was set based upon.
|
||||
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
|
||||
with respect to the current state of the instance.
|
||||
format: int64
|
||||
minimum: 0
|
||||
type: integer
|
||||
reason:
|
||||
description: |-
|
||||
reason contains a programmatic identifier indicating the reason for the condition's last transition.
|
||||
Producers of specific condition types may define expected values and meanings for this field,
|
||||
and whether the values are considered a guaranteed API.
|
||||
The value should be a CamelCase string.
|
||||
This field may not be empty.
|
||||
maxLength: 1024
|
||||
minLength: 1
|
||||
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
|
||||
type: string
|
||||
status:
|
||||
description: status of the condition, one of True, False, Unknown.
|
||||
enum:
|
||||
- "True"
|
||||
- "False"
|
||||
- Unknown
|
||||
type: string
|
||||
type:
|
||||
description: |-
|
||||
type of condition in CamelCase or in foo.example.com/CamelCase.
|
||||
---
|
||||
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
|
||||
useful (see .node.status.conditions), the ability to deconflict is important.
|
||||
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
|
||||
maxLength: 316
|
||||
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
|
||||
type: string
|
||||
required:
|
||||
- lastTransitionTime
|
||||
- message
|
||||
- reason
|
||||
- status
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
required:
|
||||
- conditions
|
||||
type: object
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
subresources:
|
||||
status: {}
|
||||
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.12.0
|
||||
controller-gen.kubebuilder.io/version: v0.14.0
|
||||
name: grafanadashboards.grafana.integreatly.org
|
||||
spec:
|
||||
group: grafana.integreatly.org
|
||||
@@ -28,32 +28,62 @@ spec:
|
||||
name: v1beta1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: GrafanaDashboard is the Schema for the grafanadashboards API
|
||||
properties:
|
||||
apiVersion:
|
||||
description: |-
|
||||
APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
|
||||
type: string
|
||||
kind:
|
||||
description: |-
|
||||
Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated.
|
||||
In CamelCase.
|
||||
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
spec:
|
||||
description: GrafanaDashboardSpec defines the desired state of GrafanaDashboard
|
||||
properties:
|
||||
allowCrossNamespaceImport:
|
||||
description: allow to import this resources from an operator in a
|
||||
different namespace
|
||||
type: boolean
|
||||
configMapRef:
|
||||
description: dashboard from configmap
|
||||
properties:
|
||||
key:
|
||||
description: The key to select.
|
||||
type: string
|
||||
name:
|
||||
default: ""
|
||||
description: |-
|
||||
Name of the referent.
|
||||
This field is effectively required, but due to backwards compatibility is
|
||||
allowed to be empty. Instances of this type with an empty value here are
|
||||
almost certainly wrong.
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?
|
||||
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the ConfigMap or its key must be
|
||||
defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
contentCacheDuration:
|
||||
description: Cache duration for dashboards fetched from URLs
|
||||
type: string
|
||||
datasources:
|
||||
description: maps required data sources to existing ones
|
||||
items:
|
||||
properties:
|
||||
datasourceName:
|
||||
@@ -66,27 +96,55 @@ spec:
|
||||
type: object
|
||||
type: array
|
||||
envFrom:
|
||||
description: environments variables from secrets or config maps
|
||||
items:
|
||||
properties:
|
||||
configMapKeyRef:
|
||||
description: Selects a key of a ConfigMap.
|
||||
properties:
|
||||
key:
|
||||
description: The key to select.
|
||||
type: string
|
||||
name:
|
||||
default: ""
|
||||
description: |-
|
||||
Name of the referent.
|
||||
This field is effectively required, but due to backwards compatibility is
|
||||
allowed to be empty. Instances of this type with an empty value here are
|
||||
almost certainly wrong.
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?
|
||||
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the ConfigMap or its key must
|
||||
be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
secretKeyRef:
|
||||
description: Selects a key of a Secret.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
default: ""
|
||||
description: |-
|
||||
Name of the referent.
|
||||
This field is effectively required, but due to backwards compatibility is
|
||||
allowed to be empty. Instances of this type with an empty value here are
|
||||
almost certainly wrong.
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?
|
||||
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must
|
||||
be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
@@ -95,33 +153,64 @@ spec:
|
||||
type: object
|
||||
type: array
|
||||
envs:
|
||||
description: environments variables as a map
|
||||
items:
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
value:
|
||||
description: Inline evn value
|
||||
type: string
|
||||
valueFrom:
|
||||
description: Reference on value source, might be the reference
|
||||
on a secret or config map
|
||||
properties:
|
||||
configMapKeyRef:
|
||||
description: Selects a key of a ConfigMap.
|
||||
properties:
|
||||
key:
|
||||
description: The key to select.
|
||||
type: string
|
||||
name:
|
||||
default: ""
|
||||
description: |-
|
||||
Name of the referent.
|
||||
This field is effectively required, but due to backwards compatibility is
|
||||
allowed to be empty. Instances of this type with an empty value here are
|
||||
almost certainly wrong.
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?
|
||||
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the ConfigMap or its key
|
||||
must be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
secretKeyRef:
|
||||
description: Selects a key of a Secret.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
default: ""
|
||||
description: |-
|
||||
Name of the referent.
|
||||
This field is effectively required, but due to backwards compatibility is
|
||||
allowed to be empty. Instances of this type with an empty value here are
|
||||
almost certainly wrong.
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?
|
||||
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must
|
||||
be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
@@ -133,8 +222,16 @@ spec:
|
||||
type: object
|
||||
type: array
|
||||
folder:
|
||||
description: folder assignment for dashboard
|
||||
type: string
|
||||
folderRef:
|
||||
description: Name of a `GrafanaFolder` resource in the same namespace
|
||||
type: string
|
||||
folderUID:
|
||||
description: UID of the target folder for this dashboard
|
||||
type: string
|
||||
grafanaCom:
|
||||
description: grafana.com/dashboards
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
@@ -144,37 +241,67 @@ spec:
|
||||
- id
|
||||
type: object
|
||||
gzipJson:
|
||||
description: GzipJson the dashboard's JSON compressed with Gzip. Base64-encoded
|
||||
when in YAML.
|
||||
format: byte
|
||||
type: string
|
||||
instanceSelector:
|
||||
description: selects Grafanas for import
|
||||
properties:
|
||||
matchExpressions:
|
||||
description: matchExpressions is a list of label selector requirements.
|
||||
The requirements are ANDed.
|
||||
items:
|
||||
description: |-
|
||||
A label selector requirement is a selector that contains values, a key, and an operator that
|
||||
relates the key and values.
|
||||
properties:
|
||||
key:
|
||||
description: key is the label key that the selector applies
|
||||
to.
|
||||
type: string
|
||||
operator:
|
||||
description: |-
|
||||
operator represents a key's relationship to a set of values.
|
||||
Valid operators are In, NotIn, Exists and DoesNotExist.
|
||||
type: string
|
||||
values:
|
||||
description: |-
|
||||
values is an array of string values. If the operator is In or NotIn,
|
||||
the values array must be non-empty. If the operator is Exists or DoesNotExist,
|
||||
the values array must be empty. This array is replaced during a strategic
|
||||
merge patch.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
x-kubernetes-list-type: atomic
|
||||
required:
|
||||
- key
|
||||
- operator
|
||||
type: object
|
||||
type: array
|
||||
x-kubernetes-list-type: atomic
|
||||
matchLabels:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: |-
|
||||
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
|
||||
map is equivalent to an element of matchExpressions, whose key field is "key", the
|
||||
operator is "In", and the values array contains only "value". The requirements are ANDed.
|
||||
type: object
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
x-kubernetes-validations:
|
||||
- message: Value is immutable
|
||||
rule: self == oldSelf
|
||||
json:
|
||||
description: dashboard json
|
||||
type: string
|
||||
jsonnet:
|
||||
description: Jsonnet
|
||||
type: string
|
||||
jsonnetLib:
|
||||
description: Jsonnet project build
|
||||
properties:
|
||||
fileName:
|
||||
type: string
|
||||
@@ -190,6 +317,7 @@ spec:
|
||||
- gzipJsonnetProject
|
||||
type: object
|
||||
plugins:
|
||||
description: plugins
|
||||
items:
|
||||
properties:
|
||||
name:
|
||||
@@ -202,16 +330,162 @@ spec:
|
||||
type: object
|
||||
type: array
|
||||
resyncPeriod:
|
||||
default: 5m
|
||||
description: how often the dashboard is refreshed, defaults to 5m
|
||||
if not set
|
||||
format: duration
|
||||
pattern: ^([0-9]+(\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$
|
||||
type: string
|
||||
url:
|
||||
description: dashboard url
|
||||
type: string
|
||||
urlAuthorization:
|
||||
description: authorization options for dashboard from url
|
||||
properties:
|
||||
basicAuth:
|
||||
properties:
|
||||
password:
|
||||
description: SecretKeySelector selects a key of a Secret.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
default: ""
|
||||
description: |-
|
||||
Name of the referent.
|
||||
This field is effectively required, but due to backwards compatibility is
|
||||
allowed to be empty. Instances of this type with an empty value here are
|
||||
almost certainly wrong.
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?
|
||||
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must
|
||||
be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
username:
|
||||
description: SecretKeySelector selects a key of a Secret.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
default: ""
|
||||
description: |-
|
||||
Name of the referent.
|
||||
This field is effectively required, but due to backwards compatibility is
|
||||
allowed to be empty. Instances of this type with an empty value here are
|
||||
almost certainly wrong.
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?
|
||||
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must
|
||||
be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type: object
|
||||
type: object
|
||||
required:
|
||||
- instanceSelector
|
||||
type: object
|
||||
x-kubernetes-validations:
|
||||
- message: Only one of folderUID or folderRef can be declared at the same
|
||||
time
|
||||
rule: (has(self.folderUID) && !(has(self.folderRef))) || (has(self.folderRef)
|
||||
&& !(has(self.folderUID))) || !(has(self.folderRef) && (has(self.folderUID)))
|
||||
- message: folder field cannot be set when folderUID or folderRef is already
|
||||
declared
|
||||
rule: (has(self.folder) && !(has(self.folderRef) || has(self.folderUID)))
|
||||
|| !(has(self.folder))
|
||||
status:
|
||||
description: GrafanaDashboardStatus defines the observed state of GrafanaDashboard
|
||||
properties:
|
||||
NoMatchingInstances:
|
||||
description: The dashboard instanceSelector can't find matching grafana
|
||||
instances
|
||||
type: boolean
|
||||
conditions:
|
||||
items:
|
||||
description: "Condition contains details for one aspect of the current
|
||||
state of this API Resource.\n---\nThis struct is intended for
|
||||
direct use as an array at the field path .status.conditions. For
|
||||
example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
|
||||
observations of a foo's current state.\n\t // Known .status.conditions.type
|
||||
are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
|
||||
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
|
||||
\ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
|
||||
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
|
||||
\ // other fields\n\t}"
|
||||
properties:
|
||||
lastTransitionTime:
|
||||
description: |-
|
||||
lastTransitionTime is the last time the condition transitioned from one status to another.
|
||||
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
|
||||
format: date-time
|
||||
type: string
|
||||
message:
|
||||
description: |-
|
||||
message is a human readable message indicating details about the transition.
|
||||
This may be an empty string.
|
||||
maxLength: 32768
|
||||
type: string
|
||||
observedGeneration:
|
||||
description: |-
|
||||
observedGeneration represents the .metadata.generation that the condition was set based upon.
|
||||
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
|
||||
with respect to the current state of the instance.
|
||||
format: int64
|
||||
minimum: 0
|
||||
type: integer
|
||||
reason:
|
||||
description: |-
|
||||
reason contains a programmatic identifier indicating the reason for the condition's last transition.
|
||||
Producers of specific condition types may define expected values and meanings for this field,
|
||||
and whether the values are considered a guaranteed API.
|
||||
The value should be a CamelCase string.
|
||||
This field may not be empty.
|
||||
maxLength: 1024
|
||||
minLength: 1
|
||||
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
|
||||
type: string
|
||||
status:
|
||||
description: status of the condition, one of True, False, Unknown.
|
||||
enum:
|
||||
- "True"
|
||||
- "False"
|
||||
- Unknown
|
||||
type: string
|
||||
type:
|
||||
description: |-
|
||||
type of condition in CamelCase or in foo.example.com/CamelCase.
|
||||
---
|
||||
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
|
||||
useful (see .node.status.conditions), the ability to deconflict is important.
|
||||
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
|
||||
maxLength: 316
|
||||
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
|
||||
type: string
|
||||
required:
|
||||
- lastTransitionTime
|
||||
- message
|
||||
- reason
|
||||
- status
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
contentCache:
|
||||
format: byte
|
||||
type: string
|
||||
@@ -223,6 +497,7 @@ spec:
|
||||
hash:
|
||||
type: string
|
||||
lastResync:
|
||||
description: Last time the dashboard was resynced
|
||||
format: date-time
|
||||
type: string
|
||||
uid:
|
||||
|
||||
@@ -3,11 +3,13 @@ apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.12.0
|
||||
controller-gen.kubebuilder.io/version: v0.14.0
|
||||
name: grafanadatasources.grafana.integreatly.org
|
||||
spec:
|
||||
group: grafana.integreatly.org
|
||||
names:
|
||||
categories:
|
||||
- grafana-operator
|
||||
kind: GrafanaDatasource
|
||||
listKind: GrafanaDatasourceList
|
||||
plural: grafanadatasources
|
||||
@@ -28,16 +30,31 @@ spec:
|
||||
name: v1beta1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: GrafanaDatasource is the Schema for the grafanadatasources API
|
||||
properties:
|
||||
apiVersion:
|
||||
description: |-
|
||||
APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
|
||||
type: string
|
||||
kind:
|
||||
description: |-
|
||||
Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated.
|
||||
In CamelCase.
|
||||
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
spec:
|
||||
description: GrafanaDatasourceSpec defines the desired state of GrafanaDatasource
|
||||
properties:
|
||||
allowCrossNamespaceImport:
|
||||
description: allow to import this resources from an operator in a
|
||||
different namespace
|
||||
type: boolean
|
||||
datasource:
|
||||
properties:
|
||||
@@ -50,6 +67,7 @@ spec:
|
||||
database:
|
||||
type: string
|
||||
editable:
|
||||
description: Deprecated field, it has no effect
|
||||
type: boolean
|
||||
isDefault:
|
||||
type: boolean
|
||||
@@ -59,6 +77,7 @@ spec:
|
||||
name:
|
||||
type: string
|
||||
orgId:
|
||||
description: Deprecated field, it has no effect
|
||||
format: int64
|
||||
type: integer
|
||||
secureJsonData:
|
||||
@@ -72,37 +91,58 @@ spec:
|
||||
type: string
|
||||
user:
|
||||
type: string
|
||||
required:
|
||||
- access
|
||||
- name
|
||||
- type
|
||||
- url
|
||||
type: object
|
||||
instanceSelector:
|
||||
description: selects Grafana instances for import
|
||||
properties:
|
||||
matchExpressions:
|
||||
description: matchExpressions is a list of label selector requirements.
|
||||
The requirements are ANDed.
|
||||
items:
|
||||
description: |-
|
||||
A label selector requirement is a selector that contains values, a key, and an operator that
|
||||
relates the key and values.
|
||||
properties:
|
||||
key:
|
||||
description: key is the label key that the selector applies
|
||||
to.
|
||||
type: string
|
||||
operator:
|
||||
description: |-
|
||||
operator represents a key's relationship to a set of values.
|
||||
Valid operators are In, NotIn, Exists and DoesNotExist.
|
||||
type: string
|
||||
values:
|
||||
description: |-
|
||||
values is an array of string values. If the operator is In or NotIn,
|
||||
the values array must be non-empty. If the operator is Exists or DoesNotExist,
|
||||
the values array must be empty. This array is replaced during a strategic
|
||||
merge patch.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
x-kubernetes-list-type: atomic
|
||||
required:
|
||||
- key
|
||||
- operator
|
||||
type: object
|
||||
type: array
|
||||
x-kubernetes-list-type: atomic
|
||||
matchLabels:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: |-
|
||||
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
|
||||
map is equivalent to an element of matchExpressions, whose key field is "key", the
|
||||
operator is "In", and the values array contains only "value". The requirements are ANDed.
|
||||
type: object
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
x-kubernetes-validations:
|
||||
- message: Value is immutable
|
||||
rule: self == oldSelf
|
||||
plugins:
|
||||
description: plugins
|
||||
items:
|
||||
properties:
|
||||
name:
|
||||
@@ -115,8 +155,14 @@ spec:
|
||||
type: object
|
||||
type: array
|
||||
resyncPeriod:
|
||||
default: 5m
|
||||
description: how often the datasource is refreshed, defaults to 5m
|
||||
if not set
|
||||
format: duration
|
||||
pattern: ^([0-9]+(\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$
|
||||
type: string
|
||||
valuesFrom:
|
||||
description: environments variables from secrets or config maps
|
||||
items:
|
||||
properties:
|
||||
targetPath:
|
||||
@@ -124,24 +170,51 @@ spec:
|
||||
valueFrom:
|
||||
properties:
|
||||
configMapKeyRef:
|
||||
description: Selects a key of a ConfigMap.
|
||||
properties:
|
||||
key:
|
||||
description: The key to select.
|
||||
type: string
|
||||
name:
|
||||
default: ""
|
||||
description: |-
|
||||
Name of the referent.
|
||||
This field is effectively required, but due to backwards compatibility is
|
||||
allowed to be empty. Instances of this type with an empty value here are
|
||||
almost certainly wrong.
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?
|
||||
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the ConfigMap or its key
|
||||
must be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
secretKeyRef:
|
||||
description: Selects a key of a Secret.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
default: ""
|
||||
description: |-
|
||||
Name of the referent.
|
||||
This field is effectively required, but due to backwards compatibility is
|
||||
allowed to be empty. Instances of this type with an empty value here are
|
||||
almost certainly wrong.
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?
|
||||
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must
|
||||
be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
@@ -158,14 +231,18 @@ spec:
|
||||
- instanceSelector
|
||||
type: object
|
||||
status:
|
||||
description: GrafanaDatasourceStatus defines the observed state of GrafanaDatasource
|
||||
properties:
|
||||
NoMatchingInstances:
|
||||
description: The datasource instanceSelector can't find matching grafana
|
||||
instances
|
||||
type: boolean
|
||||
hash:
|
||||
type: string
|
||||
lastMessage:
|
||||
type: string
|
||||
lastResync:
|
||||
description: Last time the datasource was resynced
|
||||
format: date-time
|
||||
type: string
|
||||
uid:
|
||||
|
||||
@@ -3,11 +3,13 @@ apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.12.0
|
||||
controller-gen.kubebuilder.io/version: v0.14.0
|
||||
name: grafanafolders.grafana.integreatly.org
|
||||
spec:
|
||||
group: grafana.integreatly.org
|
||||
names:
|
||||
categories:
|
||||
- grafana-operator
|
||||
kind: GrafanaFolder
|
||||
listKind: GrafanaFolderList
|
||||
plural: grafanafolders
|
||||
@@ -24,57 +26,192 @@ spec:
|
||||
name: v1beta1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: GrafanaFolder is the Schema for the grafanafolders API
|
||||
properties:
|
||||
apiVersion:
|
||||
description: |-
|
||||
APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
|
||||
type: string
|
||||
kind:
|
||||
description: |-
|
||||
Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated.
|
||||
In CamelCase.
|
||||
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
spec:
|
||||
description: GrafanaFolderSpec defines the desired state of GrafanaFolder
|
||||
properties:
|
||||
allowCrossNamespaceImport:
|
||||
description: allow to import this resources from an operator in a
|
||||
different namespace
|
||||
type: boolean
|
||||
instanceSelector:
|
||||
description: selects Grafanas for import
|
||||
properties:
|
||||
matchExpressions:
|
||||
description: matchExpressions is a list of label selector requirements.
|
||||
The requirements are ANDed.
|
||||
items:
|
||||
description: |-
|
||||
A label selector requirement is a selector that contains values, a key, and an operator that
|
||||
relates the key and values.
|
||||
properties:
|
||||
key:
|
||||
description: key is the label key that the selector applies
|
||||
to.
|
||||
type: string
|
||||
operator:
|
||||
description: |-
|
||||
operator represents a key's relationship to a set of values.
|
||||
Valid operators are In, NotIn, Exists and DoesNotExist.
|
||||
type: string
|
||||
values:
|
||||
description: |-
|
||||
values is an array of string values. If the operator is In or NotIn,
|
||||
the values array must be non-empty. If the operator is Exists or DoesNotExist,
|
||||
the values array must be empty. This array is replaced during a strategic
|
||||
merge patch.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
x-kubernetes-list-type: atomic
|
||||
required:
|
||||
- key
|
||||
- operator
|
||||
type: object
|
||||
type: array
|
||||
x-kubernetes-list-type: atomic
|
||||
matchLabels:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: |-
|
||||
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
|
||||
map is equivalent to an element of matchExpressions, whose key field is "key", the
|
||||
operator is "In", and the values array contains only "value". The requirements are ANDed.
|
||||
type: object
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
x-kubernetes-validations:
|
||||
- message: Value is immutable
|
||||
rule: self == oldSelf
|
||||
parentFolderRef:
|
||||
description: Reference to an existing GrafanaFolder CR in the same
|
||||
namespace
|
||||
type: string
|
||||
parentFolderUID:
|
||||
description: UID of the folder in which the current folder should
|
||||
be created
|
||||
type: string
|
||||
permissions:
|
||||
description: raw json with folder permissions
|
||||
type: string
|
||||
resyncPeriod:
|
||||
default: 5m
|
||||
description: how often the folder is synced, defaults to 5m if not
|
||||
set
|
||||
format: duration
|
||||
pattern: ^([0-9]+(\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$
|
||||
type: string
|
||||
title:
|
||||
type: string
|
||||
required:
|
||||
- instanceSelector
|
||||
type: object
|
||||
x-kubernetes-validations:
|
||||
- message: Only one of parentFolderUID or parentFolderRef can be set
|
||||
rule: (has(self.parentFolderUID) && !(has(self.parentFolderRef))) ||
|
||||
(has(self.parentFolderRef) && !(has(self.parentFolderUID))) || !(has(self.parentFolderRef)
|
||||
&& (has(self.parentFolderUID)))
|
||||
status:
|
||||
description: GrafanaFolderStatus defines the observed state of GrafanaFolder
|
||||
properties:
|
||||
NoMatchingInstances:
|
||||
description: The folder instanceSelector can't find matching grafana
|
||||
instances
|
||||
type: boolean
|
||||
conditions:
|
||||
items:
|
||||
description: "Condition contains details for one aspect of the current
|
||||
state of this API Resource.\n---\nThis struct is intended for
|
||||
direct use as an array at the field path .status.conditions. For
|
||||
example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
|
||||
observations of a foo's current state.\n\t // Known .status.conditions.type
|
||||
are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
|
||||
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
|
||||
\ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
|
||||
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
|
||||
\ // other fields\n\t}"
|
||||
properties:
|
||||
lastTransitionTime:
|
||||
description: |-
|
||||
lastTransitionTime is the last time the condition transitioned from one status to another.
|
||||
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
|
||||
format: date-time
|
||||
type: string
|
||||
message:
|
||||
description: |-
|
||||
message is a human readable message indicating details about the transition.
|
||||
This may be an empty string.
|
||||
maxLength: 32768
|
||||
type: string
|
||||
observedGeneration:
|
||||
description: |-
|
||||
observedGeneration represents the .metadata.generation that the condition was set based upon.
|
||||
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
|
||||
with respect to the current state of the instance.
|
||||
format: int64
|
||||
minimum: 0
|
||||
type: integer
|
||||
reason:
|
||||
description: |-
|
||||
reason contains a programmatic identifier indicating the reason for the condition's last transition.
|
||||
Producers of specific condition types may define expected values and meanings for this field,
|
||||
and whether the values are considered a guaranteed API.
|
||||
The value should be a CamelCase string.
|
||||
This field may not be empty.
|
||||
maxLength: 1024
|
||||
minLength: 1
|
||||
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
|
||||
type: string
|
||||
status:
|
||||
description: status of the condition, one of True, False, Unknown.
|
||||
enum:
|
||||
- "True"
|
||||
- "False"
|
||||
- Unknown
|
||||
type: string
|
||||
type:
|
||||
description: |-
|
||||
type of condition in CamelCase or in foo.example.com/CamelCase.
|
||||
---
|
||||
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
|
||||
useful (see .node.status.conditions), the ability to deconflict is important.
|
||||
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
|
||||
maxLength: 316
|
||||
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
|
||||
type: string
|
||||
required:
|
||||
- lastTransitionTime
|
||||
- message
|
||||
- reason
|
||||
- status
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
hash:
|
||||
description: |-
|
||||
INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
|
||||
Important: Run "make" to regenerate code after modifying this file
|
||||
type: string
|
||||
lastResync:
|
||||
description: Last time the folder was resynced
|
||||
format: date-time
|
||||
type: string
|
||||
type: object
|
||||
|
||||
@@ -0,0 +1,257 @@
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.14.0
|
||||
name: grafananotificationpolicies.grafana.integreatly.org
|
||||
spec:
|
||||
group: grafana.integreatly.org
|
||||
names:
|
||||
categories:
|
||||
- grafana-operator
|
||||
kind: GrafanaNotificationPolicy
|
||||
listKind: GrafanaNotificationPolicyList
|
||||
plural: grafananotificationpolicies
|
||||
singular: grafananotificationpolicy
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- name: v1beta1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: GrafanaNotificationPolicy is the Schema for the GrafanaNotificationPolicy
|
||||
API
|
||||
properties:
|
||||
apiVersion:
|
||||
description: |-
|
||||
APIVersion defines the versioned schema of this representation of an object.
|
||||
Servers should convert recognized schemas to the latest internal value, and
|
||||
may reject unrecognized values.
|
||||
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
|
||||
type: string
|
||||
kind:
|
||||
description: |-
|
||||
Kind is a string value representing the REST resource this object represents.
|
||||
Servers may infer this from the endpoint the client submits requests to.
|
||||
Cannot be updated.
|
||||
In CamelCase.
|
||||
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
spec:
|
||||
description: GrafanaNotificationPolicySpec defines the desired state of
|
||||
GrafanaNotificationPolicy
|
||||
properties:
|
||||
instanceSelector:
|
||||
description: selects Grafanas for import
|
||||
properties:
|
||||
matchExpressions:
|
||||
description: matchExpressions is a list of label selector requirements.
|
||||
The requirements are ANDed.
|
||||
items:
|
||||
description: |-
|
||||
A label selector requirement is a selector that contains values, a key, and an operator that
|
||||
relates the key and values.
|
||||
properties:
|
||||
key:
|
||||
description: key is the label key that the selector applies
|
||||
to.
|
||||
type: string
|
||||
operator:
|
||||
description: |-
|
||||
operator represents a key's relationship to a set of values.
|
||||
Valid operators are In, NotIn, Exists and DoesNotExist.
|
||||
type: string
|
||||
values:
|
||||
description: |-
|
||||
values is an array of string values. If the operator is In or NotIn,
|
||||
the values array must be non-empty. If the operator is Exists or DoesNotExist,
|
||||
the values array must be empty. This array is replaced during a strategic
|
||||
merge patch.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
x-kubernetes-list-type: atomic
|
||||
required:
|
||||
- key
|
||||
- operator
|
||||
type: object
|
||||
type: array
|
||||
x-kubernetes-list-type: atomic
|
||||
matchLabels:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: |-
|
||||
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
|
||||
map is equivalent to an element of matchExpressions, whose key field is "key", the
|
||||
operator is "In", and the values array contains only "value". The requirements are ANDed.
|
||||
type: object
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
x-kubernetes-validations:
|
||||
- message: Value is immutable
|
||||
rule: self == oldSelf
|
||||
resyncPeriod:
|
||||
default: 10m
|
||||
format: duration
|
||||
pattern: ^([0-9]+(\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$
|
||||
type: string
|
||||
route:
|
||||
description: Routes for alerts to match against
|
||||
properties:
|
||||
continue:
|
||||
description: continue
|
||||
type: boolean
|
||||
group_by:
|
||||
description: group by
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
group_interval:
|
||||
description: group interval
|
||||
type: string
|
||||
group_wait:
|
||||
description: group wait
|
||||
type: string
|
||||
match_re:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: match re
|
||||
type: object
|
||||
matchers:
|
||||
description: matchers
|
||||
items:
|
||||
properties:
|
||||
isEqual:
|
||||
description: is equal
|
||||
type: boolean
|
||||
isRegex:
|
||||
description: is regex
|
||||
type: boolean
|
||||
name:
|
||||
description: name
|
||||
type: string
|
||||
value:
|
||||
description: value
|
||||
type: string
|
||||
required:
|
||||
- isRegex
|
||||
- value
|
||||
type: object
|
||||
type: array
|
||||
mute_time_intervals:
|
||||
description: mute time intervals
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
object_matchers:
|
||||
description: object matchers
|
||||
items:
|
||||
description: |-
|
||||
ObjectMatcher ObjectMatcher is a matcher that can be used to filter alerts.
|
||||
|
||||
|
||||
swagger:model ObjectMatcher
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
type: array
|
||||
provenance:
|
||||
description: provenance
|
||||
type: string
|
||||
receiver:
|
||||
description: receiver
|
||||
type: string
|
||||
repeat_interval:
|
||||
description: repeat interval
|
||||
type: string
|
||||
routes:
|
||||
description: routes
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
type: object
|
||||
required:
|
||||
- instanceSelector
|
||||
- route
|
||||
type: object
|
||||
status:
|
||||
description: GrafanaNotificationPolicyStatus defines the observed state
|
||||
of GrafanaNotificationPolicy
|
||||
properties:
|
||||
conditions:
|
||||
items:
|
||||
description: "Condition contains details for one aspect of the current
|
||||
state of this API Resource.\n---\nThis struct is intended for
|
||||
direct use as an array at the field path .status.conditions. For
|
||||
example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
|
||||
observations of a foo's current state.\n\t // Known .status.conditions.type
|
||||
are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
|
||||
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
|
||||
\ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
|
||||
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
|
||||
\ // other fields\n\t}"
|
||||
properties:
|
||||
lastTransitionTime:
|
||||
description: |-
|
||||
lastTransitionTime is the last time the condition transitioned from one status to another.
|
||||
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
|
||||
format: date-time
|
||||
type: string
|
||||
message:
|
||||
description: |-
|
||||
message is a human readable message indicating details about the transition.
|
||||
This may be an empty string.
|
||||
maxLength: 32768
|
||||
type: string
|
||||
observedGeneration:
|
||||
description: |-
|
||||
observedGeneration represents the .metadata.generation that the condition was set based upon.
|
||||
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
|
||||
with respect to the current state of the instance.
|
||||
format: int64
|
||||
minimum: 0
|
||||
type: integer
|
||||
reason:
|
||||
description: |-
|
||||
reason contains a programmatic identifier indicating the reason for the condition's last transition.
|
||||
Producers of specific condition types may define expected values and meanings for this field,
|
||||
and whether the values are considered a guaranteed API.
|
||||
The value should be a CamelCase string.
|
||||
This field may not be empty.
|
||||
maxLength: 1024
|
||||
minLength: 1
|
||||
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
|
||||
type: string
|
||||
status:
|
||||
description: status of the condition, one of True, False, Unknown.
|
||||
enum:
|
||||
- "True"
|
||||
- "False"
|
||||
- Unknown
|
||||
type: string
|
||||
type:
|
||||
description: |-
|
||||
type of condition in CamelCase or in foo.example.com/CamelCase.
|
||||
---
|
||||
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
|
||||
useful (see .node.status.conditions), the ability to deconflict is important.
|
||||
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
|
||||
maxLength: 316
|
||||
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
|
||||
type: string
|
||||
required:
|
||||
- lastTransitionTime
|
||||
- message
|
||||
- reason
|
||||
- status
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
required:
|
||||
- conditions
|
||||
type: object
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
subresources:
|
||||
status: {}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,18 @@
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: manager-role
|
||||
rules:
|
||||
- apiGroups:
|
||||
- route.openshift.io
|
||||
resources:
|
||||
- routes
|
||||
- routes/custom-host
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- update
|
||||
- watch
|
||||
@@ -0,0 +1,250 @@
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: manager-role
|
||||
rules:
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- configmaps
|
||||
- persistentvolumeclaims
|
||||
- secrets
|
||||
- serviceaccounts
|
||||
- services
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- events
|
||||
verbs:
|
||||
- create
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- watch
|
||||
- apiGroups:
|
||||
- apps
|
||||
resources:
|
||||
- deployments
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- coordination.k8s.io
|
||||
resources:
|
||||
- leases
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- grafana.integreatly.org
|
||||
resources:
|
||||
- grafanaalertrulegroups
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- grafana.integreatly.org
|
||||
resources:
|
||||
- grafanaalertrulegroups/finalizers
|
||||
verbs:
|
||||
- update
|
||||
- apiGroups:
|
||||
- grafana.integreatly.org
|
||||
resources:
|
||||
- grafanaalertrulegroups/status
|
||||
verbs:
|
||||
- get
|
||||
- patch
|
||||
- update
|
||||
- apiGroups:
|
||||
- grafana.integreatly.org
|
||||
resources:
|
||||
- grafanacontactpoints
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- grafana.integreatly.org
|
||||
resources:
|
||||
- grafanacontactpoints/finalizers
|
||||
verbs:
|
||||
- update
|
||||
- apiGroups:
|
||||
- grafana.integreatly.org
|
||||
resources:
|
||||
- grafanacontactpoints/status
|
||||
verbs:
|
||||
- get
|
||||
- patch
|
||||
- update
|
||||
- apiGroups:
|
||||
- grafana.integreatly.org
|
||||
resources:
|
||||
- grafanadashboards
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- grafana.integreatly.org
|
||||
resources:
|
||||
- grafanadashboards/finalizers
|
||||
verbs:
|
||||
- update
|
||||
- apiGroups:
|
||||
- grafana.integreatly.org
|
||||
resources:
|
||||
- grafanadashboards/status
|
||||
verbs:
|
||||
- get
|
||||
- patch
|
||||
- update
|
||||
- apiGroups:
|
||||
- grafana.integreatly.org
|
||||
resources:
|
||||
- grafanadatasources
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- grafana.integreatly.org
|
||||
resources:
|
||||
- grafanadatasources/finalizers
|
||||
verbs:
|
||||
- update
|
||||
- apiGroups:
|
||||
- grafana.integreatly.org
|
||||
resources:
|
||||
- grafanadatasources/status
|
||||
verbs:
|
||||
- get
|
||||
- patch
|
||||
- update
|
||||
- apiGroups:
|
||||
- grafana.integreatly.org
|
||||
resources:
|
||||
- grafanafolders
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- grafana.integreatly.org
|
||||
resources:
|
||||
- grafanafolders/finalizers
|
||||
verbs:
|
||||
- update
|
||||
- apiGroups:
|
||||
- grafana.integreatly.org
|
||||
resources:
|
||||
- grafanafolders/status
|
||||
verbs:
|
||||
- get
|
||||
- patch
|
||||
- update
|
||||
- apiGroups:
|
||||
- grafana.integreatly.org
|
||||
resources:
|
||||
- grafananotificationpolicies
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- grafana.integreatly.org
|
||||
resources:
|
||||
- grafananotificationpolicies/finalizers
|
||||
verbs:
|
||||
- update
|
||||
- apiGroups:
|
||||
- grafana.integreatly.org
|
||||
resources:
|
||||
- grafananotificationpolicies/status
|
||||
verbs:
|
||||
- get
|
||||
- patch
|
||||
- update
|
||||
- apiGroups:
|
||||
- grafana.integreatly.org
|
||||
resources:
|
||||
- grafanas
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- grafana.integreatly.org
|
||||
resources:
|
||||
- grafanas/finalizers
|
||||
verbs:
|
||||
- update
|
||||
- apiGroups:
|
||||
- grafana.integreatly.org
|
||||
resources:
|
||||
- grafanas/status
|
||||
verbs:
|
||||
- get
|
||||
- patch
|
||||
- update
|
||||
- apiGroups:
|
||||
- networking.k8s.io
|
||||
resources:
|
||||
- ingresses
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
@@ -23,6 +23,13 @@ If release name contains chart name it will be used as a full name.
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Allow the release namespace to be overridden
|
||||
*/}}
|
||||
{{- define "grafana-operator.namespace" -}}
|
||||
{{ .Values.namespaceOverride | default .Release.Namespace }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
@@ -40,6 +47,10 @@ helm.sh/chart: {{ include "grafana-operator.chart" . }}
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
{{- end }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
app.kubernetes.io/part-of: grafana-operator
|
||||
{{- with .Values.additionalLabels }}
|
||||
{{ toYaml . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
|
||||
@@ -3,11 +3,10 @@ apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "grafana-operator.fullname" . }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
namespace: {{ include "grafana-operator.namespace" . }}
|
||||
labels:
|
||||
{{- with .Values.additionalLabels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- include "grafana-operator.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: operator
|
||||
data:
|
||||
controller_manager_config.yaml: |
|
||||
apiVersion: controller-runtime.sigs.k8s.io/v1alpha1
|
||||
|
||||
@@ -2,12 +2,10 @@ apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "grafana-operator.fullname" . }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
namespace: {{ include "grafana-operator.namespace" . }}
|
||||
labels:
|
||||
{{- include "grafana-operator.labels" . | nindent 4 }}
|
||||
{{- with .Values.additionalLabels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
app.kubernetes.io/component: operator
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
@@ -20,10 +18,8 @@ spec:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "grafana-operator.selectorLabels" . | nindent 8 }}
|
||||
{{- with .Values.additionalLabels }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- include "grafana-operator.labels" . | nindent 8 }}
|
||||
app.kubernetes.io/component: operator
|
||||
spec:
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
@@ -49,12 +45,19 @@ spec:
|
||||
{{ else }}
|
||||
value: {{ .Values.watchNamespaces }}
|
||||
{{- end }}
|
||||
- name: WATCH_NAMESPACE_SELECTOR
|
||||
{{- if and .Values.namespaceScope (eq .Values.watchNamespaceSelector "") }}
|
||||
value: ""
|
||||
{{ else }}
|
||||
value: {{quote .Values.watchNamespaceSelector }}
|
||||
{{- end }}
|
||||
{{- with .Values.env }}
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
args:
|
||||
- --health-probe-bind-address=:8081
|
||||
- --metrics-bind-address=0.0.0.0:{{ .Values.metricsService.metricsPort }}
|
||||
- --pprof-addr=0.0.0.0:{{ .Values.metricsService.pprofPort }}
|
||||
{{- if .Values.leaderElect }}
|
||||
- --leader-elect
|
||||
{{- end }}
|
||||
@@ -65,6 +68,9 @@ spec:
|
||||
- containerPort: {{ .Values.metricsService.metricsPort }}
|
||||
name: metrics
|
||||
protocol: TCP
|
||||
- containerPort: {{ .Values.metricsService.pprofPort }}
|
||||
name: pprof
|
||||
protocol: TCP
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /healthz
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
{{ range .Values.extraObjects }}
|
||||
---
|
||||
{{ tpl (toYaml .) $ }}
|
||||
{{ end }}
|
||||
@@ -1,8 +1,15 @@
|
||||
{{- $watchNamespaces := coalesce .Values.watchNamespaces .Release.Namespace }}
|
||||
{{- if .Values.rbac.create -}}
|
||||
{{ $rbac := .Files.Get "files/rbac.yaml" | fromYaml }}
|
||||
{{ $rbacOpenShift := .Files.Get "files/rbac-openshift.yaml" | fromYaml }}
|
||||
{{- $watchNamespaces := coalesce .Values.watchNamespaces .Values.namespaceOverride .Release.Namespace }}
|
||||
{{- $namespaceScoped := false }}
|
||||
{{- $isOpenShift := false }}
|
||||
{{- if or (.Values.namespaceScope) (.Values.watchNamespaces) }}
|
||||
{{- $namespaceScoped = true }}
|
||||
{{- end }}
|
||||
{{- if (.Values.isOpenShift) }}
|
||||
{{- $isOpenShift = true }}
|
||||
{{- end }}
|
||||
{{- $operatorNamespace := .Release.Namespace }}
|
||||
{{- range ( split "," $watchNamespaces ) }}
|
||||
---
|
||||
@@ -10,243 +17,35 @@ apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: {{ if not $namespaceScoped }}Cluster{{ end }}Role
|
||||
metadata:
|
||||
{{- if $namespaceScoped }}
|
||||
namespace: {{ $operatorNamespace }}
|
||||
namespace: {{ . }}
|
||||
{{- end }}
|
||||
name: grafana-operator-permissions
|
||||
name: {{ include "grafana-operator.fullname" $ }}
|
||||
labels:
|
||||
{{- include "grafana-operator.labels" $ | nindent 4 }}
|
||||
{{- with $.Values.additionalLabels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
app.kubernetes.io/component: operator
|
||||
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
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- configmaps
|
||||
- persistentvolumeclaims
|
||||
- secrets
|
||||
- serviceaccounts
|
||||
- services
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- events
|
||||
verbs:
|
||||
- create
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- watch
|
||||
- apiGroups:
|
||||
- apps
|
||||
resources:
|
||||
- deployments
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- grafana.integreatly.org
|
||||
resources:
|
||||
- grafanadashboards
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- grafana.integreatly.org
|
||||
resources:
|
||||
- grafanadashboards/finalizers
|
||||
verbs:
|
||||
- update
|
||||
- apiGroups:
|
||||
- grafana.integreatly.org
|
||||
resources:
|
||||
- grafanadashboards/status
|
||||
verbs:
|
||||
- get
|
||||
- patch
|
||||
- update
|
||||
- apiGroups:
|
||||
- grafana.integreatly.org
|
||||
resources:
|
||||
- grafanadatasources
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- grafana.integreatly.org
|
||||
resources:
|
||||
- grafanadatasources/finalizers
|
||||
verbs:
|
||||
- update
|
||||
- apiGroups:
|
||||
- grafana.integreatly.org
|
||||
resources:
|
||||
- grafanadatasources/status
|
||||
verbs:
|
||||
- get
|
||||
- patch
|
||||
- update
|
||||
- apiGroups:
|
||||
- grafana.integreatly.org
|
||||
resources:
|
||||
- grafanafolders
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- grafana.integreatly.org
|
||||
resources:
|
||||
- grafanafolders/finalizers
|
||||
verbs:
|
||||
- update
|
||||
- apiGroups:
|
||||
- grafana.integreatly.org
|
||||
resources:
|
||||
- grafanafolders/status
|
||||
verbs:
|
||||
- get
|
||||
- patch
|
||||
- update
|
||||
- apiGroups:
|
||||
- grafana.integreatly.org
|
||||
resources:
|
||||
- grafanas
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- grafana.integreatly.org
|
||||
resources:
|
||||
- grafanas/finalizers
|
||||
verbs:
|
||||
- update
|
||||
- apiGroups:
|
||||
- grafana.integreatly.org
|
||||
resources:
|
||||
- grafanas/status
|
||||
verbs:
|
||||
- get
|
||||
- patch
|
||||
- update
|
||||
- apiGroups:
|
||||
- networking.k8s.io
|
||||
resources:
|
||||
- ingresses
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- patch
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- route.openshift.io
|
||||
resources:
|
||||
- routes
|
||||
- routes/custom-host
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
- update
|
||||
- watch
|
||||
- apiGroups:
|
||||
- authentication.k8s.io
|
||||
resources:
|
||||
- tokenreviews
|
||||
verbs:
|
||||
- create
|
||||
- apiGroups:
|
||||
- authorization.k8s.io
|
||||
resources:
|
||||
- subjectaccessreviews
|
||||
verbs:
|
||||
- create
|
||||
{{- toYaml $rbac.rules | nindent 2 }}
|
||||
{{- if $isOpenShift }}
|
||||
{{- toYaml $rbacOpenShift.rules | nindent 2 -}}
|
||||
{{- end }}
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: {{ if not $namespaceScoped }}Cluster{{ end }}RoleBinding
|
||||
metadata:
|
||||
name: grafana-operator-permissions
|
||||
name: {{ include "grafana-operator.fullname" $ }}
|
||||
{{- if $namespaceScoped }}
|
||||
namespace: {{ $operatorNamespace }}
|
||||
namespace: {{ . }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "grafana-operator.labels" $ | nindent 4 }}
|
||||
{{- with $.Values.additionalLabels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
app.kubernetes.io/component: operator
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: {{ include "grafana-operator.serviceAccountName" $ }}
|
||||
namespace: {{ $operatorNamespace }}
|
||||
namespace: {{ include "grafana-operator.namespace" $ }}
|
||||
roleRef:
|
||||
kind: {{ if not $namespaceScoped }}Cluster{{ end }}Role
|
||||
name: grafana-operator-permissions
|
||||
name: {{ include "grafana-operator.fullname" $ }}
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
@@ -2,12 +2,10 @@ apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "grafana-operator.fullname" . }}-metrics-service
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
namespace: {{ include "grafana-operator.namespace" . }}
|
||||
labels:
|
||||
{{- include "grafana-operator.labels" . | nindent 4 }}
|
||||
{{- with .Values.additionalLabels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
app.kubernetes.io/component: operator
|
||||
spec:
|
||||
type: {{ .Values.metricsService.type }}
|
||||
ports:
|
||||
@@ -15,5 +13,9 @@ spec:
|
||||
targetPort: metrics
|
||||
protocol: TCP
|
||||
name: metrics
|
||||
- port: {{ .Values.metricsService.pprofPort }}
|
||||
targetPort: pprof
|
||||
protocol: TCP
|
||||
name: pprof
|
||||
selector:
|
||||
{{- include "grafana-operator.selectorLabels" . | nindent 4 }}
|
||||
|
||||
@@ -3,12 +3,10 @@ apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ include "grafana-operator.serviceAccountName" . }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
namespace: {{ include "grafana-operator.namespace" . }}
|
||||
labels:
|
||||
{{- include "grafana-operator.labels" . | nindent 4 }}
|
||||
{{- with .Values.additionalLabels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
app.kubernetes.io/component: operator
|
||||
{{- with .Values.serviceAccount.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
{{- if.Values.serviceMonitor.enabled -}}
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
name: {{ include "grafana-operator.fullname" . }}
|
||||
namespace: {{ include "grafana-operator.namespace" . }}
|
||||
labels:
|
||||
{{- include "grafana-operator.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: operator
|
||||
{{- with .Values.serviceMonitor.additionalLabels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
jobLabel: {{ .Release.Name }}
|
||||
namespaceSelector:
|
||||
matchNames:
|
||||
- {{ .Release.Namespace }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "grafana-operator.selectorLabels" . | nindent 6 }}
|
||||
endpoints:
|
||||
- port: metrics
|
||||
path: {{ .Values.serviceMonitor.telemetryPath }}
|
||||
{{- with .Values.serviceMonitor.interval }}
|
||||
interval: {{ . }}
|
||||
{{- end }}
|
||||
{{- with .Values.serviceMonitor.scrapeTimeout }}
|
||||
scrapeTimeout: {{ . }}
|
||||
{{- end }}
|
||||
{{- if .Values.serviceMonitor.metricRelabelings }}
|
||||
metricRelabelings:
|
||||
{{ toYaml .Values.serviceMonitor.metricRelabelings | indent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.serviceMonitor.relabelings }}
|
||||
relabelings:
|
||||
{{ toYaml .Values.serviceMonitor.relabelings | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.serviceMonitor.targetLabels }}
|
||||
targetLabels:
|
||||
{{- range .Values.serviceMonitor.targetLabels }}
|
||||
- {{ . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -10,6 +10,14 @@ leaderElect: false
|
||||
# By default it's all namespaces, if you only want to listen for the same namespace as the operator is deployed to look at namespaceScope.
|
||||
watchNamespaces: ""
|
||||
|
||||
# -- Sets the WATCH_NAMESPACE_SELECTOR environment variable,
|
||||
# it defines which namespaces the operator should be listening for based on label and key value pair added on namespace kind.
|
||||
# By default it's all namespaces.
|
||||
watchNamespaceSelector: ""
|
||||
|
||||
# -- Determines if the target cluster is OpenShift. Additional rbac permissions for routes will be added on OpenShift
|
||||
isOpenShift: false
|
||||
|
||||
# -- Additional environment variables
|
||||
env: []
|
||||
# -- grafana image, e.g. docker.io/grafana/grafana:9.1.6, overwrites the default grafana image defined in the operator
|
||||
@@ -29,9 +37,15 @@ image:
|
||||
# -- image pull secrets
|
||||
imagePullSecrets: []
|
||||
|
||||
# -- Overrides the name of the chart.
|
||||
nameOverride: ""
|
||||
|
||||
# -- Overrides the fully qualified app name.
|
||||
fullnameOverride: ""
|
||||
|
||||
# -- Overrides the namespace name.
|
||||
namespaceOverride: ""
|
||||
|
||||
serviceAccount:
|
||||
# -- Specifies whether a service account should be created
|
||||
create: true
|
||||
@@ -41,11 +55,18 @@ serviceAccount:
|
||||
# If not set and create is true, a name is generated using the fullname template
|
||||
name: ""
|
||||
|
||||
rbac:
|
||||
# -- Specifies whether to create the ClusterRole and ClusterRoleBinding.
|
||||
# If "namespaceScope" is true or "watchNamespaces" is set, this will create Role and RoleBinding instead.
|
||||
create: true
|
||||
|
||||
metricsService:
|
||||
# -- metrics service type
|
||||
type: ClusterIP
|
||||
# -- metrics service port
|
||||
metricsPort: 9090
|
||||
# -- port for the pprof profiling endpoint
|
||||
pprofPort: 8888
|
||||
|
||||
# -- additional labels to add to all resources
|
||||
additionalLabels: {}
|
||||
@@ -78,3 +99,42 @@ tolerations: []
|
||||
|
||||
# -- pod affinity
|
||||
affinity: {}
|
||||
|
||||
# -- Enable this to use with Prometheus Operator
|
||||
serviceMonitor:
|
||||
# -- When set true then use a ServiceMonitor to configure scraping
|
||||
enabled: false
|
||||
# -- Set of labels to transfer from the Kubernetes Service onto the target
|
||||
additionalLabels: {}
|
||||
# -- Set how frequently Prometheus should scrape
|
||||
interval: 1m
|
||||
# -- Set timeout for scrape
|
||||
scrapeTimeout: 10s
|
||||
# -- Set path to metrics path
|
||||
telemetryPath: /metrics
|
||||
# -- Set of labels to transfer from the Kubernetes Service onto the target
|
||||
targetLabels: []
|
||||
# -- MetricRelabelConfigs to apply to samples before ingestion
|
||||
metricRelabelings: []
|
||||
# -- Set relabel_configs as per https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config
|
||||
relabelings: []
|
||||
|
||||
# -- Array of extra K8s objects to deploy
|
||||
extraObjects: []
|
||||
# - apiVersion: external-secrets.io/v1beta1
|
||||
# kind: ExternalSecret
|
||||
# metadata:
|
||||
# name: grafana-operator-apikey
|
||||
# spec:
|
||||
# refreshInterval: 1h
|
||||
# secretStoreRef:
|
||||
# kind: SecretStore
|
||||
# name: my-secret-store
|
||||
# target:
|
||||
# template:
|
||||
# data:
|
||||
# GRAFANA_CLOUD_INSTANCE_TOKEN: "{{`{{ .Token }}`}}"
|
||||
# dataFrom:
|
||||
# - extract:
|
||||
# key: my-secret-store-secret
|
||||
|
||||
|
||||
Reference in New Issue
Block a user