Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup monitoring values #476

Merged
merged 1 commit into from
Apr 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apis/installer/v1alpha1/kubedb_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ type GlobalValues struct {
RegistryFQDN string `json:"registryFQDN"`
//+optional
ImagePullSecrets []core.LocalObjectReference `json:"imagePullSecrets"`
Monitoring UIServerMonitoring `json:"monitoring"`
Monitoring EASMonitoring `json:"monitoring"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down
24 changes: 2 additions & 22 deletions apis/installer/v1alpha1/kubedb_ui_server_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,28 +74,8 @@ type KubedbUiServerSpec struct {
// +optional
PodSecurityContext *core.PodSecurityContext `json:"podSecurityContext"`
ServiceAccount ServiceAccountSpec `json:"serviceAccount"`
Apiserver UIServerSpec `json:"apiserver"`
Monitoring UIServerMonitoring `json:"monitoring"`
}

type UIServerSpec struct {
GroupPriorityMinimum int32 `json:"groupPriorityMinimum"`
VersionPriority int32 `json:"versionPriority"`
UseKubeapiserverFqdnForAks bool `json:"useKubeapiserverFqdnForAks"`
Healthcheck UIServerHealthcheckSpec `json:"healthcheck"`
ServingCerts ServingCerts `json:"servingCerts"`
}

type UIServerHealthcheckSpec struct {
// +optional
Enabled bool `json:"enabled"`
}

type UIServerMonitoring struct {
// +optional
Enabled bool `json:"enabled"`
Agent string `json:"agent"`
ServiceMonitor *ServiceMonitorLabels `json:"serviceMonitor"`
Apiserver EASSpec `json:"apiserver"`
Monitoring EASMonitoring `json:"monitoring"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down
20 changes: 10 additions & 10 deletions apis/installer/v1alpha1/kubedb_webhook_server_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,18 @@ type KubedbWebhookServerSpec struct {
PodSecurityContext *core.PodSecurityContext `json:"podSecurityContext"`
ServiceAccount ServiceAccountSpec `json:"serviceAccount"`
Apiserver WebhookAPIServerSpec `json:"apiserver"`
Monitoring UIServerMonitoring `json:"monitoring"`
Monitoring EASMonitoring `json:"monitoring"`
}
type WebhookAPIServerSpec struct {
GroupPriorityMinimum int32 `json:"groupPriorityMinimum"`
VersionPriority int32 `json:"versionPriority"`
EnableMutatingWebhook bool `json:"enableMutatingWebhook"`
EnableValidatingWebhook bool `json:"enableValidatingWebhook"`
CA string `json:"ca"`
UseKubeapiserverFqdnForAks bool `json:"useKubeapiserverFqdnForAks"`
Healthcheck UIServerHealthcheckSpec `json:"healthcheck"`
Port int32 `json:"port"`
ServingCerts ServingCerts `json:"servingCerts"`
GroupPriorityMinimum int32 `json:"groupPriorityMinimum"`
VersionPriority int32 `json:"versionPriority"`
EnableMutatingWebhook bool `json:"enableMutatingWebhook"`
EnableValidatingWebhook bool `json:"enableValidatingWebhook"`
CA string `json:"ca"`
UseKubeapiserverFqdnForAks bool `json:"useKubeapiserverFqdnForAks"`
Healthcheck EASHealthcheckSpec `json:"healthcheck"`
Port int32 `json:"port"`
ServingCerts ServingCerts `json:"servingCerts"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down
25 changes: 22 additions & 3 deletions apis/installer/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@ type HealthcheckSpec struct {
ProbePort int `json:"probePort"`
}

// +kubebuilder:validation:Enum=prometheus.io;prometheus.io/operator;prometheus.io/builtin
type MonitoringAgent string

type Monitoring struct {
// +optional
Enabled bool `json:"enabled"`
Agent string `json:"agent"`
Agent MonitoringAgent `json:"agent"`
BindPort int `json:"bindPort"`
ServiceMonitor *ServiceMonitorLabels `json:"serviceMonitor"`
}
Expand All @@ -77,3 +78,21 @@ type ServiceMonitorLabels struct {
// +optional
Labels map[string]string `json:"labels"`
}

type EASSpec struct {
GroupPriorityMinimum int32 `json:"groupPriorityMinimum"`
VersionPriority int32 `json:"versionPriority"`
UseKubeapiserverFqdnForAks bool `json:"useKubeapiserverFqdnForAks"`
Healthcheck EASHealthcheckSpec `json:"healthcheck"`
ServingCerts ServingCerts `json:"servingCerts"`
}

type EASHealthcheckSpec struct {
// +optional
Enabled bool `json:"enabled"`
}

type EASMonitoring struct {
Agent MonitoringAgent `json:"agent"`
ServiceMonitor *ServiceMonitorLabels `json:"serviceMonitor"`
}
110 changes: 55 additions & 55 deletions apis/installer/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions charts/kubedb-autoscaler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@ The following table lists the configurable parameters of the `kubedb-autoscaler`
| apiserver.useKubeapiserverFqdnForAks | If true, uses kube-apiserver FQDN for AKS cluster to workaround https://github.com/Azure/AKS/issues/522 (default true) | <code>true</code> |
| apiserver.healthcheck.enabled | healthcheck configures the readiness and liveliness probes for the operator pod. | <code>true</code> |
| apiserver.healthcheck.probePort | The port the probe endpoint binds to | <code>8081</code> |
| monitoring.enabled | If true, enables monitoring KubeDB operator | <code>false</code> |
| monitoring.bindPort | The port the metric endpoint binds to | <code>8080</code> |
| monitoring.agent | Name of monitoring agent ("prometheus.io" or "prometheus.io/operator" or "prometheus.io/builtin") | <code>""</code> |
| monitoring.agent | Name of monitoring agent (one of "prometheus.io", "prometheus.io/operator", "prometheus.io/builtin") | <code>""</code> |
| monitoring.serviceMonitor.labels | Specify the labels for ServiceMonitor. Prometheus crd will select ServiceMonitor using these labels. Only usable when monitoring agent is `prometheus.io/operator`. | <code>{}</code> |
| storageAutoscaler.prometheus.address | Prometheus address for storage metrics | <code>http://prometheus-operated.monitoring.svc:9090</code> |
| storageAutoscaler.prometheus.bearerToken | Bearer token for prometheus server | <code>""</code> |
Expand Down
16 changes: 0 additions & 16 deletions charts/kubedb-autoscaler/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,6 @@ Returns the registry used for operator docker image
{{- list .Values.registryFQDN .Values.operator.registry | compact | join "/" }}
{{- end }}

{{/*
Returns the registry used for cleaner docker image
*/}}
{{- define "cleaner.registry" -}}
{{- list .Values.registryFQDN .Values.cleaner.registry | compact | join "/" }}
{{- end }}

{{/*
Returns whether the cleaner job YAML will be generated or not
*/}}
{{- define "cleaner.generate" -}}
{{- ternary "false" "true" .Values.cleaner.skip -}}
{{- end }}

{{- define "appscode.imagePullSecrets" -}}
{{- with .Values.imagePullSecrets -}}
imagePullSecrets:
Expand All @@ -101,10 +87,8 @@ imagePullSecrets:
Returns the enabled monitoring agent name
*/}}
{{- define "monitoring.agent" -}}
{{- if .Values.monitoring.enabled -}}
{{- .Values.monitoring.agent }}
{{- end }}
{{- end }}

{{/*
Returns whether the ServiceMonitor will be labeled with custom label
Expand Down
2 changes: 1 addition & 1 deletion charts/kubedb-autoscaler/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
namespace: {{ .Release.Namespace }}
labels:
{{- include "kubedb-autoscaler.labels" . | nindent 4 }}
{{- if and (eq .Values.monitoring.agent "prometheus.io/builtin") .Values.monitoring.enabled }}
{{- if eq "prometheus.io/builtin" ( include "monitoring.agent" . ) }}
annotations:
prometheus.io/scrape: "true"
prometheus.io/path: "/metrics"
Expand Down
6 changes: 4 additions & 2 deletions charts/kubedb-autoscaler/values.openapiv3_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -791,11 +791,13 @@ properties:
monitoring:
properties:
agent:
enum:
- prometheus.io
- prometheus.io/operator
- prometheus.io/builtin
type: string
bindPort:
type: integer
enabled:
type: boolean
serviceMonitor:
properties:
labels:
Expand Down
4 changes: 1 addition & 3 deletions charts/kubedb-autoscaler/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,9 @@ apiserver:
# The port the probe endpoint binds to
probePort: 8081
monitoring:
# If true, enables monitoring KubeDB operator
enabled: false
# The port the metric endpoint binds to
bindPort: 8080
# Name of monitoring agent ("prometheus.io" or "prometheus.io/operator" or "prometheus.io/builtin")
# Name of monitoring agent (one of "prometheus.io", "prometheus.io/operator", "prometheus.io/builtin")
agent: ""
# specify where ServiceMonitor crd will be created
serviceMonitor:
Expand Down
3 changes: 1 addition & 2 deletions charts/kubedb-dashboard/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@ The following table lists the configurable parameters of the `kubedb-dashboard`
| apiserver.healthcheck.enabled | healthcheck configures the readiness and liveliness probes for the operator pod. | <code>true</code> |
| apiserver.healthcheck.probePort | The port the probe endpoint binds to | <code>8081</code> |
| enforceTerminationPolicy | If true, namespace deletion will fail if it has a KubeDB resource with terminationPolicy DoNotTerminate | <code>true</code> |
| monitoring.enabled | If true, enables monitoring KubeDB dashboard operator | <code>false</code> |
| monitoring.bindPort | The port the metric endpoint binds to | <code>8080</code> |
| monitoring.agent | Name of monitoring agent ("prometheus.io" or "prometheus.io/operator" or "prometheus.io/builtin") | <code>""</code> |
| monitoring.agent | Name of monitoring agent (one of "prometheus.io", "prometheus.io/operator", "prometheus.io/builtin") | <code>""</code> |
| monitoring.serviceMonitor.labels | Specify the labels for ServiceMonitor. Prometheus crd will select ServiceMonitor using these labels. Only usable when monitoring agent is `prometheus.io/operator`. | <code>{}</code> |


Expand Down
16 changes: 0 additions & 16 deletions charts/kubedb-dashboard/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,6 @@ Returns the registry used for operator docker image
{{- list .Values.registryFQDN .Values.operator.registry | compact | join "/" }}
{{- end }}

{{/*
Returns the registry used for cleaner docker image
*/}}
{{- define "cleaner.registry" -}}
{{- list .Values.registryFQDN .Values.cleaner.registry | compact | join "/" }}
{{- end }}

{{/*
Returns whether the cleaner job YAML will be generated or not
*/}}
{{- define "cleaner.generate" -}}
{{- ternary "false" "true" .Values.cleaner.skip -}}
{{- end }}

{{- define "appscode.imagePullSecrets" -}}
{{- with .Values.imagePullSecrets -}}
imagePullSecrets:
Expand All @@ -101,10 +87,8 @@ imagePullSecrets:
Returns the enabled monitoring agent name
*/}}
{{- define "monitoring.agent" -}}
{{- if .Values.monitoring.enabled -}}
{{- .Values.monitoring.agent }}
{{- end }}
{{- end }}

{{/*
Returns whether the ServiceMonitor will be labeled with custom label
Expand Down
Loading