kinvolk / lokomotive

🪦 DISCONTINUED Further Lokomotive development has been discontinued. Lokomotive is a 100% open-source, easy to use and secure Kubernetes distribution from the volks at Kinvolk
https://kinvolk.io/lokomotive-kubernetes/
Apache License 2.0
321 stars 49 forks source link

prometheus-operator config update #1540

Closed knrt10 closed 3 years ago

knrt10 commented 3 years ago

Add user-configurable tolerations for prometheus operator and it's components.

Change configuration for alertmanager. Now it is configured in a different block

closes: #1527 Signed-off-by: knrt10 kautilya@kinvolk.io

Release notes

Alert manager is not configured as a different block

# old
alertmanager_retention    = "360h"
alertmanager_external_url = "https://api.example.com/alertmanager"
alertmanager_config       = file("alertmanager-config.yaml")
alertmanager_node_selector = {
  "kubernetes.io/hostname" = "worker3"
}

# new
alertmanager {
  retention    = "360h"
  external_url = "https://api.example.com/alertmanager"
  config       = file("alertmanager-config.yaml")
  node_selector = {
    "kubernetes.io/hostname" = "worker3"
  }
}

Operator is also now configured as a new block

# old
prometheus_operator_node_selector = {
  "kubernetes.io/hostname" = "worker3"
}

# new
operator {
  node_selector = {
    "kubernetes.io/hostname" = "worker3"
  }
}
knrt10 commented 3 years ago

@invidian do we want package tests or e2e test?

invidian commented 3 years ago

I suggest adding:

diff --git a/pkg/components/prometheus-operator/component_test.go b/pkg/components/prometheus-operator/component_test.go
index 93c2911a..c161b7d9 100644
--- a/pkg/components/prometheus-operator/component_test.go
+++ b/pkg/components/prometheus-operator/component_test.go
@@ -24,6 +24,8 @@ import (

 //nolint:funlen
 func TestRenderManifest(t *testing.T) {
+       t.Parallel()
+
        tests := []struct {
                desc    string
                hcl     string
@@ -143,6 +145,8 @@ component "prometheus-operator" {
        for _, tc := range tests {
                tc := tc
                t.Run(tc.desc, func(t *testing.T) {
+                       t.Parallel()
+
                        b, d := util.GetComponentBody(tc.hcl, Name)
                        if d != nil {
                                t.Fatalf("error getting component body: %v", d)
@@ -177,6 +181,8 @@ component "prometheus-operator" {

 //nolint:funlen
 func TestConversion(t *testing.T) {
+       t.Parallel()
+
        testCases := []struct {
                name                 string
                inputConfig          string

This cuts down test execution time from 14 seconds to 4 seconds on my machine. Still slow, but better.

invidian commented 3 years ago

@invidian I think you said Looks OK and submitted it via request changes. So had to request again smile

I only commented, not requested changes :) Changes looks good to me, but I think some other maintainer should have a look into it and approve it for merging.

knrt10 commented 3 years ago

@invidian I think you said Looks OK and submitted it via request changes. So had to request again 😄

surajssd commented 3 years ago

@knrt10 can you rebase on the current master the ARM issue will be solved.

knrt10 commented 3 years ago

AWS is still failing on certificate rotation part.

knrt10 commented 3 years ago

finally, yes