spec

package
v0.3.0-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2016 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const GroupName = "platform.koli.io"

GroupName is the group name use in this package

View Source
const KoliPrefixValue = "koli.io"

KoliPrefixValue is used for creating annotations and labels

View Source
const (
	// ResourceNamespace , number
	ResourceNamespace api.ResourceName = "namespaces"
)

Variables

View Source
var (
	// SchemeBuilder collects functions that add things to a scheme. It's to allow
	// code to compile without explicitly referencing generated types. You should
	// declare one in each package that will have generated deep copy or conversion
	// functions.
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	// AddToScheme applies all the stored functions to the scheme. A non-nil error
	// indicates that one function failed and the attempt was abandoned.
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var PlatformRegisteredRoles []PlatformRole

PlatformRegisteredRoles contains all the cluster roles provisioned on the platform

View Source
var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: "v1alpha1"}

SchemeGroupVersion is group version used to register these objects var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal}

Functions

func Kind

func Kind(kind string) unversioned.GroupKind

Kind takes an unqualified kind and returns a Group qualified GroupKind

func KoliPrefix

func KoliPrefix(value string) string

KoliPrefix returns a value with the default prefix - spec.KoliPrefix

func Resource

func Resource(resource string) unversioned.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type Addon

type Addon struct {
	unversioned.TypeMeta `json:",inline"`
	api.ObjectMeta       `json:"metadata,omitempty"`
	Spec                 AddonSpec `json:"spec"`
}

Addon defines integration with external resources

func (*Addon) GetImage

func (a *Addon) GetImage() string

GetImage gets the BaseImage + Version

func (*Addon) GetReplicas

func (a *Addon) GetReplicas() int32

GetReplicas returns the size of replicas, if is less than 1 sets a default value

type AddonList

type AddonList struct {
	unversioned.TypeMeta `json:",inline"`
	unversioned.ListMeta `json:"metadata,omitempty"`

	Items []Addon `json:"items"`
}

AddonList is a list of Addons.

type AddonSpec

type AddonSpec struct {
	Type      string       `json:"type"`
	BaseImage string       `json:"baseImage"`
	Version   string       `json:"version"`
	Replicas  int32        `json:"replicas"`
	Port      int32        `json:"port"`
	Env       []api.EnvVar `json:"env"`
	// More info: http://releases.k8s.io/HEAD/docs/user-guide/containers.md#containers-and-commands
	Args []string `json:"args,omitempty"`
}

AddonSpec holds specification parameters of an addon

type Label

type Label struct {
	labels.Set
	Prefix string
}

Label wraps a labels.Set

func NewLabel

func NewLabel(prefixS ...string) *Label

NewLabel generates a new *spec.Label, if a prefix isn't provided it will use the the default one: spec.KoliPrefixValue.

func (*Label) Add

func (l *Label) Add(mapLabels map[string]string) *Label

Add values to a labels.Set using a pre-defined prefix

func (*Label) Exists

func (l *Label) Exists(key string) bool

Exists verifies if the given key exists

func (*Label) Remove

func (l *Label) Remove(key string) *Label

Remove a key from the labels.Set using a pre-defined prefix

type PlatformRole

type PlatformRole string

PlatformRole is the name identifying various roles in a PlatformRoleList.

const (
	// RoleExecAllow cluster role name
	RoleExecAllow PlatformRole = "exec-allow"
	// RolePortForwardAllow cluster role name
	RolePortForwardAllow PlatformRole = "portforward-allow"
	// RoleAutoScaleAllow cluster role name
	RoleAutoScaleAllow PlatformRole = "autoscale-allow"
	// RoleAttachAllow cluster role name
	RoleAttachAllow PlatformRole = "attach-allow"
	// RoleAddonManagement cluster role name
	RoleAddonManagement PlatformRole = "addon-management"
)

func NewPlatformRoles

func NewPlatformRoles(roles string) []PlatformRole

NewPlatformRoles converts a string of comma separated roles to registered []PlatformRoles

