Skip to content

Commit fb10919

Browse files
floreksmaciaszczykm
authored andcommitted
Introduce integration framework backend (#2017)
* Remove hard dependencies on heapster from resources * Introduce integration manager * Fix tests * Fix state check * Add cached resources to metrics api * Fix sparklines * Refactor labels to use resource UID instead of string * Update documentation * Remove unused tests and update docs * Format files * Fix tests and bug during compression heapster selectors * Add tests * Improve documentation * Move integration list to separate file * Resolve conflicts
1 parent e42a910 commit fb10919

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+3077
-1971
lines changed

i18n/messages-en.xtb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,7 @@
759759
<translation id="4493598488188566434" key="MSG_SECRET_LIST_CARDLIST_3" desc="Label \'Age\' which appears as a column label in the table of secrets (secret list view).">Age</translation>
760760
<translation id="5636111591527461304" key="MSG_SECRET_LIST_CARDLIST_4" desc="Text for secret card list zerostate.">There are no Secrets to display.</translation>
761761
<translation id="2799384691872397176" key="MSG_SECRET_LIST_STARTED_AT_TOOLTIP" desc="Tooltip 'Started at [some date]' showing the exact start time of the secret.">Created at <ph name="START_DATE"> UTC</ph></translation>
762+
<translation id="4995313458787786058" key="MSG_SERVICES_LABEL" desc="Label 'Services' that appears as a breadcrumbs on the action bar.">Services</translation>
762763
<translation id="2095406541360162780" key="MSG_SERVICE_DETAIL_DETAIL_1" desc="Text for pods card zerostate in stateful set details page.">There are currently no Pods selected by this Service.</translation>
763764
<translation id="8542374982013786209" key="MSG_SERVICE_DETAIL_INFO_0" desc="Header in a detail view">Details</translation>
764765
<translation id="7974388484711199446" key="MSG_SERVICE_DETAIL_INFO_1" desc="Label \'Label selector\' for the service\'s label selector in the details part (left) of the service details view.">Label selector</translation>
@@ -867,5 +868,4 @@
867868
<translation id="4302564966959880468" key="MSG_WORKLOADS_WORKLOADS_0" desc="Title for graph card displaying CPU metric of one all resources.">CPU usage</translation>
868869
<translation id="1036433586363793837" key="MSG_WORKLOADS_WORKLOADS_1" desc="Title for graph card displaying memory metric of one all resources.">Memory usage</translation>
869870
<translation id="5680064618107855853" key="MSG_WORKLOADS_WORKLOADS_2" desc="Help message detailing what is included in the memory usage">The memory usage includes the caches in the pods managed by these resources. (Does not count pods double because it is mentioned both in the pod list and its controller is mentioned in e.g. a replica set.)</translation>
870-
<translation id="6487218483864052953" key="MSG_serviceS_LABEL" desc="Label 'Services' that appears as a breadcrumbs on the action bar.">Services</translation>
871871
</translationbundle>

i18n/messages-ja.xtb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,7 @@
791791
<translation id="2799384691872397176" key="MSG_SECRET_LIST_STARTED_AT_TOOLTIP" desc="Tooltip 'Started at [some date]' showing the exact start time of the secret.">
792792
<ph name="START_DATE"> UTC に作成</ph>
793793
</translation>
794+
<translation id="4995313458787786058" key="MSG_SERVICES_LABEL" desc="Label 'Services' that appears as a breadcrumbs on the action bar.">Services</translation>
794795
<translation id="2095406541360162780" key="MSG_SERVICE_DETAIL_DETAIL_1" desc="Text for pods card zerostate in stateful set details page.">There are currently no Pods selected by this Service.</translation>
795796
<translation id="8542374982013786209" key="MSG_SERVICE_DETAIL_INFO_0" desc="Header in a detail view">Details</translation>
796797
<translation id="7974388484711199446" key="MSG_SERVICE_DETAIL_INFO_1" desc="Label \'Label selector\' for the service\'s label selector in the details part (left) of the service details view.">Label selector</translation>
@@ -905,5 +906,4 @@
905906
<translation id="661429075091310977" key="MSG_WORKLOADS_WORKLOADS_0" desc="Title for graph card displaying CPU metric of one all resources.">CPU使用量の履歴</translation>
906907
<translation id="1036433586363793837" key="MSG_WORKLOADS_WORKLOADS_1" desc="Title for graph card displaying memory metric of one all resources.">メモリー使用量</translation>
907908
<translation id="1673466418940035630" key="MSG_WORKLOADS_WORKLOADS_2" desc="Label &quot;Daemon sets&quot;, which appears above the daemon sets list on the workloads page.">デーモンセット</translation>
908-
<translation id="6487218483864052953" key="MSG_serviceS_LABEL" desc="Label 'Services' that appears as a breadcrumbs on the action bar.">Services</translation>
909909
</translationbundle>

i18n/messages-zh.xtb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,7 @@
759759
<translation id="4493598488188566434" key="MSG_SECRET_LIST_CARDLIST_3" desc="Label \'Age\' which appears as a column label in the table of secrets (secret list view).">Age</translation>
760760
<translation id="5636111591527461304" key="MSG_SECRET_LIST_CARDLIST_4" desc="Text for secret card list zerostate.">There are no Secrets to display.</translation>
761761
<translation id="2799384691872397176" key="MSG_SECRET_LIST_STARTED_AT_TOOLTIP" desc="Tooltip 'Started at [some date]' showing the exact start time of the secret.">创建于<ph name="START_DATE"> UTC</ph></translation>
762+
<translation id="4995313458787786058" key="MSG_SERVICES_LABEL" desc="Label 'Services' that appears as a breadcrumbs on the action bar.">Services</translation>
762763
<translation id="2095406541360162780" key="MSG_SERVICE_DETAIL_DETAIL_1" desc="Text for pods card zerostate in stateful set details page.">There are currently no Pods selected by this Service.</translation>
763764
<translation id="8542374982013786209" key="MSG_SERVICE_DETAIL_INFO_0" desc="Header in a detail view">Details</translation>
764765
<translation id="7974388484711199446" key="MSG_SERVICE_DETAIL_INFO_1" desc="Label \'Label selector\' for the service\'s label selector in the details part (left) of the service details view.">Label selector</translation>
@@ -867,5 +868,4 @@
867868
<translation id="4302564966959880468" key="MSG_WORKLOADS_WORKLOADS_0" desc="Title for graph card displaying CPU metric of one all resources.">CPU使用</translation>
868869
<translation id="1036433586363793837" key="MSG_WORKLOADS_WORKLOADS_1" desc="Title for graph card displaying memory metric of one all resources.">内存使用</translation>
869870
<translation id="5680064618107855853" key="MSG_WORKLOADS_WORKLOADS_2" desc="Help message detailing what is included in the memory usage">内存使用上包括相关Pod的缓存(不要重复计算Pod使用,在PodList及控制如ReplicaSet上)</translation>
870-
<translation id="6487218483864052953" key="MSG_serviceS_LABEL" desc="Label 'Services' that appears as a breadcrumbs on the action bar.">Services</translation>
871871
</translationbundle>

src/app/backend/dashboard.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ import (
2424

2525
"github.com/kubernetes/dashboard/src/app/backend/client"
2626
"github.com/kubernetes/dashboard/src/app/backend/handler"
27-
"github.com/kubernetes/dashboard/src/app/backend/integration/metric/heapster"
27+
"github.com/kubernetes/dashboard/src/app/backend/integration"
28+
integrationapi "github.com/kubernetes/dashboard/src/app/backend/integration/api"
2829
"github.com/prometheus/client_golang/prometheus"
2930
"github.com/spf13/pflag"
3031
)
@@ -76,14 +77,17 @@ func main() {
7677

7778
log.Printf("Successful initial request to the apiserver, version: %s", versionInfo.String())
7879

79-
heapsterRESTClient, err := heapster.CreateHeapsterRESTClient(*argHeapsterHost,
80-
apiserverClient)
80+
// Init integrations
81+
integrationManager := integration.NewIntegrationManager(clientManager)
82+
err = integrationManager.Metric().
83+
ConfigureHeapster(*argHeapsterHost).
84+
Enable(integrationapi.HeapsterIntegrationID)
8185
if err != nil {
82-
log.Printf("Could not create heapster client: %s. Continuing.", err)
86+
log.Printf("Could not enable metric client: %s. Continuing.", err)
8387
}
8488

8589
apiHandler, err := handler.CreateHTTPAPIHandler(
86-
heapsterRESTClient,
90+
integrationManager,
8791
clientManager)
8892
if err != nil {
8993
handleFatalInitError(err)

0 commit comments

Comments
 (0)