gcp

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: Apache-2.0 Imports: 47 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GCP_CONFIG        = "gcp_config"
	CONFIG_FILE       = "cluster-kubeflow.yaml"
	STORAGE_FILE      = "storage-kubeflow.yaml"
	NETWORK_FILE      = "network.yaml"
	GCFS_FILE         = "gcfs.yaml"
	ADMIN_SECRET_NAME = "admin-gcp-sa"
	USER_SECRET_NAME  = "user-gcp-sa"
	KUBEFLOW_OAUTH    = "kubeflow-oauth"
	IMPORTS           = "imports"
	PATH              = "path"
	CLIENT_ID         = "CLIENT_ID"
	CLIENT_SECRET     = "CLIENT_SECRET"
	BASIC_AUTH_SECRET = "kubeflow-login"
	KUBECONFIG_FORMAT = "gke_{project}_{zone}_{cluster}"

	// The default path in kubeflow/kubeflow to the deployment manager configs.
	// TODO(jlewi): This is only provided for legacy reasons. In 0.7 the path should be set explicitly
	// in the KfDef spec.
	DEFAULT_DM_PATH = "deployment/gke/deployment_manager_configs"

	// Plugin parameter constants
	GcpPluginName               = "KfGcpPlugin"
	GcpAccessTokenName          = "accessToken"
	BasicAuthPasswordSecretName = "password"
	// The PodDefault in default namespace
	PodDefaultName = "add-gcp-secret"

	DefaultIstioNamespace = "istio-system"
)

TODO: golint complains that we should not use all capital var name.

Variables

This section is empty.

Functions

func GetGcloudDefaultAccount

func GetGcloudDefaultAccount() (string, error)

GetGcloudDefaultAccount try to get the default account.

func GetGcloudDefaultProject

func GetGcloudDefaultProject() (string, error)

GetGcloudDefaultProject try to get the default project.

func GetGcloudDefaultZone

func GetGcloudDefaultZone() (string, error)

GetGcloudDefaultZone try to get the default zone.

func GetPlatform

func GetPlatform(kfdef *kfconfig.KfConfig) (kftypesv3.Platform, error)

GetPlatform returns the gcp kfapp. It's called by coordinator.GetPlatform

Types

type Gcp

type Gcp struct {
	// contains filtered or unexported fields
}

Gcp implements KfApp Interface It includes the KsApp along with additional Gcp types TODO(jlewi): Why doesn't Gcp store GcpArgs as opposed to duplicating the options?

func (*Gcp) AddNamedContext

func (gcp *Gcp) AddNamedContext() error

Add a conveniently named context to KUBECONFIG.

func (*Gcp) Apply

func (gcp *Gcp) Apply(resources kftypesv3.ResourceEnum) error

Apply applies the gcp kfapp. Remind: Need to be thread-safe: this entry is share among kfctl and deploy app

func (*Gcp) ConfigK8s

func (gcp *Gcp) ConfigK8s() error

func (*Gcp) ConfigPodDefault

func (gcp *Gcp) ConfigPodDefault() error

Configure PodDefault to add secret.

func (*Gcp) Delete

func (gcp *Gcp) Delete(resources kftypesv3.ResourceEnum) error

func (*Gcp) Dump

func (gcp *Gcp) Dump(resources kftypesv3.ResourceEnum) error

func (*Gcp) Generate

func (gcp *Gcp) Generate(resources kftypesv3.ResourceEnum) error

Generate generates the gcp kfapp manifest. Remind: Need to be thread-safe: this entry is share among kfctl and deploy app

func (*Gcp) GetK8sConfig

func (gcp *Gcp) GetK8sConfig() (*rest.Config, *clientcmdapi.Config)

TODO(jlewi): We should be able to get rid of this method because it was only used for ksonnet.

func (*Gcp) GetPluginSpec

func (gcp *Gcp) GetPluginSpec() (*gcpplugin.GcpPluginSpec, error)

GetPluginSpec gets the plugin spec.

func (*Gcp) Init

func (gcp *Gcp) Init(resources kftypesv3.ResourceEnum) error

Init initializes a gcp kfapp

func (*Gcp) SetRunGetCredentials

func (gcp *Gcp) SetRunGetCredentials(v bool)

func (*Gcp) SetTokenSource

func (gcp *Gcp) SetTokenSource(s oauth2.TokenSource) error

func (*Gcp) SetupWorkloadIdentityPermission

func (gcp *Gcp) SetupWorkloadIdentityPermission() error

SetupWorkloadIdentityPermission bind gcp admin service account to owner of gcp "user" service account, so controller can edit WorkloadIdentity

type Setter

type Setter interface {
	SetTokenSource(s oauth2.TokenSource) error

	// SetRunGetCredentials controls whether or not to run get credentials
	SetRunGetCredentials(v bool)
}

Directories

Path Synopsis
package fake provides a fake implementation of the GCP Plugin
package fake provides a fake implementation of the GCP Plugin

Jump to

Keyboard shortcuts

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