func (PlatformRole) Exists

func (r PlatformRole) Exists(roles []PlatformRole) bool

Exists verifies if the slice contains the role

func (PlatformRole) GetRoleBinding

func (r PlatformRole) GetRoleBinding(subjects []rbac.Subject) *rbac.RoleBinding

GetRoleBinding retrieves a role binding for this role

func (PlatformRole) IsRegisteredRole

func (r PlatformRole) IsRegisteredRole() bool

IsRegisteredRole check if the role matches with the registered roles.

type ResourceList

type ResourceList api.ResourceList

ResourceList is a set of (resource name, quantity) pairs.

var PlatformRegisteredResources *ResourceList

PlatformRegisteredResources contains all the resources allowed for a user to configure in resource quotas: http://kubernetes.io/docs/admin/resourcequota/#Object-Count-Quota

func (*ResourceList) RemoveUnregisteredResources

func (r *ResourceList) RemoveUnregisteredResources()

RemoveUnregisteredResources removes resources which are not registered on the platform

type ServicePlan

type ServicePlan struct {
	unversioned.TypeMeta `json:",inline"`
	api.ObjectMeta       `json:"metadata,omitempty"`

	Spec ServicePlanSpec `json:"spec"`
}

ServicePlan defines how resources could be managed and distributed

type ServicePlanList

type ServicePlanList struct {
	unversioned.TypeMeta `json:",inline"`
	unversioned.ListMeta `json:"metadata,omitempty"`

	Items []ServicePlan `json:"items"`
}

ServicePlanList is a list of ServicePlans

type ServicePlanPhase

type ServicePlanPhase string

ServicePlanPhase is the current lifecycle phase of the Service Plan.

const (
	// ServicePlanActive means the ServicePlan is available for use in the system
	ServicePlanActive ServicePlanPhase = "Active"
	// ServicePlanPending means the ServicePlan isn't associate with any global ServicePlan
	ServicePlanPending ServicePlanPhase = "Pending"
	// ServicePlanNotFound means the reference plan wasn't found
	ServicePlanNotFound ServicePlanPhase = "NotFound"
	// ServicePlanDisabled means the ServicePlan is disabled and cannot be associated with resources
	ServicePlanDisabled ServicePlanPhase = "Disabled"
)

type ServicePlanSpec

type ServicePlanSpec struct {
	// Compute Resources required by containers.
	Resources api.ResourceRequirements `json:"resources,omitempty"`
	// Hard is the set of desired hard limits for each named resource.
	Hard  ResourceList   `json:"hard,omitempty"`
	Roles []PlatformRole `json:"roles,omitempty"`
}

ServicePlanSpec holds specification parameters of an ServicePlan

type ServicePlanStatus

type ServicePlanStatus struct {
	unversioned.TypeMeta `json:",inline"`
	api.ObjectMeta       `json:"metadata,omitempty"`

	// Phase is the current lifecycle phase of the namespace.
	Phase ServicePlanPhase `json:"phase"`
}

ServicePlanStatus is information about the current status of a ServicePlan.

type ServicePlanStatusList

type ServicePlanStatusList struct {
	unversioned.TypeMeta `json:",inline"`
	unversioned.ListMeta `json:"metadata,omitempty"`

	Items []ServicePlanStatus `json:"items"`
}

ServicePlanStatusList is a list of ServicePlanStatus

type User

type User struct {
	ID           string `json:"id"`
	Username     string `json:"username"`
	Customer     string `json:"customer"`
	Organization string `json:"org"`
	// Groups are a set of strings which associate users with as set of commonly grouped users.
	// A group name is unique in the cluster and it's formed by it's namespace, customer or the organization name:
	// [org] - Matches all the namespaces of the broker
	// [customer]-[org] - Matches all namespaces from the customer broker
	// [name]-[customer]-[org] - Matches a specific namespace
	// http://kubernetes.io/docs/admin/authentication/
	Groups []string `json:"groups"`
}

User identifies an user on the platform

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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