Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce integration framework backend #2017

Merged
merged 15 commits into from
Jul 3, 2017
2 changes: 1 addition & 1 deletion i18n/messages-en.xtb
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,7 @@
<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>
<translation id="5636111591527461304" key="MSG_SECRET_LIST_CARDLIST_4" desc="Text for secret card list zerostate.">There are no Secrets to display.</translation>
<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>
<translation id="4995313458787786058" key="MSG_SERVICES_LABEL" desc="Label 'Services' that appears as a breadcrumbs on the action bar.">Services</translation>
<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>
<translation id="8542374982013786209" key="MSG_SERVICE_DETAIL_INFO_0" desc="Header in a detail view">Details</translation>
<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>
Expand Down Expand Up @@ -867,5 +868,4 @@
<translation id="4302564966959880468" key="MSG_WORKLOADS_WORKLOADS_0" desc="Title for graph card displaying CPU metric of one all resources.">CPU usage</translation>
<translation id="1036433586363793837" key="MSG_WORKLOADS_WORKLOADS_1" desc="Title for graph card displaying memory metric of one all resources.">Memory usage</translation>
<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>
<translation id="6487218483864052953" key="MSG_serviceS_LABEL" desc="Label 'Services' that appears as a breadcrumbs on the action bar.">Services</translation>
</translationbundle>
2 changes: 1 addition & 1 deletion i18n/messages-ja.xtb
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,7 @@
<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>
<translation id="4995313458787786058" key="MSG_SERVICES_LABEL" desc="Label 'Services' that appears as a breadcrumbs on the action bar.">Services</translation>
<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>
<translation id="8542374982013786209" key="MSG_SERVICE_DETAIL_INFO_0" desc="Header in a detail view">Details</translation>
<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>
Expand Down Expand Up @@ -905,5 +906,4 @@
<translation id="661429075091310977" key="MSG_WORKLOADS_WORKLOADS_0" desc="Title for graph card displaying CPU metric of one all resources.">CPU使用量の履歴</translation>
<translation id="1036433586363793837" key="MSG_WORKLOADS_WORKLOADS_1" desc="Title for graph card displaying memory metric of one all resources.">メモリー使用量</translation>
<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>
<translation id="6487218483864052953" key="MSG_serviceS_LABEL" desc="Label 'Services' that appears as a breadcrumbs on the action bar.">Services</translation>
</translationbundle>
2 changes: 1 addition & 1 deletion i18n/messages-zh.xtb
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,7 @@
<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>
<translation id="5636111591527461304" key="MSG_SECRET_LIST_CARDLIST_4" desc="Text for secret card list zerostate.">There are no Secrets to display.</translation>
<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>
<translation id="4995313458787786058" key="MSG_SERVICES_LABEL" desc="Label 'Services' that appears as a breadcrumbs on the action bar.">Services</translation>
<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>
<translation id="8542374982013786209" key="MSG_SERVICE_DETAIL_INFO_0" desc="Header in a detail view">Details</translation>
<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>
Expand Down Expand Up @@ -867,5 +868,4 @@
<translation id="4302564966959880468" key="MSG_WORKLOADS_WORKLOADS_0" desc="Title for graph card displaying CPU metric of one all resources.">CPU使用</translation>
<translation id="1036433586363793837" key="MSG_WORKLOADS_WORKLOADS_1" desc="Title for graph card displaying memory metric of one all resources.">内存使用</translation>
<translation id="5680064618107855853" key="MSG_WORKLOADS_WORKLOADS_2" desc="Help message detailing what is included in the memory usage">内存使用上包括相关Pod的缓存(不要重复计算Pod使用,在PodList及控制如ReplicaSet上)</translation>
<translation id="6487218483864052953" key="MSG_serviceS_LABEL" desc="Label 'Services' that appears as a breadcrumbs on the action bar.">Services</translation>
</translationbundle>
14 changes: 9 additions & 5 deletions src/app/backend/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ import (

"github.com/kubernetes/dashboard/src/app/backend/client"
"github.com/kubernetes/dashboard/src/app/backend/handler"
"github.com/kubernetes/dashboard/src/app/backend/integration/metric/heapster"
"github.com/kubernetes/dashboard/src/app/backend/integration"
integrationapi "github.com/kubernetes/dashboard/src/app/backend/integration/api"
"github.com/prometheus/client_golang/prometheus"
"github.com/spf13/pflag"
)
Expand Down Expand Up @@ -76,14 +77,17 @@ func main() {

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

heapsterRESTClient, err := heapster.CreateHeapsterRESTClient(*argHeapsterHost,
apiserverClient)
// Init integrations
integrationManager := integration.NewIntegrationManager(clientManager)
err = integrationManager.Metric().
ConfigureHeapster(*argHeapsterHost).
Enable(integrationapi.HeapsterIntegrationID)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the long run, could we move argHeapsterHost into the config map?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, what is the intended workflow if a user wants to use Prometheus instead of Heapster. Or maybe has already Prometheus installed and then deploys dashboard?

Copy link
Member Author

@floreks floreks Jun 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any integration still requires some code to be pushed upstream. We'd need to implement prometheus client that implements MetricClient interface.

Normally with settings page user will be able to check state of integrations, i.e. if prometheus is not installed in the cluster then user goes to settings page clicks install near prometheus integration and then enables it. That would automatically disable other metric clients.

Once we have more options to choose from we can disable default one and let user decide which one to enable.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm...I wonder if this is the right approach. I have not checked the api or anything lately, but my understanding that we do not have to care about which monitoring system is installed. We just use the api facade from apiserver. Also, installing a monitoring system might not be as easy as installing e.g. tiller.

The old issue: #1310

However, we should care about the integration of Graphana.

Copy link
Member Author

@floreks floreks Jun 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not checked the api or anything lately, but my understanding that we do not have to care about which monitoring system is installed.

There were only plans to introduce interfaces directly in kubernetes that will scrape metrics and work independent of chosen monitoring solution. Unfortunately it is not there and I don't know if or when it will be introduced. Since there is no such facade then we have to take care of that for now.

Anyway if they introduce such API then it will be easy to get rid of monitoring specific code and just rely on this new API.

Also, installing a monitoring system might not be as easy as installing e.g. tiller.

Installing integration is not the hard part. For supported integrations we can versionize required yaml files on our repository and just use them to deploy what's needed (heapster + influx, tiller, etc.).

However, we should care about the integration of Graphana.

Do we? I thought integrations should improve dashboard's experience and grafana is an external UI for monitoring. How would such integration look like?

if err != nil {
log.Printf("Could not create heapster client: %s. Continuing.", err)
log.Printf("Could not enable metric client: %s. Continuing.", err)
}

apiHandler, err := handler.CreateHTTPAPIHandler(
heapsterRESTClient,
integrationManager,
clientManager)
if err != nil {
handleFatalInitError(err)
Expand Down
Loading