Documentation ¶
Index ¶
- Constants
- Variables
- func NewConfigFor(k *model.Kube) (*rest.Config, error)
- type Bundle
- type Certs
- type ChartGetter
- type Handler
- type Interface
- type K8SServices
- type MetricResponse
- type ReleaseInput
- type ServerResourceGetter
- type Service
- func (s *Service) Create(ctx context.Context, k *model.Kube) error
- func (s *Service) Delete(ctx context.Context, kubeID string) error
- func (s *Service) DeleteRelease(ctx context.Context, kubeID, rlsName string, purge bool) (*model.ReleaseInfo, error)
- func (s *Service) Get(ctx context.Context, kubeID string) (*model.Kube, error)
- func (s *Service) GetCerts(ctx context.Context, kname, cname string) (*Bundle, error)
- func (s *Service) GetKubeResources(ctx context.Context, kubeID, resource, ns, name string) ([]byte, error)
- func (s *Service) InstallRelease(ctx context.Context, kubeID string, rls *ReleaseInput) (*release.Release, error)
- func (s *Service) KubeConfigFor(ctx context.Context, kubeID, user string) ([]byte, error)
- func (s *Service) ListAll(ctx context.Context) ([]model.Kube, error)
- func (s *Service) ListKubeResources(ctx context.Context, kubeID string) ([]byte, error)
- func (s *Service) ListReleases(ctx context.Context, kubeID, namespace, offset string, limit int) ([]*model.ReleaseInfo, error)
- type ServiceProxy
Constants ¶
View Source
const ( KubernetesAdminUser = "kubernetes-admin" DefaultStoragePrefix = "/supergiant/kubes/" )
View Source
const (
DefaultCertsPath = "/etc/kubernets/ssl"
)
Default variables for certs.
Variables ¶
View Source
var ( ErrInvalidRunner = errors.New("provided invalid runner") ErrEmptyName = errors.New("empty name") )
Certs specific errors.
Functions ¶
Types ¶
type Certs ¶
type Certs struct {
// contains filtered or unexported fields
}
Certs handles keys and certificates for kube components.
type ChartGetter ¶
type ChartGetter interface {
GetChart(ctx context.Context, repoName, chartName, chartVersion string) (*chart.Chart, error)
}
ChartGetter interface is a wrapper for GetChart function.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is a http controller for a kube entity.
type Interface ¶
type Interface interface { Create(ctx context.Context, k *model.Kube) error Get(ctx context.Context, name string) (*model.Kube, error) ListAll(ctx context.Context) ([]model.Kube, error) Delete(ctx context.Context, name string) error KubeConfigFor(ctx context.Context, kname, user string) ([]byte, error) ListKubeResources(ctx context.Context, kname string) ([]byte, error) GetKubeResources(ctx context.Context, kname, resource, ns, name string) ([]byte, error) GetCerts(ctx context.Context, kname, cname string) (*Bundle, error) InstallRelease(ctx context.Context, kname string, rls *ReleaseInput) (*release.Release, error) ListReleases(ctx context.Context, kname, ns, offset string, limit int) ([]*model.ReleaseInfo, error) DeleteRelease(ctx context.Context, kname, rlsName string, purge bool) (*model.ReleaseInfo, error) }
Interface represents an interface for a kube service.
type K8SServices ¶
type K8SServices struct { Kind string `json:"kind"` APIVersion string `json:"apiVersion"` Metadata struct { SelfLink string `json:"selfLink"` ResourceVersion string `json:"resourceVersion"` } `json:"metadata"` Items []struct { Metadata struct { Name string `json:"name"` Namespace string `json:"namespace"` SelfLink string `json:"selfLink"` UID string `json:"uid"` ResourceVersion string `json:"resourceVersion"` CreationTimestamp time.Time `json:"creationTimestamp"` Labels struct { OperatedAlertmanager string `json:"operated-alertmanager"` } `json:"labels"` } `json:"metadata"` Spec struct { Ports []struct { Name string `json:"name"` Protocol string `json:"protocol"` Port int `json:"port"` } `json:"ports"` Selector struct { App string `json:"app"` } `json:"selector"` ClusterIP string `json:"clusterIP"` Type string `json:"type"` SessionAffinity string `json:"sessionAffinity"` } `json:"spec"` Status struct { LoadBalancer struct { } `json:"loadBalancer"` } `json:"status"` } `json:"items"` }
type MetricResponse ¶
type ReleaseInput ¶
type ServerResourceGetter ¶
type ServerResourceGetter interface {
ServerResources() ([]*metav1.APIResourceList, error)
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service manages kubernetes clusters.
func NewService ¶
func NewService(prefix string, s storage.Interface, chrtGetter ChartGetter) *Service
NewService constructs a Service.
func (*Service) DeleteRelease ¶
func (*Service) GetCerts ¶
GetCerts returns a keys bundle for provided component name. TODO: do we need this?
func (*Service) GetKubeResources ¶
func (s *Service) GetKubeResources(ctx context.Context, kubeID, resource, ns, name string) ([]byte, error)
GetKubeResources returns raw representation of the kubernetes resources.
func (*Service) InstallRelease ¶
func (*Service) KubeConfigFor ¶
func (*Service) ListKubeResources ¶
ListKubeResources returns raw representation of the supported kubernetes resources.
func (*Service) ListReleases ¶
type ServiceProxy ¶
Click to show internal directories.
Click to hide internal directories.