Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
Merge pull request #97 from integr8ly/os4-monitoring-resources
Browse files Browse the repository at this point in the history
Os4 monitoring resources
  • Loading branch information
pb82 authored Dec 6, 2019
2 parents 46c0b4c + a62dfa6 commit 938edaf
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion deploy/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions deploy/roles/grafana-operator-clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ rules:
- integreatly.org
resources:
- grafanadashboards
- grafanadashboards/status
verbs: ['get', 'list', 'update', 'watch']
- apiGroups:
- authentication.k8s.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/applicationmonitoring/templateHelper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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: "v3.0.0",
ImageConfigMapReloader: "quay.io/openshift/origin-configmap-reloader",
ImageTagConfigMapReloader: "4.2",
ImagePrometheusConfigReloader: "quay.io/openshift/origin-prometheus-config-reloader",
Expand Down
8 changes: 0 additions & 8 deletions templates/blackbox-exporter-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 4 additions & 0 deletions templates/grafana-operator-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ rules:
- apps
resources:
- deployments
- deployments/finalizers
- daemonsets
- replicasets
- statefulsets
Expand All @@ -40,6 +41,9 @@ rules:
- grafanadashboards
- grafanas
- grafanas/finalizers
- grafanadashboards/status
- grafanadatasources/status
- grafanas/status
verbs:
- '*'
- apiGroups:
Expand Down
1 change: 0 additions & 1 deletion templates/grafana-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ spec:
args:
- '--grafana-image={{ .ImageGrafana }}'
- '--grafana-image-tag={{ .ImageTagGrafana }}'
- '--openshift'
- '--scan-all'
ports:
- containerPort: 60000
Expand Down
22 changes: 21 additions & 1 deletion templates/grafana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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=*'
Expand Down Expand Up @@ -48,6 +49,25 @@ 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
compat:
fixAnnotations: 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 }}] }
Expand Down
2 changes: 1 addition & 1 deletion version/version.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package version

var (
Version = "0.0.29"
Version = "1.0.0"
)

0 comments on commit 938edaf

Please sign in to comment.