Add supports for stats in ACI provider

This adds a new, optional, interface for providers that want to provide
stats.
This commit is contained in:
Brian Goff
2018-08-02 17:06:50 -07:00
parent 6284757aa1
commit e8abca0ac9
11 changed files with 643 additions and 5 deletions

View File

@@ -1,12 +1,14 @@
package vkubelet
import (
"context"
"io"
"time"
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/tools/remotecommand"
stats "k8s.io/kubernetes/pkg/kubelet/apis/stats/v1alpha1"
)
// Provider contains the methods required to implement a virtual-kubelet provider.
@@ -54,3 +56,8 @@ type Provider interface {
// OperatingSystem returns the operating system the provider is for.
OperatingSystem() string
}
// MetricsProvider is an optional interface that providers can implement to expose pod stats
type MetricsProvider interface {
GetStatsSummary(context.Context) (*stats.Summary, error)
}