Documentation
¶
Index ¶
- Constants
- func BuildClientCmdAPI(config *rest.Config, token string) *clientcmdapi.Config
- func BuildClusterConfig(ctx context.Context, token string, project string, zone string, ...) (*rest.Config, error)
- func BuildConfigFromClusterInfo(ctx context.Context, cluster *containerpb.Cluster, ts oauth2.TokenSource) (*rest.Config, error)
- func CheckAwsStsCallerIdentity(sess *session.Session) error
- func CheckCommandExist(commandName string) error
- func ClearIamPolicy(currentPolicy *cloudresourcemanager.Policy, deployName string, project string)
- func CreateK8sRoleBing(config *rest.Config, roleBinding *v1.ClusterRoleBinding) error
- func CreateKubeconfig(ctx context.Context, project string, loc string, cluster string, ...) (*clientcmdapi.Config, error)
- func CreateResourceFromFile(config *rest.Config, filename string, elems ...configtypes.NameValue) error
- func DeleteResourceFromFile(config *rest.Config, filename string) error
- func GetClusterInfo(ctx context.Context, project string, loc string, cluster string, ...) (*containerpb.Cluster, error)
- func GetEksctlVersion() error
- func GetIamPolicy(project string, gcpClient *http.Client) (*cloudresourcemanager.Policy, error)
- func GetObjectKindFromUri(configFile string) (string, error)
- func GetServiceAccountIamPolicy(iamService *iam.Service, project string, gsa string) (*iam.Policy, error)
- func IsRemoteFile(configFile string) (bool, error)
- func NewDefaultBackoff() *backoff.ExponentialBackOff
- func PrettyPrint(value interface{}) string
- func ReadIamBindingsYAML(filename string) (*cloudresourcemanager.Policy, error)
- func RewriteIamPolicy(currentPolicy *cloudresourcemanager.Policy, ...)
- func SetIamPolicy(project string, policy *cloudresourcemanager.Policy, gcpClient *http.Client) error
- func SetServiceAccountIamPolicy(iamService *iam.Service, policy *iam.Policy, project string, gsa string) error
- func UpdateWorkloadIdentityBindingsPolicy(currentPolicy *iam.Policy, project string, namespace string, ksa string) error
- type Apply
- type Bindings
- type IamBindingsYAML
- type Members
- type Roles
Constants ¶
const ( YamlSeparator = "(?m)^---[ \t]*$" CertDir = "/opt/ca" KfDefAnnotation = "kfctl.kubeflow.io" ForceDelete = "force-delete" )
Variables ¶
This section is empty.
Functions ¶
func BuildClientCmdAPI ¶
func BuildClientCmdAPI(config *rest.Config, token string) *clientcmdapi.Config
BuildClientCmdAPI takeks k8s config and access token, build and return clientcmdapi.Config entry
func BuildClusterConfig ¶
func BuildConfigFromClusterInfo ¶
func BuildConfigFromClusterInfo(ctx context.Context, cluster *containerpb.Cluster, ts oauth2.TokenSource) (*rest.Config, error)
BuildConfigFromClusterInfo returns k8s config using gcloud Application Default Credentials typically $HOME/.config/gcloud/application_default_credentials.json
func CheckAwsStsCallerIdentity ¶
CheckAwsStsCallerIdentity runs GetCallIdentity to make sure aws credentials is configured correclty
func CheckCommandExist ¶
CheckCommandExist check if a command can be found in PATH.
func ClearIamPolicy ¶
Modify currentPolicy: Remove existing bindings associated with service accounts of current deployment
func CreateK8sRoleBing ¶
func CreateK8sRoleBing(config *rest.Config, roleBinding *v1.ClusterRoleBinding) error
func CreateKubeconfig ¶
func CreateKubeconfig(ctx context.Context, project string, loc string, cluster string, namespace string, ts oauth2.TokenSource) (*clientcmdapi.Config, error)
Create a config that serves as kubeconfig.
func CreateResourceFromFile ¶
func DeleteResourceFromFile ¶
func GetClusterInfo ¶
func GetClusterInfo(ctx context.Context, project string, loc string, cluster string, ts oauth2.TokenSource) (*containerpb.Cluster, error)
Use default token source and retrieve cluster information with given project/location/cluster information.
func GetEksctlVersion ¶
func GetEksctlVersion() error
GetEksctlVersion return eksctl version on user's machine
func GetIamPolicy ¶
Gets IAM plicy from GCP for the whole project.
func GetObjectKindFromUri ¶
func GetServiceAccountIamPolicy ¶
func GetServiceAccountIamPolicy(iamService *iam.Service, project string, gsa string) (*iam.Policy, error)
GetServingAccountIamPolicy gets IAM policy for a service account
func IsRemoteFile ¶
Checks if the path configFile is remote (e.g. http://github...)
func NewDefaultBackoff ¶
func NewDefaultBackoff() *backoff.ExponentialBackOff
func PrettyPrint ¶
func PrettyPrint(value interface{}) string
PrettyPrint returns a pretty format output of any value.
func ReadIamBindingsYAML ¶
Reads IAM bindings file in YAML format.
func RewriteIamPolicy ¶
func RewriteIamPolicy(currentPolicy *cloudresourcemanager.Policy, adding *cloudresourcemanager.Policy)
Either patch or remove role bindings from `src` policy.
func SetIamPolicy ¶
func SetIamPolicy(project string, policy *cloudresourcemanager.Policy, gcpClient *http.Client) error
"Override" project's IAM policy with given config.
func SetServiceAccountIamPolicy ¶
func SetServiceAccountIamPolicy(iamService *iam.Service, policy *iam.Policy, project string, gsa string) error
SetServingAccountIamPolicy sets IAM policy for a service account
Types ¶
type Apply ¶
type Apply struct {
// contains filtered or unexported fields
}
func (*Apply) IfNamespaceExist ¶
type IamBindingsYAML ¶
type IamBindingsYAML struct {
Bindings []Bindings
}