Documentation
¶
Index ¶
- Variables
- func CreatePersistentVolumeClaim(ctx context.Context, name, namespaceOverride string, labels map[string]string, ...) (err error)
- func DeletePersistentVolumeClaims(ctx context.Context, namespaceOverride string, listOptions metav1.ListOptions) (err error)
- func DeleteSecrets(ctx context.Context, namespaceOverride string, listOptions metav1.ListOptions) (err error)
- func EnsureDockerRegistrySecretExist(ctx context.Context, name, namespaceOverride string, labels map[string]string, ...) (err error)
- func EnsureSecretExist(ctx context.Context, secret corev1.Secret, namespaceOverride string) (err error)
- func GetClientConfig() clientcmd.ClientConfig
- func GetConfigMap(ctx context.Context, name, namespaceOverride string) (*corev1.ConfigMap, error)
- func GetNamespace(defaultNamespace string) (namespace string, err error)
- func GetPersistentVolumeClaim(ctx context.Context, name, namespaceOverride string) (*corev1.PersistentVolumeClaim, error)
- func GetPodLogs(ctx context.Context, namespace, podName, containerName string) (string, error)
- func GetSecret(ctx context.Context, name, namespaceOverride string) (*corev1.Secret, error)
- func HandleDockerCfgJSONContent(username, password, email, server string) ([]byte, error)
- func ListConfigMapsNamesIfConnected(ctx context.Context, namespaceOverride string) (names []string, err error)
- func ListSecretsNamesIfConnected(ctx context.Context, namespaceOverride string) (names []string, err error)
- func NewClientAndResolvedNamespace(defaultNamespace string) (client *kubernetes.Clientset, namespace string, err error)
- func NewDynamicClient() (dynamic.Interface, error)
- func NewInClusterDialer(ctx context.Context) (*contextDialer, error)
- func NewKubernetesClientset() (*kubernetes.Clientset, error)
- func NewLazyInitInClusterDialer() *lazyInitInClusterDialer
- func UploadToVolume(ctx context.Context, content io.Reader, claimName, namespace string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var SocatImage = "quay.io/boson/alpine-socat:1.7.4.3-r1-non-root"
View Source
var TarImage = "quay.io/boson/alpine-socat:1.7.4.3-r1-non-root"
Functions ¶
func DeleteSecrets ¶
func EnsureSecretExist ¶
func GetClientConfig ¶
func GetClientConfig() clientcmd.ClientConfig
func GetConfigMap ¶
func GetNamespace ¶
func GetPodLogs ¶
GetPodLogs returns logs from a specified Container in a Pod, if container is empty string, then the first container in the pod is selected.
func ListConfigMapsNamesIfConnected ¶
func ListConfigMapsNamesIfConnected(ctx context.Context, namespaceOverride string) (names []string, err error)
ListConfigMapsNamesIfConnected lists names of ConfigMaps present and the current k8s context returns empty list, if not connected to any cluster
func ListSecretsNamesIfConnected ¶
func ListSecretsNamesIfConnected(ctx context.Context, namespaceOverride string) (names []string, err error)
ListSecretsNamesIfConnected lists names of Secrets present and the current k8s context returns empty list, if not connected to any cluster
func NewClientAndResolvedNamespace ¶
func NewClientAndResolvedNamespace(defaultNamespace string) (client *kubernetes.Clientset, namespace string, err error)
func NewDynamicClient ¶
func NewInClusterDialer ¶
NewInClusterDialer creates context dialer that will dial TCP connections via POD running in k8s cluster. This is useful when accessing k8s services that are not exposed outside cluster (e.g. openshift image registry).
Usage:
dialer, err := k8s.NewInClusterDialer(ctx) if err != nil { return err } defer dialer.Close() transport := &http.Transport{ DialContext: dialer.DialContext, } var client = http.Client{ Transport: transport, }
func NewKubernetesClientset ¶
func NewKubernetesClientset() (*kubernetes.Clientset, error)
func NewLazyInitInClusterDialer ¶
func NewLazyInitInClusterDialer() *lazyInitInClusterDialer
Types ¶
This section is empty.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.