diff --git a/Makefile b/Makefile index 71120735d9..88deb25d7c 100644 --- a/Makefile +++ b/Makefile @@ -405,7 +405,7 @@ helm-install: manifests --set logLevel=info \ --set os.windows=true \ --set operator.enabled=false \ - --set enabledPlugin_linux="[\"dropreason\"\,\"packetforward\"\,\"linuxutil\"\,\"dns\"]" + --set enabledPlugin_linux="\[dropreason\,packetforward\,linuxutil\,dns\]" # advanced/pod-level mode with scale limitations, where metrics are aggregated by source and destination Pod helm-install-advanced-remote-context: manifests @@ -420,7 +420,7 @@ helm-install-advanced-remote-context: manifests --set operator.enableRetinaEndpoint=true \ --set operator.repository=$(IMAGE_REGISTRY)/$(RETINA_OPERATOR_IMAGE) \ --skip-crds \ - --set enabledPlugin_linux="[\"dropreason\",\"packetforward\",\"linuxutil\",\"dns\",\"packetparser\"\]" \ + --set enabledPlugin_linux="\[dropreason\,packetforward\,linuxutil\,dns\,packetparser\]" \ --set enablePodLevel=true \ --set remoteContext=true @@ -437,7 +437,7 @@ helm-install-advanced-local-context: manifests --set operator.enableRetinaEndpoint=true \ --set operator.repository=$(IMAGE_REGISTRY)/$(RETINA_OPERATOR_IMAGE) \ --skip-crds \ - --set enabledPlugin_linux="[\"dropreason\",\"packetforward\",\"linuxutil\",\"dns\",\"packetparser\"]" \ + --set enabledPlugin_linux="\[dropreason\,packetforward\,linuxutil\,dns\,packetparser\]" \ --set enablePodLevel=true \ --set enableAnnotations=true \ --set bypassLookupIPOfInterest=false diff --git a/deploy/prometheus/values.yaml b/deploy/prometheus/values.yaml index 1acefdf525..05e229bd9d 100644 --- a/deploy/prometheus/values.yaml +++ b/deploy/prometheus/values.yaml @@ -1,5 +1,50 @@ +windowsMonitoring: + enabled: true + +prometheusOperator: + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/os + operator: In + values: + - linux + + admissionWebhooks: + deployment: + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/os + operator: In + values: + - linux + patch: + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/os + operator: In + values: + - linux + prometheus: prometheusSpec: + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/os + operator: In + values: + - linux additionalScrapeConfigs: | - job_name: "retina-pods" kubernetes_sd_configs: diff --git a/docs/installation/img/grafana-dashboard-metrics.png b/docs/installation/img/grafana-dashboard-metrics.png new file mode 100644 index 0000000000..502a1f368e Binary files /dev/null and b/docs/installation/img/grafana-dashboard-metrics.png differ diff --git a/docs/installation/prometheus-unmanaged.md b/docs/installation/prometheus-unmanaged.md index bf0edef231..6c0fb398dd 100644 --- a/docs/installation/prometheus-unmanaged.md +++ b/docs/installation/prometheus-unmanaged.md @@ -15,52 +15,21 @@ helm repo update ``` -2. Install the Prometheus chart +2. Save **[these Prometheus values](https://github.com/microsoft/retina/blob/main/deploy/prometheus/values.yaml)** below to `deploy/prometheus/values.yaml` + +3. Install the Prometheus chart ```shell helm install prometheus -n kube-system -f deploy/prometheus/values.yaml prometheus-community/kube-prometheus-stack ``` -3. Save the Prometheus values below to `deploy/prometheus/values.yaml` - - ```yaml - prometheus: - prometheusSpec: - additionalScrapeConfigs: | - - job_name: "retina-pods" - kubernetes_sd_configs: - - role: pod - relabel_configs: - - source_labels: [__meta_kubernetes_pod_container_name] - action: keep - regex: retina(.*) - - source_labels: - [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port] - separator: ":" - regex: ([^:]+)(?::\d+)? - target_label: __address__ - replacement: ${1}:${2} - action: replace - - source_labels: [__meta_kubernetes_pod_node_name] - action: replace - target_label: instance - metric_relabel_configs: - - source_labels: [__name__] - action: keep - regex: (.*) - ``` - -4. Upgrade deployment with +Or if you already have the chart installed, upgrade how you see fit, providing the new job name as an additional scrape config, ex: ```shell helm upgrade prometheus -n kube-system -f deploy/prometheus/values.yaml prometheus-community/kube-prometheus-stack ``` -5. Install Retina - - ```shell - helm install retina ./deploy/manifests/controller/helm/retina/ --namespace kube-system --dependency-update - ``` +Node: Grafana and kube-state metrics may schedule on Windows nodes, the current chart doesn't have node affinity for those components. Some manual intervention may be required. 6. Verify that the Retina Pods are being scraped by port-forwarding the Prometheus server: @@ -74,4 +43,16 @@ ## Configuring Grafana -Create a Grafana instance at [grafana.com](https://www.grafana.com) and follow [Configuring Grafana](./grafana.md). +Create a Grafana instance at [grafana.com](https://www.grafana.com) and follow [Configuring Grafana](./grafana.md), or use the one installed from above. + +8. Get the Grafana password: + +```shell +kubectl get secret -n kube-system prometheus-grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo +``` + +9. Import the new dashboard from **[here](https://grafana.com/grafana/dashboards/18814/)**. + +10. Metrics should be visible: + +![alt text](img/grafana-dashboard-metrics.png)