From cea7658b626210a0b09f2574430f0ca4fd62e241 Mon Sep 17 00:00:00 2001 From: Peter Braun Date: Sun, 1 Dec 2019 23:06:59 +0100 Subject: [PATCH 1/7] version bump --- Makefile | 2 +- deploy/operator.yaml | 2 +- version/version.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 765e167d..086ca3f6 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ NAMESPACE ?= application-monitoring PROJECT ?= application-monitoring-operator REG=quay.io SHELL=/bin/bash -TAG ?= 0.0.29 +TAG ?= 1.0.0 PKG=github.com/integr8ly/application-monitoring-operator TEST_DIRS?=$(shell sh -c "find $(TOP_SRC_DIRS) -name \\*_test.go -exec dirname {} \\; | sort | uniq") TEST_POD_NAME=application-monitoring-operator-test diff --git a/deploy/operator.yaml b/deploy/operator.yaml index 257c646d..f0e63be4 100644 --- a/deploy/operator.yaml +++ b/deploy/operator.yaml @@ -15,7 +15,7 @@ spec: serviceAccountName: application-monitoring-operator containers: - name: application-monitoring-operator - image: quay.io/integreatly/application-monitoring-operator:0.0.29 + image: quay.io/integreatly/application-monitoring-operator:1.0.0 ports: - containerPort: 60000 name: metrics diff --git a/version/version.go b/version/version.go index 2c9aef53..e65edb7e 100644 --- a/version/version.go +++ b/version/version.go @@ -1,5 +1,5 @@ package version var ( - Version = "0.0.29" + Version = "1.0.0" ) From abc717d789b9b1dce5506e896745794d3672603a Mon Sep 17 00:00:00 2001 From: Peter Braun Date: Sun, 1 Dec 2019 23:19:31 +0100 Subject: [PATCH 2/7] grafana operator update --- .../roles/grafana-operator-clusterrole.yaml | 1 + .../applicationmonitoring/templateHelper.go | 2 +- templates/grafana-operator-role.yaml | 4 ++++ templates/grafana-operator.yaml | 1 - templates/grafana.yaml | 20 ++++++++++++++++++- 5 files changed, 25 insertions(+), 3 deletions(-) diff --git a/deploy/roles/grafana-operator-clusterrole.yaml b/deploy/roles/grafana-operator-clusterrole.yaml index 3080a468..02811d83 100644 --- a/deploy/roles/grafana-operator-clusterrole.yaml +++ b/deploy/roles/grafana-operator-clusterrole.yaml @@ -7,6 +7,7 @@ rules: - integreatly.org resources: - grafanadashboards + - grafanadashboards/status verbs: ['get', 'list', 'update', 'watch'] - apiGroups: - authentication.k8s.io diff --git a/pkg/controller/applicationmonitoring/templateHelper.go b/pkg/controller/applicationmonitoring/templateHelper.go index 5e30a922..9e261737 100644 --- a/pkg/controller/applicationmonitoring/templateHelper.go +++ b/pkg/controller/applicationmonitoring/templateHelper.go @@ -143,7 +143,7 @@ func newTemplateHelper(cr *applicationmonitoring.ApplicationMonitoring, extraPar ImageGrafana: "quay.io/openshift/origin-grafana", ImageTagGrafana: "4.2", ImageGrafanaOperator: "quay.io/integreatly/grafana-operator", - ImageTagGrafanaOperator: "v1.3.2", + ImageTagGrafanaOperator: "3.0.0-beta", ImageConfigMapReloader: "quay.io/openshift/origin-configmap-reloader", ImageTagConfigMapReloader: "4.2", ImagePrometheusConfigReloader: "quay.io/openshift/origin-prometheus-config-reloader", diff --git a/templates/grafana-operator-role.yaml b/templates/grafana-operator-role.yaml index ed1dced9..cc59c8bc 100644 --- a/templates/grafana-operator-role.yaml +++ b/templates/grafana-operator-role.yaml @@ -21,6 +21,7 @@ rules: - apps resources: - deployments + - deployments/finalizers - daemonsets - replicasets - statefulsets @@ -40,6 +41,9 @@ rules: - grafanadashboards - grafanas - grafanas/finalizers + - grafanadashboards/status + - grafanadatasources/status + - grafanas/status verbs: - '*' - apiGroups: diff --git a/templates/grafana-operator.yaml b/templates/grafana-operator.yaml index 1fde2337..e4cf4a3f 100644 --- a/templates/grafana-operator.yaml +++ b/templates/grafana-operator.yaml @@ -20,7 +20,6 @@ spec: args: - '--grafana-image={{ .ImageGrafana }}' - '--grafana-image-tag={{ .ImageTagGrafana }}' - - '--openshift' - '--scan-all' ports: - containerPort: 60000 diff --git a/templates/grafana.yaml b/templates/grafana.yaml index 2bc98088..739d762a 100644 --- a/templates/grafana.yaml +++ b/templates/grafana.yaml @@ -12,12 +12,13 @@ spec: disable_login_form: False disable_signout_menu: True auth.basic: - enabled: False + enabled: True auth.anonymous: enabled: True containers: - args: - '-provider=openshift' + - '-pass-basic-auth=false' - '-https-address=:9091' - '-http-address=' - '-email-domain=*' @@ -48,6 +49,23 @@ spec: secrets: - grafana-k8s-tls - grafana-k8s-proxy + service: + ports: + - name: grafana-proxy + port: 9091 + protocol: TCP + targetPort: grafana-proxy + annotations: + service.alpha.openshift.io/serving-cert-secret-name: grafana-k8s-tls + ingress: + enabled: True + targetPort: grafana-proxy + termination: reencrypt + client: + preferService: True + serviceAccount: + annotations: + serviceaccounts.openshift.io/oauth-redirectreference.primary: '{"kind":"OAuthRedirectReference","apiVersion":"v1","reference":{"kind":"Route","name":"grafana-route"}}' dashboardLabelSelector: - matchExpressions: - { key: "monitoring-key", operator: In, values: [{{ .MonitoringKey }}] } From 48815951ede300f71dfde5c68e838dc60f8c9b3b Mon Sep 17 00:00:00 2001 From: Peter Braun Date: Sun, 1 Dec 2019 23:20:20 +0100 Subject: [PATCH 3/7] blackbox exporter update --- templates/blackbox-exporter-config.yaml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/templates/blackbox-exporter-config.yaml b/templates/blackbox-exporter-config.yaml index 7a2a20b1..d4b4698f 100644 --- a/templates/blackbox-exporter-config.yaml +++ b/templates/blackbox-exporter-config.yaml @@ -10,19 +10,11 @@ data: prober: http http: preferred_ip_protocol: ip4 - tls_config: - ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt - cert_file: /etc/tls/private/tls.crt - key_file: /etc/tls/private/tls.key http_post_2xx: prober: http http: method: POST preferred_ip_protocol: ip4 - tls_config: - ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt - cert_file: /etc/tls/private/tls.crt - key_file: /etc/tls/private/tls.key kind: ConfigMap metadata: name: {{ .BlackboxExporterConfigmapName }} From 803d72e0582f78edf1e1404f668e8bd484b1d34c Mon Sep 17 00:00:00 2001 From: Peter Braun Date: Sun, 1 Dec 2019 23:59:08 +0100 Subject: [PATCH 4/7] fix: set owner reference on cr update --- .../applicationmonitoring_controller.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkg/controller/applicationmonitoring/applicationmonitoring_controller.go b/pkg/controller/applicationmonitoring/applicationmonitoring_controller.go index 6d05c704..dce2df41 100644 --- a/pkg/controller/applicationmonitoring/applicationmonitoring_controller.go +++ b/pkg/controller/applicationmonitoring/applicationmonitoring_controller.go @@ -244,6 +244,11 @@ func (r *ReconcileApplicationMonitoring) updateCR(cr *applicationmonitoringv1alp rawMetadata := raw["metadata"].(map[string]interface{}) rawMetadata["resourceVersion"] = resourceVersion + err = controllerutil.SetControllerReference(cr, resource.(v1.Object), r.scheme) + if err != nil { + log.Error(err, fmt.Sprintf("error setting owner reference on %v", crName)) + } + err = r.client.Update(context.TODO(), resource) if err != nil { log.Error(err, "error updating cr") @@ -346,7 +351,8 @@ func (r *ReconcileApplicationMonitoring) watchAdditionalScrapeConfigs(cr *applic } } } - log.Info("stop watching for additional scrape config") + log.Info("watch ended for additional scrape config") + r.watch = nil }() return events, nil @@ -458,7 +464,7 @@ func (r *ReconcileApplicationMonitoring) createAux(cr *applicationmonitoringv1al func (r *ReconcileApplicationMonitoring) installGrafanaOperator(cr *applicationmonitoringv1alpha1.ApplicationMonitoring) (reconcile.Result, error) { log.Info("Phase: Install GrafanaOperator") - for _, resourceName := range []string{GrafanaProxySecretName, GrafanaServiceName, GrafanaRouteName, GrafanaOperatorServiceAccountName, GrafanaOperatorRoleName, GrafanaOperatorRoleBindingName, GrafanaOperatorName} { + for _, resourceName := range []string{GrafanaProxySecretName, GrafanaOperatorServiceAccountName, GrafanaOperatorRoleName, GrafanaOperatorRoleBindingName, GrafanaOperatorName} { if _, err := r.createResource(cr, resourceName); err != nil { log.Info(fmt.Sprintf("Error in InstallGrafanaOperator, resourceName=%s : err=%s", resourceName, err)) // Requeue so it can be attempted again From e3b89b9e2b44b1afae5ed8282b374ec7c9c48895 Mon Sep 17 00:00:00 2001 From: Peter Braun Date: Mon, 2 Dec 2019 08:40:38 +0100 Subject: [PATCH 5/7] update grafana image tag --- pkg/controller/applicationmonitoring/templateHelper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/controller/applicationmonitoring/templateHelper.go b/pkg/controller/applicationmonitoring/templateHelper.go index 9e261737..4924abdb 100644 --- a/pkg/controller/applicationmonitoring/templateHelper.go +++ b/pkg/controller/applicationmonitoring/templateHelper.go @@ -143,7 +143,7 @@ func newTemplateHelper(cr *applicationmonitoring.ApplicationMonitoring, extraPar ImageGrafana: "quay.io/openshift/origin-grafana", ImageTagGrafana: "4.2", ImageGrafanaOperator: "quay.io/integreatly/grafana-operator", - ImageTagGrafanaOperator: "3.0.0-beta", + ImageTagGrafanaOperator: "v3.0.0-beta", ImageConfigMapReloader: "quay.io/openshift/origin-configmap-reloader", ImageTagConfigMapReloader: "4.2", ImagePrometheusConfigReloader: "quay.io/openshift/origin-prometheus-config-reloader", From 7346cce046b87419e0d6d5c8c18b4802a31e8535 Mon Sep 17 00:00:00 2001 From: Peter Braun Date: Mon, 2 Dec 2019 23:52:06 +0100 Subject: [PATCH 6/7] compatibility with older dashboard formats --- templates/grafana.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/grafana.yaml b/templates/grafana.yaml index 739d762a..2d5d4e09 100644 --- a/templates/grafana.yaml +++ b/templates/grafana.yaml @@ -63,6 +63,8 @@ spec: termination: reencrypt client: preferService: True + compat: + fixAnnotations: True serviceAccount: annotations: serviceaccounts.openshift.io/oauth-redirectreference.primary: '{"kind":"OAuthRedirectReference","apiVersion":"v1","reference":{"kind":"Route","name":"grafana-route"}}' From a62dfa6fd2851fdcfdda80f32968b8f6722739de Mon Sep 17 00:00:00 2001 From: Peter Braun Date: Fri, 6 Dec 2019 10:48:18 +0100 Subject: [PATCH 7/7] update to release image --- pkg/controller/applicationmonitoring/templateHelper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/controller/applicationmonitoring/templateHelper.go b/pkg/controller/applicationmonitoring/templateHelper.go index 4924abdb..1102a7d5 100644 --- a/pkg/controller/applicationmonitoring/templateHelper.go +++ b/pkg/controller/applicationmonitoring/templateHelper.go @@ -143,7 +143,7 @@ func newTemplateHelper(cr *applicationmonitoring.ApplicationMonitoring, extraPar ImageGrafana: "quay.io/openshift/origin-grafana", ImageTagGrafana: "4.2", ImageGrafanaOperator: "quay.io/integreatly/grafana-operator", - ImageTagGrafanaOperator: "v3.0.0-beta", + ImageTagGrafanaOperator: "v3.0.0", ImageConfigMapReloader: "quay.io/openshift/origin-configmap-reloader", ImageTagConfigMapReloader: "4.2", ImagePrometheusConfigReloader: "quay.io/openshift/origin-prometheus-config-reloader",