Documentation ¶
Index ¶
- func CreateKubeConfig(clusterName string, ca certs.CertificateAuthority, endpoint string, ...) ([]byte, error)
- func CreateOIDCKubeConfig(clusterName string, ca certs.CertificateAuthority, ...) ([]byte, error)
- func GetCurrentClusterNameFrom(kubeConfigPath string) string
- func GetNodeStatus(node v1.Node) string
- func GetUnstructuredObjects(data []byte) ([]unstructured.Unstructured, error)
- func GetValidName(name string) string
- func IsDeleted(object metav1.Object) bool
- func IsMasterNode(node v1.Node) bool
- func IsPodCrashLoopBackoff(pod v1.Pod) bool
- func IsPodDaemonSet(pod v1.Pod) bool
- func IsPodFinished(pod v1.Pod) bool
- func IsPodHealthy(pod v1.Pod) bool
- func IsPodPending(pod v1.Pod) bool
- func LowResourceRequirements() v1.ResourceRequirements
- func NewCommandJob(node, command string) v1.PodSpec
- func NewDeployment(ns, name, image string, labels map[string]string, port int32, args ...string) *apps.Deployment
- func NewObjectMeta(ns, name string) metav1.ObjectMeta
- func TestNamespace(client kubernetes.Interface, ns string, t *console.TestResults)
- func WaitForNamespace(client kubernetes.Interface, ns string, timeout time.Duration)
- type ApplyHook
- type Builder
- func (b *Builder) AddAnnotations(annotations map[string]string) *Builder
- func (b *Builder) AddLabels(labels map[string]string) *Builder
- func (b *Builder) Append(objects ...runtime.Object) *Builder
- func (b *Builder) ConfigMap(name string, data map[string]string) *Builder
- func (b *Builder) Deployment(name, image string) *DeploymentBuilder
- func (b *Builder) ObjectMeta(name string) metav1.ObjectMeta
- func (b *Builder) Secret(name string, data map[string][]byte) *Builder
- func (b *Builder) ServiceAccount(name string) *ServiceAccountBuilder
- func (b *Builder) SetNamespace(namespace string) *Builder
- type CRD
- type Client
- func (c *Client) Annotate(obj runtime.Object, annotations map[string]string) error
- func (c *Client) Apply(namespace string, objects ...runtime.Object) error
- func (c *Client) ApplyUnstructured(namespace string, objects ...*unstructured.Unstructured) error
- func (c *Client) Cordon(nodeName string) error
- func (c *Client) CreateOrUpdateConfigMap(name, ns string, data map[string]string) error
- func (c *Client) CreateOrUpdateNamespace(name string, labels, annotations map[string]string) error
- func (c *Client) CreateOrUpdateSecret(name, ns string, data map[string][]byte) error
- func (c *Client) DeleteUnstructured(namespace string, objects ...*unstructured.Unstructured) error
- func (c *Client) Drain(nodeName string, timeout time.Duration) error
- func (c *Client) EvictNode(nodeName string) error
- func (c *Client) EvictPod(pod v1.Pod) error
- func (c *Client) ExecutePodf(namespace, pod, container string, command ...string) (string, string, error)
- func (c *Client) Executef(node string, timeout time.Duration, command string, args ...interface{}) (string, error)
- func (c *Client) ExposeIngress(namespace, service string, domain string, port int, ...) error
- func (c *Client) ForceDeleteNamespace(ns string, timeout time.Duration) error
- func (c *Client) Get(namespace string, name string, obj runtime.Object) error
- func (c *Client) GetClientByKind(kind string) (dynamic.NamespaceableResourceInterface, error)
- func (c *Client) GetClientset() (*kubernetes.Clientset, error)
- func (c *Client) GetConditionsForNode(name string) (map[v1.NodeConditionType]v1.ConditionStatus, error)
- func (c *Client) GetConfigMap(namespace, name string) *map[string]string
- func (c *Client) GetDynamicClient() (dynamic.Interface, error)
- func (c *Client) GetDynamicClientFor(namespace string, obj runtime.Object) (dynamic.ResourceInterface, *schema.GroupVersionResource, ...)
- func (c *Client) GetEtcdClientGenerator(ca *certs.Certificate) (*etcd.EtcdClientGenerator, error)
- func (c *Client) GetFirstPodByLabelSelector(namespace string, labelSelector string) (*v1.Pod, error)
- func (c *Client) GetHealth() Health
- func (c *Client) GetKustomize() (*kustomize.Manager, error)
- func (c *Client) GetMasterNode() (string, error)
- func (c *Client) GetMasterNodes() ([]string, error)
- func (c *Client) GetOrCreatePVC(namespace, name, size, class string) error
- func (c *Client) GetOrCreateSecret(name, ns string, data map[string][]byte) error
- func (c *Client) GetPodReplicas(pod v1.Pod) (int, error)
- func (c *Client) GetProxyDialer(p proxy.Proxy) (*proxy.Dialer, error)
- func (c *Client) GetRESTConfig() (*rest.Config, error)
- func (c *Client) GetRestClient(obj unstructured.Unstructured) (*cliresource.Helper, error)
- func (c *Client) GetRestMapper() (meta.RESTMapper, error)
- func (c *Client) GetSecret(namespace, name string) *map[string][]byte
- func (c *Client) HasConfigMap(ns, name string) bool
- func (c *Client) HasSecret(ns, name string) bool
- func (c *Client) Label(obj runtime.Object, labels map[string]string) error
- func (c *Client) PingMaster() bool
- func (c *Client) ResetConnection()
- func (c *Client) ScalePod(pod v1.Pod, replicas int32) error
- func (c *Client) StreamLogs(namespace, name string) error
- func (c *Client) Uncordon(nodeName string) error
- func (c *Client) WaitForNode(name string, timeout time.Duration, condition v1.NodeConditionType, ...) (map[v1.NodeConditionType]v1.ConditionStatus, error)
- func (c *Client) WaitForPod(ns, name string, timeout time.Duration, phases ...v1.PodPhase) error
- func (c *Client) WaitForPodCommand(ns, name string, container string, timeout time.Duration, command ...string) error
- func (c *Client) WaitForResource(kind, namespace, name string, timeout time.Duration) error
- type DeploymentBuilder
- func (d *DeploymentBuilder) Annotations(annotations map[string]string) *DeploymentBuilder
- func (d *DeploymentBuilder) Args(args ...string) *DeploymentBuilder
- func (d *DeploymentBuilder) AsCronJob(schedule string) *batchv1beta1.CronJob
- func (d *DeploymentBuilder) AsOneShotJob() *v1.Pod
- func (d *DeploymentBuilder) Build() *Builder
- func (d *DeploymentBuilder) Command(cmd ...string) *DeploymentBuilder
- func (d *DeploymentBuilder) EnvVarFromConfigMap(env, configmap, key string) *DeploymentBuilder
- func (d *DeploymentBuilder) EnvVarFromField(env, field string) *DeploymentBuilder
- func (d *DeploymentBuilder) EnvVarFromSecret(env, secret, key string) *DeploymentBuilder
- func (d *DeploymentBuilder) EnvVars(env map[string]string) *DeploymentBuilder
- func (d *DeploymentBuilder) Expose(ports ...int32) *DeploymentBuilder
- func (d *DeploymentBuilder) GetLabels() map[string]string
- func (d *DeploymentBuilder) Labels(labels map[string]string) *DeploymentBuilder
- func (d *DeploymentBuilder) MountConfigMap(cm, path string) *DeploymentBuilder
- func (d *DeploymentBuilder) MountSecret(secret, path string, mode int32) *DeploymentBuilder
- func (d *DeploymentBuilder) NodeAffinity(nodeReadinessLabel map[string]string) *DeploymentBuilder
- func (d *DeploymentBuilder) ObjectMeta() metav1.ObjectMeta
- func (d *DeploymentBuilder) PodAffinity(labels map[string]string, topologyKey string) *DeploymentBuilder
- func (d *DeploymentBuilder) PodSpec() v1.PodSpec
- func (d *DeploymentBuilder) PodTemplate() v1.PodTemplateSpec
- func (d *DeploymentBuilder) Ports(ports ...int32) *DeploymentBuilder
- func (d *DeploymentBuilder) Replicas(replicas int) *DeploymentBuilder
- func (d *DeploymentBuilder) Resources(resources v1.ResourceRequirements) *DeploymentBuilder
- func (d *DeploymentBuilder) ServiceAccount(name string) *DeploymentBuilder
- type DynamicKind
- type Health
- type Metadata
- type ServiceAccountBuilder
- type Spec
- type Specs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateKubeConfig ¶
func CreateOIDCKubeConfig ¶
func GetCurrentClusterNameFrom ¶
GetCurrentClusterNameFrom returns the name of the cluster associated with the currentContext of the specified kubeconfig file
func GetNodeStatus ¶
func GetUnstructuredObjects ¶
func GetUnstructuredObjects(data []byte) ([]unstructured.Unstructured, error)
func GetValidName ¶
func IsMasterNode ¶
func IsPodCrashLoopBackoff ¶
func IsPodDaemonSet ¶
func IsPodFinished ¶
func IsPodHealthy ¶
func IsPodPending ¶
func LowResourceRequirements ¶
func LowResourceRequirements() v1.ResourceRequirements
func NewCommandJob ¶
func NewDeployment ¶
func NewObjectMeta ¶
func NewObjectMeta(ns, name string) metav1.ObjectMeta
func TestNamespace ¶
func TestNamespace(client kubernetes.Interface, ns string, t *console.TestResults)
func WaitForNamespace ¶
func WaitForNamespace(client kubernetes.Interface, ns string, timeout time.Duration)
Types ¶
type ApplyHook ¶
type ApplyHook func(namespace string, obj unstructured.Unstructured)
type Builder ¶
type Builder struct { Objects []runtime.Object Namespace string Labels map[string]string Annotations map[string]string }
func (*Builder) AddAnnotations ¶
func (*Builder) Deployment ¶
func (b *Builder) Deployment(name, image string) *DeploymentBuilder
func (*Builder) ObjectMeta ¶
func (b *Builder) ObjectMeta(name string) metav1.ObjectMeta
func (*Builder) ServiceAccount ¶
func (b *Builder) ServiceAccount(name string) *ServiceAccountBuilder
func (*Builder) SetNamespace ¶
type Client ¶
type Client struct { logger.Logger GetKubeConfigBytes func() ([]byte, error) ApplyDryRun bool ApplyHook ApplyHook Trace bool GetKustomizePatches func() ([]string, error) // contains filtered or unexported fields }
func (*Client) ApplyUnstructured ¶
func (c *Client) ApplyUnstructured(namespace string, objects ...*unstructured.Unstructured) error
func (*Client) CreateOrUpdateConfigMap ¶
func (*Client) CreateOrUpdateNamespace ¶
func (*Client) CreateOrUpdateSecret ¶
func (*Client) DeleteUnstructured ¶
func (c *Client) DeleteUnstructured(namespace string, objects ...*unstructured.Unstructured) error
func (*Client) ExecutePodf ¶
func (c *Client) ExecutePodf(namespace, pod, container string, command ...string) (string, string, error)
ExecutePodf runs the specified shell command inside a container of the specified pod
func (*Client) Executef ¶
func (c *Client) Executef(node string, timeout time.Duration, command string, args ...interface{}) (string, error)
Executef runs the specified shell command on a node by creating a pre-scheduled pod that runs in the host namespace
func (*Client) ExposeIngress ¶
func (*Client) ForceDeleteNamespace ¶ added in v0.16.3
ForceDeleteNamespace deletes a namespace forcibly by overriding it's finalizers first
func (*Client) GetClientByKind ¶ added in v0.16.3
func (c *Client) GetClientByKind(kind string) (dynamic.NamespaceableResourceInterface, error)
func (*Client) GetClientset ¶
func (c *Client) GetClientset() (*kubernetes.Clientset, error)
GetClientset creates a new k8s client
func (*Client) GetConditionsForNode ¶
func (c *Client) GetConditionsForNode(name string) (map[v1.NodeConditionType]v1.ConditionStatus, error)
func (*Client) GetConfigMap ¶
GetConfigMap returns the data of a secret or nil for any error
func (*Client) GetDynamicClient ¶
GetDynamicClient creates a new k8s client
func (*Client) GetDynamicClientFor ¶
func (c *Client) GetDynamicClientFor(namespace string, obj runtime.Object) (dynamic.ResourceInterface, *schema.GroupVersionResource, *unstructured.Unstructured, error)
func (*Client) GetEtcdClientGenerator ¶
func (c *Client) GetEtcdClientGenerator(ca *certs.Certificate) (*etcd.EtcdClientGenerator, error)
func (*Client) GetFirstPodByLabelSelector ¶
func (c *Client) GetFirstPodByLabelSelector(namespace string, labelSelector string) (*v1.Pod, error)
Returns the first pod found by label
func (*Client) GetMasterNode ¶
GetMasterNode returns the name of the first node found labelled as a master
func (*Client) GetMasterNodes ¶
GetMasterNode returns a list of all master nodes
func (*Client) GetOrCreatePVC ¶
func (*Client) GetOrCreateSecret ¶
func (*Client) GetProxyDialer ¶
func (*Client) GetRestClient ¶
func (c *Client) GetRestClient(obj unstructured.Unstructured) (*cliresource.Helper, error)
func (*Client) GetRestMapper ¶
func (c *Client) GetRestMapper() (meta.RESTMapper, error)
func (*Client) HasConfigMap ¶
func (*Client) PingMaster ¶
PingMaster attempts to connect to the API server and list nodes and services to ensure the API server is ready to accept any traffic
func (*Client) ResetConnection ¶
func (c *Client) ResetConnection()
func (*Client) StreamLogs ¶
func (*Client) WaitForNode ¶
func (c *Client) WaitForNode(name string, timeout time.Duration, condition v1.NodeConditionType, statii ...v1.ConditionStatus) (map[v1.NodeConditionType]v1.ConditionStatus, error)
WaitForNode waits for a pod to be in the specified phase, or returns an error if the timeout is exceeded
func (*Client) WaitForPod ¶
WaitForPod waits for a pod to be in the specified phase, or returns an error if the timeout is exceeded
type DeploymentBuilder ¶
type DeploymentBuilder struct { Builder *Builder Name, Image string // contains filtered or unexported fields }
func Deployment ¶
func Deployment(name, image string) *DeploymentBuilder
func (*DeploymentBuilder) Annotations ¶
func (d *DeploymentBuilder) Annotations(annotations map[string]string) *DeploymentBuilder
func (*DeploymentBuilder) Args ¶
func (d *DeploymentBuilder) Args(args ...string) *DeploymentBuilder
func (*DeploymentBuilder) AsCronJob ¶
func (d *DeploymentBuilder) AsCronJob(schedule string) *batchv1beta1.CronJob
func (*DeploymentBuilder) AsOneShotJob ¶
func (d *DeploymentBuilder) AsOneShotJob() *v1.Pod
func (*DeploymentBuilder) Build ¶
func (d *DeploymentBuilder) Build() *Builder
func (*DeploymentBuilder) Command ¶
func (d *DeploymentBuilder) Command(cmd ...string) *DeploymentBuilder
func (*DeploymentBuilder) EnvVarFromConfigMap ¶
func (d *DeploymentBuilder) EnvVarFromConfigMap(env, configmap, key string) *DeploymentBuilder
func (*DeploymentBuilder) EnvVarFromField ¶
func (d *DeploymentBuilder) EnvVarFromField(env, field string) *DeploymentBuilder
func (*DeploymentBuilder) EnvVarFromSecret ¶
func (d *DeploymentBuilder) EnvVarFromSecret(env, secret, key string) *DeploymentBuilder
func (*DeploymentBuilder) EnvVars ¶
func (d *DeploymentBuilder) EnvVars(env map[string]string) *DeploymentBuilder
func (*DeploymentBuilder) Expose ¶
func (d *DeploymentBuilder) Expose(ports ...int32) *DeploymentBuilder
func (*DeploymentBuilder) GetLabels ¶
func (d *DeploymentBuilder) GetLabels() map[string]string
func (*DeploymentBuilder) Labels ¶
func (d *DeploymentBuilder) Labels(labels map[string]string) *DeploymentBuilder
func (*DeploymentBuilder) MountConfigMap ¶
func (d *DeploymentBuilder) MountConfigMap(cm, path string) *DeploymentBuilder
func (*DeploymentBuilder) MountSecret ¶
func (d *DeploymentBuilder) MountSecret(secret, path string, mode int32) *DeploymentBuilder
func (*DeploymentBuilder) NodeAffinity ¶
func (d *DeploymentBuilder) NodeAffinity(nodeReadinessLabel map[string]string) *DeploymentBuilder
func (*DeploymentBuilder) ObjectMeta ¶
func (d *DeploymentBuilder) ObjectMeta() metav1.ObjectMeta
func (*DeploymentBuilder) PodAffinity ¶
func (d *DeploymentBuilder) PodAffinity(labels map[string]string, topologyKey string) *DeploymentBuilder
func (*DeploymentBuilder) PodSpec ¶
func (d *DeploymentBuilder) PodSpec() v1.PodSpec
func (*DeploymentBuilder) PodTemplate ¶
func (d *DeploymentBuilder) PodTemplate() v1.PodTemplateSpec
func (*DeploymentBuilder) Ports ¶
func (d *DeploymentBuilder) Ports(ports ...int32) *DeploymentBuilder
func (*DeploymentBuilder) Replicas ¶
func (d *DeploymentBuilder) Replicas(replicas int) *DeploymentBuilder
func (*DeploymentBuilder) Resources ¶
func (d *DeploymentBuilder) Resources(resources v1.ResourceRequirements) *DeploymentBuilder
func (*DeploymentBuilder) ServiceAccount ¶
func (d *DeploymentBuilder) ServiceAccount(name string) *DeploymentBuilder
type DynamicKind ¶
type DynamicKind struct {
APIVersion, Kind string
}
func (DynamicKind) GroupVersionKind ¶
func (dk DynamicKind) GroupVersionKind() schema.GroupVersionKind
func (DynamicKind) SetGroupVersionKind ¶
func (dk DynamicKind) SetGroupVersionKind(gvk schema.GroupVersionKind)
type Health ¶
type Health struct {
RunningPods, PendingPods, ErrorPods, CrashLoopBackOff int
ReadyNodes, UnreadyNodes int
Error error
}
func (Health) IsDegradedComparedTo ¶
type ServiceAccountBuilder ¶
func (*ServiceAccountBuilder) AddClusterRole ¶
func (s *ServiceAccountBuilder) AddClusterRole(role string) *ServiceAccountBuilder
func (*ServiceAccountBuilder) AddRole ¶
func (s *ServiceAccountBuilder) AddRole(role string) *ServiceAccountBuilder
type Spec ¶
type Spec struct { Path string Items []unstructured.Unstructured }
Directories ¶
Path | Synopsis |
---|---|
Package etcd provides a connection to an etcd member.
|
Package etcd provides a connection to an etcd member. |
Package kustomize contains helpers for working with embedded kustomize commands Package kustomize contains helpers for working with embedded kustomize commands
|
Package kustomize contains helpers for working with embedded kustomize commands Package kustomize contains helpers for working with embedded kustomize commands |