k8s

package
v0.0.0-...-174afc0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package k8s enables Kubernetes as the orchestration provider that aligns to the interfaces suggested by maya api server's orchprovider package.

This file registers Kubernetes as an orchestration provider plugin in maya api server. This orchestration is for persistent volume provisioners which also are registered in maya api server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewK8sOrchestrator

func NewK8sOrchestrator(label v1.NameLabel, name v1.OrchProviderRegistry) (orchprovider.OrchestratorInterface, error)

NewK8sOrchestrator provides a new instance of K8sOrchestrator.

func SetControllerClusterIPs

func SetControllerClusterIPs(svc k8sApiV1.Service, annotations map[string]string)

func SetControllerIPs

func SetControllerIPs(cp k8sApiV1.Pod, annotations map[string]string)

func SetControllerStatuses

func SetControllerStatuses(cp k8sApiV1.Pod, annotations map[string]string)

func SetIQN

func SetIQN(vsm string, annotations map[string]string)

func SetISCSITargetPortals

func SetISCSITargetPortals(svc k8sApiV1.Service, annotations map[string]string)

func SetReplicaCount

func SetReplicaCount(rd k8sApisExtnsBeta1.Deployment, annotations map[string]string)

func SetReplicaIPs

func SetReplicaIPs(rp k8sApiV1.Pod, annotations map[string]string)

func SetReplicaStatuses

func SetReplicaStatuses(rp k8sApiV1.Pod, annotations map[string]string)

func SetReplicaVolSize

func SetReplicaVolSize(rd k8sApisExtnsBeta1.Deployment, annotations map[string]string)

TODO Get it from Pod

func SetServiceStatuses

func SetServiceStatuses(svc k8sApiV1.Service, annotations map[string]string)

TODO Not sure !!

Types

type K8sClient

type K8sClient interface {
	// InCluster indicates whether the operation is within cluster or in a
	// different cluster
	InCluster() (bool, error)

	// NS provides the namespace where operations will be executed
	NS() (string, error)

	// TODO
	//    Rename to PodOps
	//
	// Pods provides all the CRUD operations associated w.r.t a POD
	Pods() (k8sCoreV1.PodInterface, error)

	// TODO
	//    Rename to ServiceOps
	//
	// Services provides all the CRUD operations associated w.r.t a Service
	Services() (k8sCoreV1.ServiceInterface, error)

	// DeploymentOps provides all the CRUD operations associated w.r.t a Deployment
	DeploymentOps() (k8sExtnsV1Beta1.DeploymentInterface, error)
}

K8sClient is an abstraction to operate on various k8s entities.

NOTE:

This abstraction makes use of K8s's client-go package.

type K8sUtilGetter

type K8sUtilGetter interface {
	GetK8sUtil(volProfile.VolumeProvisionerProfile) K8sUtilInterface
}

K8sUtilGetter is an abstraction to fetch instances of K8sUtilInterface

type K8sUtilInterface

type K8sUtilInterface interface {
	// Name of K8s utility
	Name() string

	// K8sClient fetches an instance of K8sClients. Will return
	// false if the util does not support providing K8sClients instance.
	K8sClient() (K8sClient, bool)
}

K8sUtilInterface is an abstraction over communicating with K8s APIs

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL