k8s

package
v0.0.0-...-83b2bd0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildDynamicClientFromFlags

func BuildDynamicClientFromFlags(flags *pflag.FlagSet) (dynamic.Interface, error)

BuildDynamicClientFromFlags is a helper function that builds a dynamic client used to interact with the k8s cluster.

func BuildKubeConfigFromFlags

func BuildKubeConfigFromFlags(flags *pflag.FlagSet) (*restclient.Config, error)

BuildKubeConfigFromFlags - is a helper function that builds config object used to interact with the k8s cluster. The configuration is sourced in the following order:

Read config from file specified using --kubeconfig flag Read config from file(s) specified using KUBECONFIG env variable Read config from default location at $HOME/.kube/config

If all these steps fail, fallback to default kubernetes config mechanism.

func CreateJob

func CreateJob(client kubernetes.Interface, namespace string, jobDesc *JobDesc) (*batchv1.Job, error)

CreateJob function creates a new job

func CreateNamespace

func CreateNamespace(k8sinterface kubernetes.Interface, namespace string) (*corev1.Namespace, error)

CreateNamespace creates a new namespace

func CreateRegistrySecret

func CreateRegistrySecret(k8sinterface kubernetes.Interface, namespace string, name string, server string, username string, password string) (*corev1.Secret, error)

CreateRegistrySecret creates a new secret for docker registry

func DeleteNamespace

func DeleteNamespace(k8sinterface kubernetes.Interface, namespace string) error

DeleteNamespace deletes a namespace

func DeleteRegistrySecret

func DeleteRegistrySecret(k8sinterface kubernetes.Interface, namespace string, name string) error

DeleteRegistrySecret deletes docker registry secret

func GetIOStream

func GetIOStream() genericclioptions.IOStreams

GetIOStream - get io stream

func GetKubeConfigFromPathList

func GetKubeConfigFromPathList(configPaths string) (*restclient.Config, error)

GetKubeConfigFromPathList is a helper function that builds config object used to interact with the k8s cluster using a list of kubeconfig file(s)

Types

type DockerConfig

type DockerConfig map[string]DockerConfigEntry

DockerConfig represents the config file used by the docker CLI. This config that represents the credentials that should be used when pulling images from specific image repositories.

type DockerConfigEntry

type DockerConfigEntry struct {
	Username string `json:"username,omitempty"`
	Password string `json:"password,omitempty" datapolicy:"password"`
	Auth     string `json:"auth,omitempty" datapolicy:"token"`
}

DockerConfigEntry holds the user information that grant the access to docker registry

type DockerConfigJSON

type DockerConfigJSON struct {
	Auths DockerConfig `json:"auths" datapolicy:"token"`
	// +optional
	HTTPHeaders map[string]string `json:"HttpHeaders,omitempty" datapolicy:"token"`
}

DockerConfigJSON represents a local docker auth config file for pulling images.

type JobDesc

type JobDesc struct {
	Name               string
	ContainerName      string
	ContainerImage     string
	ImagePullSecret    string
	Command            []string
	Args               []string
	TTLSecondsOnFinish int32
}

JobDesc - Job Descriptor

Jump to

Keyboard shortcuts

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