app

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2018 License: Apache-2.0 Imports: 47 Imported by: 0

Documentation

Index

Constants

View Source
const CACHED_REGISTRIES = "/opt/versioned_registries"

root dir of local cached VERSIONED REGISTRIES

View Source
const DefaultStorageAnnotation = "storageclass.beta.kubernetes.io/is-default-class"

DefaultStorageAnnotation is the Name of the default annotation used to indicate whether a storage class is the default.

View Source
const GcloudPath = "gcloud"

Assume gcloud is on the path.

View Source
const IAM_ADMIN_ROLE = "roles/resourcemanager.projectIamAdmin"
View Source
const JUPYTER_PROTOTYPE = "jupyterhub"

The name of the prototype for Jupyter.

View Source
const RecommendedConfigPathEnvVar = "KUBECONFIG"

RecommendedConfigPathEnvVar is a environment variable for path configuration

View Source
const RegistriesRoot = "/opt/registries"

Variables

This section is empty.

Functions

func GetRepoName added in v0.3.0

func GetRepoName(project string) string

func GetUpdatedPolicy added in v0.3.0

func GetUpdatedPolicy(currentPolicy *cloudresourcemanager.Policy, iamConf *IamConf, req ApplyIamRequest) cloudresourcemanager.Policy

func LoadConfig added in v0.2.0

func LoadConfig(path string, o interface{}) error

Load yaml config

func NewServer added in v0.3.0

func NewServer(appsDir string, registries []RegistryConfig) (*ksServer, error)

NewServer constructs a ksServer.

func Run

func Run(opt *options.ServerOption) error

Run the application.

Types

type AppConfig added in v0.2.0

type AppConfig struct {
	Registries []RegistryConfig
	Packages   []KsPackage
	Components []KsComponent
	Parameters []KsParameter
}

type AppConfigFile added in v0.3.0

type AppConfigFile struct {
	// App describes a ksonnet application.
	App AppConfig
}

AppConfigFile corresponds to a YAML file specifying information about the app to create.

type ApplyIamRequest added in v0.3.0

type ApplyIamRequest struct {
	Project string `json:"project"`
	Cluster string `json:"cluster"`
	Email   string `json:"email"`
	Token   string `json:"token"`
	Action  string `json:"action`
}

type ApplyRequest added in v0.3.0

type ApplyRequest struct {
	// Name of the app to apply
	Name string

	// Environment is the environment to use.
	Environment string

	// Components is a list of the names of the components to apply.
	Components []string

	// target GKE cLuster info
	Cluster string
	Project string
	Zone    string

	// Token is an authorization token to use to authorize to the K8s API Server.
	// Leave blank to use the pods service account.
	Token string
	Email string
}

Request to apply an app.

type CreateRequest added in v0.3.0

type CreateRequest struct {
	// Name for the app.
	Name string
	// AppConfig is the config for the app.
	AppConfig AppConfig

	// Namespace for the app.
	Namespace string

	// Whether to try to autoconfigure the app.
	AutoConfigure bool

	// target GKE cLuster info
	Cluster       string
	Project       string
	ProjectNumber string
	Zone          string

	// Access token, need to access target cluster in order for AutoConfigure
	Token string
	Apply bool
	Email string
	// temporary
	ClientId     string
	ClientSecret string
	IpName       string
}

CreateRequest represents a request to create a ksonnet application.

type DmConf added in v0.3.0

type DmConf struct {
	Imports   interface{} `json:"imports"`
	Resources []Resource  `json:"resources"`
}

type HealthzRequest added in v0.3.0

type HealthzRequest struct {
	Msg string
}

type HealthzResponse added in v0.3.0

type HealthzResponse struct {
	Reply string
}

type IamBinding added in v0.3.0

type IamBinding struct {
	Members []string `type:"members`
	Roles   []string `type:"roles"`
}

type IamConf added in v0.3.0

type IamConf struct {
	IamBindings []IamBinding `json:"bindings"`
}

type InitProjectRequest added in v0.3.0

type InitProjectRequest struct {
	Project       string
	ProjectNumber string
	Token         string
}

type InsertSaKeyRequest added in v0.3.0

type InsertSaKeyRequest struct {
	Cluster   string
	Namespace string
	Project   string
	Token     string
	Zone      string
}

type KsComponent added in v0.2.0

type KsComponent struct {
	Name      string
	Prototype string
}

type KsPackage added in v0.2.0

type KsPackage struct {
	Name string
	// Registry should be the name of the registry containing the package.
	Registry string
}

type KsParameter added in v0.2.0

type KsParameter struct {
	Component string
	Name      string
	Value     string
}

type KsRegistry added in v0.2.0

type KsRegistry struct {
	ApiVersion string
	Kind       string
	Libraries  map[string]LibrarySpec
}

KsRegistry corresponds to ksonnet.io/registry which is the registry.yaml file found in every registry.

type KsService added in v0.3.0

type KsService interface {
	// CreateApp creates a ksonnet application.
	CreateApp(context.Context, CreateRequest) error
	// Apply ksonnet app to target GKE cluster
	Apply(ctx context.Context, req ApplyRequest) error
	InsertSaKeys(context.Context, InsertSaKeyRequest) error
	BindRole(context.Context, string, string, string) error
	InsertDeployment(context.Context, CreateRequest) error
	GetDeploymentStatus(context.Context, CreateRequest) (string, error)
	ApplyIamPolicy(context.Context, ApplyIamRequest) error
}

KsService defines an interface for working with ksonnet.

type LibrarySpec added in v0.2.0

type LibrarySpec struct {
	Version string
	Path    string
}

type RegistriesConfigFile added in v0.3.0

type RegistriesConfigFile struct {
	// Registries provides information about known registries.
	Registries []RegistryConfig
}

RegistriesConfigFile corresponds to a YAML file specifying information about known registries.

type RegistryConfig added in v0.2.0

type RegistryConfig struct {
	Name    string
	Repo    string
	Version string
	Path    string
	RegUri  string
}

RegistryConfig is used for two purposes:

  1. used during image build, to configure registries that should be baked into the bootstrapper docker image. (See: https://github.com/kubeflow/kubeflow/blob/master/bootstrap/image_registries.yaml)
  2. used during app create rpc call, specifies a registry to be added to an app. required info for registry: Name, Repo, Version, Path Additionally if any of required fields is blank we will try to map with one of the registries baked into the Docker image using the name.

type Resource added in v0.3.0

type Resource struct {
	Name       string                 `json:"name"`
	Type       string                 `json:"type"`
	Properties map[string]interface{} `json:"properties"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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