Documentation ¶
Index ¶
- func BuildDynamicClientFromFlags(flags *pflag.FlagSet) (dynamic.Interface, error)
- func BuildKubeConfigFromFlags(flags *pflag.FlagSet) (*restclient.Config, error)
- func CreateJob(client kubernetes.Interface, namespace string, jobDesc *JobDesc) (*batchv1.Job, error)
- func CreateNamespace(k8sinterface kubernetes.Interface, namespace string) (*corev1.Namespace, error)
- func CreateRegistrySecret(k8sinterface kubernetes.Interface, namespace string, name string, ...) (*corev1.Secret, error)
- func DeleteNamespace(k8sinterface kubernetes.Interface, namespace string) error
- func DeleteRegistrySecret(k8sinterface kubernetes.Interface, namespace string, name string) error
- func GetIOStream() genericclioptions.IOStreams
- func GetKubeConfigFromPathList(configPaths string) (*restclient.Config, error)
- type DockerConfig
- type DockerConfigEntry
- type DockerConfigJSON
- type JobDesc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildDynamicClientFromFlags ¶
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 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.