Documentation ¶
Index ¶
- Constants
- func CreateNamespace(req *CreateRequest, k8sClientset *clientset.Clientset) error
- func GetClearServiceAccountpolicy(currentPolicy *cloudresourcemanager.Policy, req ApplyIamRequest) cloudresourcemanager.Policy
- func GetRepoName(project string) string
- func GetUpdatedPolicy(currentPolicy *cloudresourcemanager.Policy, iamConf *IamConf, ...) cloudresourcemanager.Policy
- func InsertOauthCredentails(req *CreateRequest, k8sClientset *clientset.Clientset) error
- func LoadConfig(path string, o interface{}) error
- func NewServer(appsDir string, registries []RegistryConfig, gkeVersionOverride string) (*ksServer, error)
- func PrepareAccount(account string) string
- func Run(opt *options.ServerOption) error
- func UpdateCloudShellConfig(repoDir string, project string, appName string, kfVersion string, zone string) error
- func UpdateDmConfig(repoDir string, project string, appName string, kfVersion string, ...) error
- type AppConfig
- type AppConfigFile
- type ApplyIamRequest
- type ApplyRequest
- type CreateRequest
- type DmConf
- type HealthzRequest
- type HealthzResponse
- type IamBinding
- type IamConf
- type InitProjectRequest
- type KsComponent
- type KsPackage
- type KsParameter
- type KsRegistry
- type KsService
- type LibrarySpec
- type MultiError
- type RegistriesConfigFile
- type RegistryConfig
- type Resource
Constants ¶
const CachedRegistries = "/opt/versioned_registries"
root dir of local cached VERSIONED REGISTRIES
const CloudShellFolder = "kf_util"
const CloudShellTemplatePath = "/opt/registries/kubeflow/deployment/gke/cloud_shell_templates"
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.
const DmFolder = "gcp_config"
const GcloudPath = "gcloud"
Assume gcloud is on the path.
const IAM_ADMIN_ROLE = "roles/resourcemanager.projectIamAdmin"
const JupyterPrototype = "jupyterhub"
The name of the prototype for Jupyter.
const KubeflowFolder = "ks_app"
const KubeflowRegName = "kubeflow"
const OauthSecretName = "kubeflow-oauth"
const RecommendedConfigPathEnvVar = "KUBECONFIG"
RecommendedConfigPathEnvVar is a environment variable for path configuration
const RegistriesRoot = "/opt/registries"
const StartTime = "StartTime"
key used for storing start time of a request to deploy in the request contexts
Variables ¶
This section is empty.
Functions ¶
func CreateNamespace ¶ added in v0.4.0
func CreateNamespace(req *CreateRequest, k8sClientset *clientset.Clientset) error
func GetClearServiceAccountpolicy ¶ added in v0.4.0
func GetClearServiceAccountpolicy(currentPolicy *cloudresourcemanager.Policy, req ApplyIamRequest) cloudresourcemanager.Policy
Clear existing bindings for auto-generated service accounts of current deployment. Those bindings could be leftover from previous actions.
func GetRepoName ¶ added in v0.3.0
func GetUpdatedPolicy ¶ added in v0.3.0
func GetUpdatedPolicy(currentPolicy *cloudresourcemanager.Policy, iamConf *IamConf, req ApplyIamRequest) cloudresourcemanager.Policy
func InsertOauthCredentails ¶ added in v0.4.0
func InsertOauthCredentails(req *CreateRequest, k8sClientset *clientset.Clientset) error
func LoadConfig ¶ added in v0.2.0
Load yaml config
func NewServer ¶ added in v0.3.0
func NewServer(appsDir string, registries []RegistryConfig, gkeVersionOverride string) (*ksServer, error)
NewServer constructs a ksServer.
func PrepareAccount ¶ added in v0.4.0
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 ApplyRequest ¶ added in v0.3.0
type ApplyRequest struct { // Name of the app to apply Name string // kubeflow version KfVersion 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 // For test: GCP service account client id SAClientId string // pass *appInfo if ks app is already on disk. AppInfo *appInfo }
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 // For test: GCP service account client id SAClientId string }
CreateRequest represents a request to create a ksonnet application.
func (*CreateRequest) Validate ¶ added in v0.4.0
func (s *CreateRequest) Validate() error
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 IamConf ¶ added in v0.3.0
type IamConf struct {
IamBindings []IamBinding `json:"bindings"`
}
type InitProjectRequest ¶ added in v0.3.0
type KsComponent ¶ added in v0.2.0
type KsParameter ¶ added in v0.2.0
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, *deploymentmanager.Deployment) error // Apply ksonnet app to target GKE cluster Apply(ctx context.Context, req ApplyRequest) error ConfigCluster(context.Context, CreateRequest) error BindRole(context.Context, string, string, string) error InsertDeployment(context.Context, CreateRequest) (*deploymentmanager.Deployment, error) GetDeploymentStatus(context.Context, CreateRequest) (string, error) ApplyIamPolicy(context.Context, ApplyIamRequest) error GetProjectLock(string) *sync.Mutex }
KsService defines an interface for working with ksonnet.
type LibrarySpec ¶ added in v0.2.0
type MultiError ¶ added in v0.4.0
type MultiError struct {
Errors []error
}
func (*MultiError) Collect ¶ added in v0.4.0
func (m *MultiError) Collect(err error)
func (MultiError) ToError ¶ added in v0.4.0
func (m MultiError) ToError() error
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
RegistryConfig is used for two purposes:
- 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)
- 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.