K8s: Remove grafanaAPIServer feature toggle (#81030)

pull/81117/head
Ryan McKinley 2 years ago committed by GitHub
parent aa25776f81
commit 2b355ff280
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md
  2. 1
      packages/grafana-data/src/types/featureToggles.gen.ts
  3. 14
      pkg/infra/metrics/service.go
  4. 9
      pkg/services/featuremgmt/registry.go
  5. 1
      pkg/services/featuremgmt/toggles_gen.csv
  6. 4
      pkg/services/featuremgmt/toggles_gen.go
  7. 2
      pkg/services/grafana-apiserver/config.go
  8. 2
      pkg/services/grafana-apiserver/config_test.go
  9. 2
      pkg/tests/apis/dashboard/dashboards_test.go
  10. 1
      pkg/tests/apis/datasource/testdata_test.go
  11. 1
      pkg/tests/apis/example/example_test.go
  12. 1
      pkg/tests/apis/folders/folders_test.go
  13. 12
      pkg/tests/apis/playlist/playlist_test.go

@ -47,7 +47,6 @@ Some features are enabled by default. You can disable these feature by setting t
| `cloudWatchLogsMonacoEditor` | Enables the Monaco editor for CloudWatch Logs queries | Yes |
| `recordedQueriesMulti` | Enables writing multiple items from a single query within Recorded Queries | Yes |
| `transformationsRedesign` | Enables the transformations redesign | Yes |
| `grafanaAPIServer` | Enable Kubernetes API Server for Grafana resources | Yes |
| `awsAsyncQueryCaching` | Enable caching for async queries for Redshift and Athena. Requires that the datasource has caching and async query support enabled | Yes |
| `splitScopes` | Support faster dashboard and folder search by splitting permission scopes into parts | Yes |
| `prometheusConfigOverhaulAuth` | Update the Prometheus configuration page with the new auth component | Yes |

@ -102,7 +102,6 @@ export interface FeatureToggles {
mlExpressions?: boolean;
traceQLStreaming?: boolean;
metricsSummary?: boolean;
grafanaAPIServer?: boolean;
grafanaAPIServerWithExperimentalAPIs?: boolean;
grafanaAPIServerEnsureKubectlAccess?: boolean;
featureToggleAdminPage?: boolean;

@ -12,7 +12,6 @@ import (
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/infra/metrics/graphitebridge"
"github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/setting"
)
@ -61,19 +60,12 @@ func (im *InternalMetricsService) Run(ctx context.Context) error {
}
func ProvideRegisterer(cfg *setting.Cfg) prometheus.Registerer {
if cfg.IsFeatureToggleEnabled(featuremgmt.FlagGrafanaAPIServer) {
return legacyregistry.Registerer()
}
return prometheus.DefaultRegisterer
return legacyregistry.Registerer()
}
func ProvideGatherer(cfg *setting.Cfg) prometheus.Gatherer {
if cfg.IsFeatureToggleEnabled(featuremgmt.FlagGrafanaAPIServer) {
k8sGatherer := newAddPrefixWrapper(legacyregistry.DefaultGatherer)
return newMultiRegistry(k8sGatherer, prometheus.DefaultGatherer)
}
return prometheus.DefaultGatherer
k8sGatherer := newAddPrefixWrapper(legacyregistry.DefaultGatherer)
return newMultiRegistry(k8sGatherer, prometheus.DefaultGatherer)
}
func ProvideRegistererForTest() prometheus.Registerer {

@ -714,15 +714,6 @@ var (
Owner: grafanaObservabilityTracesAndProfilingSquad,
Created: time.Date(2023, time.August, 28, 12, 0, 0, 0, time.UTC),
},
{
Name: "grafanaAPIServer",
Description: "Enable Kubernetes API Server for Grafana resources",
Stage: FeatureStageGeneralAvailability,
Expression: "true", // enabled by default
RequiresRestart: true,
Owner: grafanaAppPlatformSquad,
Created: time.Date(2023, time.July, 14, 12, 0, 0, 0, time.UTC),
},
{
Name: "grafanaAPIServerWithExperimentalAPIs",
Description: "Register experimental APIs with the k8s API server",

@ -83,7 +83,6 @@ transformationsRedesign,GA,@grafana/observability-metrics,2023-07-12,false,false
mlExpressions,experimental,@grafana/alerting-squad,2023-07-13,false,false,false,false
traceQLStreaming,experimental,@grafana/observability-traces-and-profiling,2023-07-26,false,false,false,true
metricsSummary,experimental,@grafana/observability-traces-and-profiling,2023-08-28,false,false,false,true
grafanaAPIServer,GA,@grafana/grafana-app-platform-squad,2023-07-14,false,false,true,false
grafanaAPIServerWithExperimentalAPIs,experimental,@grafana/grafana-app-platform-squad,2023-10-06,true,false,true,false
grafanaAPIServerEnsureKubectlAccess,experimental,@grafana/grafana-app-platform-squad,2023-12-06,true,false,true,false
featureToggleAdminPage,experimental,@grafana/grafana-operator-experience-squad,2023-07-18,false,false,true,false

1 Name Stage Owner Created requiresDevMode RequiresLicense RequiresRestart FrontendOnly
83 mlExpressions experimental @grafana/alerting-squad 2023-07-13 false false false false
84 traceQLStreaming experimental @grafana/observability-traces-and-profiling 2023-07-26 false false false true
85 metricsSummary experimental @grafana/observability-traces-and-profiling 2023-08-28 false false false true
grafanaAPIServer GA @grafana/grafana-app-platform-squad 2023-07-14 false false true false
86 grafanaAPIServerWithExperimentalAPIs experimental @grafana/grafana-app-platform-squad 2023-10-06 true false true false
87 grafanaAPIServerEnsureKubectlAccess experimental @grafana/grafana-app-platform-squad 2023-12-06 true false true false
88 featureToggleAdminPage experimental @grafana/grafana-operator-experience-squad 2023-07-18 false false true false

@ -343,10 +343,6 @@ const (
// Enables metrics summary queries in the Tempo data source
FlagMetricsSummary = "metricsSummary"
// FlagGrafanaAPIServer
// Enable Kubernetes API Server for Grafana resources
FlagGrafanaAPIServer = "grafanaAPIServer"
// FlagGrafanaAPIServerWithExperimentalAPIs
// Register experimental APIs with the k8s API server
FlagGrafanaAPIServerWithExperimentalAPIs = "grafanaAPIServerWithExperimentalAPIs"

@ -46,7 +46,7 @@ func newConfig(cfg *setting.Cfg, features featuremgmt.FeatureToggles) *config {
host := fmt.Sprintf("%s:%d", ip, port)
return &config{
enabled: features.IsEnabledGlobally(featuremgmt.FlagGrafanaAPIServer),
enabled: true,
devMode: features.IsEnabledGlobally(featuremgmt.FlagGrafanaAPIServerEnsureKubectlAccess),
dataPath: filepath.Join(cfg.DataPath, "grafana-apiserver"),
ip: ip,

@ -22,7 +22,7 @@ func TestNewConfig(t *testing.T) {
section.Key("log_level").SetValue("5")
section.Key("etcd_servers").SetValue("http://localhost:2379")
actual := newConfig(cfg, featuremgmt.WithFeatures(featuremgmt.FlagGrafanaAPIServer))
actual := newConfig(cfg, featuremgmt.WithFeatures())
expected := &config{
enabled: true,

@ -18,7 +18,6 @@ func TestRequiresDevMode(t *testing.T) {
AppModeProduction: true, // should fail
DisableAnonymous: true,
EnableFeatureToggles: []string{
featuremgmt.FlagGrafanaAPIServer,
featuremgmt.FlagGrafanaAPIServerWithExperimentalAPIs, // Required to start the example service
},
})
@ -35,7 +34,6 @@ func TestDashboardsApp(t *testing.T) {
AppModeProduction: false, // required for experimental APIs
DisableAnonymous: true,
EnableFeatureToggles: []string{
featuremgmt.FlagGrafanaAPIServer,
featuremgmt.FlagGrafanaAPIServerWithExperimentalAPIs, // Required to start the example service
},
})

@ -22,7 +22,6 @@ func TestTestDatasource(t *testing.T) {
AppModeProduction: false, // dev mode required for datasource connections
DisableAnonymous: true,
EnableFeatureToggles: []string{
featuremgmt.FlagGrafanaAPIServer,
featuremgmt.FlagGrafanaAPIServerWithExperimentalAPIs, // Required to start the example service
},
})

@ -23,7 +23,6 @@ func TestExampleApp(t *testing.T) {
AppModeProduction: false, // required for experimental APIs
DisableAnonymous: true,
EnableFeatureToggles: []string{
featuremgmt.FlagGrafanaAPIServer,
featuremgmt.FlagGrafanaAPIServerWithExperimentalAPIs, // Required to start the example service
},
})

@ -19,7 +19,6 @@ func TestFoldersApp(t *testing.T) {
AppModeProduction: false, // required for experimental APIs
DisableAnonymous: true,
EnableFeatureToggles: []string{
featuremgmt.FlagGrafanaAPIServer,
featuremgmt.FlagGrafanaAPIServerWithExperimentalAPIs, // Required to start the example service
},
})

@ -33,11 +33,9 @@ func TestPlaylist(t *testing.T) {
t.Run("default setup", func(t *testing.T) {
h := doPlaylistTests(t, apis.NewK8sTestHelper(t, testinfra.GrafanaOpts{
AppModeProduction: true, // do not start extra port 6443
DisableAnonymous: true,
EnableFeatureToggles: []string{
featuremgmt.FlagGrafanaAPIServer,
},
AppModeProduction: true, // do not start extra port 6443
DisableAnonymous: true,
EnableFeatureToggles: []string{},
}))
// The accepted verbs will change when dual write is enabled
@ -76,7 +74,6 @@ func TestPlaylist(t *testing.T) {
AppModeProduction: true, // do not start extra port 6443
DisableAnonymous: true,
EnableFeatureToggles: []string{
featuremgmt.FlagGrafanaAPIServer,
featuremgmt.FlagKubernetesPlaylists, // <<< The change we are testing!
},
}))
@ -88,7 +85,6 @@ func TestPlaylist(t *testing.T) {
DisableAnonymous: true,
APIServerStorageType: "file", // write the files to disk
EnableFeatureToggles: []string{
featuremgmt.FlagGrafanaAPIServer,
featuremgmt.FlagKubernetesPlaylists, // Required so that legacy calls are also written
},
}))
@ -101,7 +97,6 @@ func TestPlaylist(t *testing.T) {
APIServerStorageType: "unified", // use the entity api tables
EnableFeatureToggles: []string{
featuremgmt.FlagUnifiedStorage,
featuremgmt.FlagGrafanaAPIServer,
featuremgmt.FlagKubernetesPlaylists, // Required so that legacy calls are also written
},
}))
@ -116,7 +111,6 @@ func TestPlaylist(t *testing.T) {
DisableAnonymous: true,
APIServerStorageType: "etcd", // requires etcd running on localhost:2379
EnableFeatureToggles: []string{
featuremgmt.FlagGrafanaAPIServer,
featuremgmt.FlagKubernetesPlaylists, // Required so that legacy calls are also written
},
})

Loading…
Cancel
Save