Documentation ¶
Overview ¶
Package k8s provides various helper functions for interacting with Kubernetes APIs.
IMPORTANT: Please note that the APIs of this package might change without any notice until cilium-cli reaches v1.0.0.
Index ¶
- Variables
- func NewClusterRoleBinding(name, namespace, serviceAccount string) *rbacv1.ClusterRoleBinding
- func NewIngressClass(name, controllerName string) *networkingv1.IngressClass
- func NewSecret(name, namespace string, data map[string][]byte) *corev1.Secret
- func NewServiceAccount(name string) *corev1.ServiceAccount
- func NewTLSSecret(name, namespace string, data map[string][]byte) *corev1.Secret
- type Client
- func (c *Client) AutodetectFlavor(ctx context.Context) Flavor
- func (c *Client) CheckDaemonSetStatus(ctx context.Context, namespace, deployment string) error
- func (c *Client) CheckDeploymentStatus(ctx context.Context, namespace, deployment string) error
- func (c *Client) CiliumDbgEndpoints(ctx context.Context, namespace, pod string) ([]*models.Endpoint, error)
- func (c *Client) CiliumLogs(ctx context.Context, namespace, pod string, since time.Time) (string, error)
- func (c *Client) CiliumStatus(ctx context.Context, namespace, pod string) (*models.StatusResponse, error)
- func (c *Client) ClusterName() (name string)
- func (c *Client) ContextName() (name string)
- func (c *Client) CopyFromPod(ctx context.Context, namespace, pod, container, fromFile, destFile string, ...) error
- func (c *Client) CreateCiliumExternalWorkload(ctx context.Context, cew *ciliumv2.CiliumExternalWorkload, ...) (*ciliumv2.CiliumExternalWorkload, error)
- func (c *Client) CreateConfigMap(ctx context.Context, namespace string, config *corev1.ConfigMap, ...) (*corev1.ConfigMap, error)
- func (c *Client) CreateDaemonSet(ctx context.Context, namespace string, ds *appsv1.DaemonSet, ...) (*appsv1.DaemonSet, error)
- func (c *Client) CreateDeployment(ctx context.Context, namespace string, deployment *appsv1.Deployment, ...) (*appsv1.Deployment, error)
- func (c *Client) CreateEphemeralContainer(ctx context.Context, pod *corev1.Pod, ec *corev1.EphemeralContainer) (*corev1.Pod, error)
- func (c *Client) CreateIngress(ctx context.Context, namespace string, ingress *networkingv1.Ingress, ...) (*networkingv1.Ingress, error)
- func (c *Client) CreateNamespace(ctx context.Context, namespace *corev1.Namespace, opts metav1.CreateOptions) (*corev1.Namespace, error)
- func (c *Client) CreatePod(ctx context.Context, namespace string, pod *corev1.Pod, ...) (*corev1.Pod, error)
- func (c *Client) CreateSecret(ctx context.Context, namespace string, secret *corev1.Secret, ...) (*corev1.Secret, error)
- func (c *Client) CreateService(ctx context.Context, namespace string, service *corev1.Service, ...) (*corev1.Service, error)
- func (c *Client) CreateServiceAccount(ctx context.Context, namespace string, account *corev1.ServiceAccount, ...) (*corev1.ServiceAccount, error)
- func (c *Client) DeleteCiliumClusterwideNetworkPolicy(ctx context.Context, name string, opts metav1.DeleteOptions) error
- func (c *Client) DeleteCiliumEgressGatewayPolicy(ctx context.Context, name string, opts metav1.DeleteOptions) error
- func (c *Client) DeleteCiliumExternalWorkload(ctx context.Context, name string, opts metav1.DeleteOptions) error
- func (c *Client) DeleteCiliumLocalRedirectPolicy(ctx context.Context, namespace, name string, opts metav1.DeleteOptions) error
- func (c *Client) DeleteCiliumNetworkPolicy(ctx context.Context, namespace, name string, opts metav1.DeleteOptions) error
- func (c *Client) DeleteConfigMap(ctx context.Context, namespace, name string, opts metav1.DeleteOptions) error
- func (c *Client) DeleteDeployment(ctx context.Context, namespace, name string, opts metav1.DeleteOptions) error
- func (c *Client) DeleteKubernetesNetworkPolicy(ctx context.Context, namespace, name string, opts metav1.DeleteOptions) error
- func (c *Client) DeleteNamespace(ctx context.Context, namespace string, opts metav1.DeleteOptions) error
- func (c *Client) DeletePod(ctx context.Context, namespace, name string, opts metav1.DeleteOptions) error
- func (c *Client) DeletePodCollection(ctx context.Context, namespace string, opts metav1.DeleteOptions, ...) error
- func (c *Client) DeleteSecret(ctx context.Context, namespace, name string, opts metav1.DeleteOptions) error
- func (c *Client) DeleteService(ctx context.Context, namespace, name string, opts metav1.DeleteOptions) error
- func (c *Client) DeleteServiceAccount(ctx context.Context, namespace, name string, opts metav1.DeleteOptions) error
- func (c *Client) ExecInPod(ctx context.Context, namespace, pod, container string, command []string) (bytes.Buffer, error)
- func (c *Client) ExecInPodWithStderr(ctx context.Context, namespace, pod, container string, command []string) (bytes.Buffer, bytes.Buffer, error)
- func (c *Client) ExecInPodWithWriters(connCtx, killCmdCtx context.Context, namespace, pod, container string, ...) error
- func (c *Client) GetAPIServerHostAndPort() (string, string)
- func (c *Client) GetCRD(ctx context.Context, name string, opts metav1.GetOptions) (*apiextensions.CustomResourceDefinition, error)
- func (c *Client) GetCiliumExternalWorkload(ctx context.Context, name string, opts metav1.GetOptions) (*ciliumv2.CiliumExternalWorkload, error)
- func (c *Client) GetCiliumLocalRedirectPolicy(ctx context.Context, namespace, name string, opts metav1.GetOptions) (*ciliumv2.CiliumLocalRedirectPolicy, error)
- func (c *Client) GetCiliumVersion(ctx context.Context, p *corev1.Pod) (*semver.Version, error)
- func (c *Client) GetClusterRole(ctx context.Context, name string, opts metav1.GetOptions) (*rbacv1.ClusterRole, error)
- func (c *Client) GetConfigMap(ctx context.Context, namespace, name string, opts metav1.GetOptions) (*corev1.ConfigMap, error)
- func (c *Client) GetCronJob(ctx context.Context, namespace, name string, opts metav1.GetOptions) (*batchv1.CronJob, error)
- func (c *Client) GetDaemonSet(ctx context.Context, namespace, name string, opts metav1.GetOptions) (*appsv1.DaemonSet, error)
- func (c *Client) GetDeployment(ctx context.Context, namespace, name string, opts metav1.GetOptions) (*appsv1.Deployment, error)
- func (c *Client) GetEndpoints(ctx context.Context, namespace, name string, opts metav1.GetOptions) (*corev1.Endpoints, error)
- func (c *Client) GetHelmMetadata(_ context.Context, releaseName string, namespace string) (string, error)
- func (c *Client) GetHelmValues(_ context.Context, releaseName string, namespace string) (string, error)
- func (c *Client) GetIngress(ctx context.Context, namespace string, name string, opts metav1.GetOptions) (*networkingv1.Ingress, error)
- func (c *Client) GetLogs(ctx context.Context, namespace, name, container string, ...) (string, error)
- func (c *Client) GetNamespace(ctx context.Context, namespace string, options metav1.GetOptions) (*corev1.Namespace, error)
- func (c *Client) GetNode(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.Node, error)
- func (c *Client) GetPod(ctx context.Context, namespace, name string, opts metav1.GetOptions) (*corev1.Pod, error)
- func (c *Client) GetPodsTable(_ context.Context) (*metav1.Table, error)
- func (c *Client) GetRaw(ctx context.Context, path string) (string, error)
- func (c *Client) GetRunningCiliumVersion(ciliumHelmReleaseName string) (string, error)
- func (c *Client) GetSecret(ctx context.Context, namespace, name string, opts metav1.GetOptions) (*corev1.Secret, error)
- func (c *Client) GetServerVersion() (*semver.Version, error)
- func (c *Client) GetService(ctx context.Context, namespace, name string, opts metav1.GetOptions) (*corev1.Service, error)
- func (c *Client) GetServiceAccount(ctx context.Context, namespace, name string, opts metav1.GetOptions) (*corev1.ServiceAccount, error)
- func (c *Client) GetStatefulSet(ctx context.Context, namespace, name string, opts metav1.GetOptions) (*appsv1.StatefulSet, error)
- func (c *Client) GetVersion(_ context.Context) (string, error)
- func (c *Client) KVStoreMeshStatus(ctx context.Context, namespace, pod string) ([]*models.RemoteCluster, error)
- func (c *Client) ListCiliumBGPPeeringPolicies(ctx context.Context, opts metav1.ListOptions) (*ciliumv2alpha1.CiliumBGPPeeringPolicyList, error)
- func (c *Client) ListCiliumCIDRGroups(ctx context.Context, opts metav1.ListOptions) (*ciliumv2alpha1.CiliumCIDRGroupList, error)
- func (c *Client) ListCiliumClusterwideEnvoyConfigs(ctx context.Context, opts metav1.ListOptions) (*ciliumv2.CiliumClusterwideEnvoyConfigList, error)
- func (c *Client) ListCiliumClusterwideNetworkPolicies(ctx context.Context, opts metav1.ListOptions) (*ciliumv2.CiliumClusterwideNetworkPolicyList, error)
- func (c *Client) ListCiliumEgressGatewayPolicies(ctx context.Context, opts metav1.ListOptions) (*ciliumv2.CiliumEgressGatewayPolicyList, error)
- func (c *Client) ListCiliumEndpointSlices(ctx context.Context, options metav1.ListOptions) (*ciliumv2alpha1.CiliumEndpointSliceList, error)
- func (c *Client) ListCiliumEndpoints(ctx context.Context, namespace string, options metav1.ListOptions) (*ciliumv2.CiliumEndpointList, error)
- func (c *Client) ListCiliumEnvoyConfigs(ctx context.Context, namespace string, options metav1.ListOptions) (*ciliumv2.CiliumEnvoyConfigList, error)
- func (c *Client) ListCiliumExternalWorkloads(ctx context.Context, opts metav1.ListOptions) (*ciliumv2.CiliumExternalWorkloadList, error)
- func (c *Client) ListCiliumIdentities(ctx context.Context) (*ciliumv2.CiliumIdentityList, error)
- func (c *Client) ListCiliumLoadBalancerIPPools(ctx context.Context, opts metav1.ListOptions) (*ciliumv2alpha1.CiliumLoadBalancerIPPoolList, error)
- func (c *Client) ListCiliumLocalRedirectPolicies(ctx context.Context, namespace string, opts metav1.ListOptions) (*ciliumv2.CiliumLocalRedirectPolicyList, error)
- func (c *Client) ListCiliumNetworkPolicies(ctx context.Context, namespace string, opts metav1.ListOptions) (*ciliumv2.CiliumNetworkPolicyList, error)
- func (c *Client) ListCiliumNodeConfigs(ctx context.Context, namespace string, opts metav1.ListOptions) (*ciliumv2alpha1.CiliumNodeConfigList, error)
- func (c *Client) ListCiliumNodes(ctx context.Context) (*ciliumv2.CiliumNodeList, error)
- func (c *Client) ListCiliumPodIPPools(ctx context.Context, opts metav1.ListOptions) (*ciliumv2alpha1.CiliumPodIPPoolList, error)
- func (c *Client) ListDaemonSet(ctx context.Context, namespace string, o metav1.ListOptions) (*appsv1.DaemonSetList, error)
- func (c *Client) ListEndpoints(ctx context.Context, o metav1.ListOptions) (*corev1.EndpointsList, error)
- func (c *Client) ListEvents(ctx context.Context, o metav1.ListOptions) (*corev1.EventList, error)
- func (c *Client) ListIngressClasses(ctx context.Context, o metav1.ListOptions) (*networkingv1.IngressClassList, error)
- func (c *Client) ListIngresses(ctx context.Context, o metav1.ListOptions) (*networkingv1.IngressList, error)
- func (c *Client) ListNamespaces(ctx context.Context, o metav1.ListOptions) (*corev1.NamespaceList, error)
- func (c *Client) ListNetworkPolicies(ctx context.Context, o metav1.ListOptions) (*networkingv1.NetworkPolicyList, error)
- func (c *Client) ListNodes(ctx context.Context, options metav1.ListOptions) (*corev1.NodeList, error)
- func (c *Client) ListPods(ctx context.Context, namespace string, options metav1.ListOptions) (*corev1.PodList, error)
- func (c *Client) ListServices(ctx context.Context, namespace string, options metav1.ListOptions) (*corev1.ServiceList, error)
- func (c *Client) ListUnstructured(ctx context.Context, gvr schema.GroupVersionResource, namespace *string, ...) (*unstructured.UnstructuredList, error)
- func (c *Client) PatchConfigMap(ctx context.Context, namespace, name string, pt types.PatchType, data []byte, ...) (*corev1.ConfigMap, error)
- func (c *Client) PatchDaemonSet(ctx context.Context, namespace, name string, pt types.PatchType, data []byte, ...) (*appsv1.DaemonSet, error)
- func (c *Client) PatchNode(ctx context.Context, nodeName string, pt types.PatchType, data []byte) (*corev1.Node, error)
- func (c *Client) PatchSecret(ctx context.Context, namespace, name string, pt types.PatchType, data []byte, ...) (*corev1.Secret, error)
- func (c *Client) PodLogs(namespace, name string, opts *corev1.PodLogOptions) *rest.Request
- func (c *Client) PortForward(ctx context.Context, p PortForwardParameters) (*PortForwardResult, error)
- func (c *Client) ProxyGet(ctx context.Context, namespace, name, url string) (string, error)
- func (c *Client) ProxyTCP(ctx context.Context, namespace, name string, port uint16, ...) error
- func (c *Client) UpdateSecret(ctx context.Context, namespace string, secret *corev1.Secret, ...) (*corev1.Secret, error)
- type CopyOptions
- type CopyPipe
- type ExecParameters
- type ExecResult
- type Flavor
- type ForwardedPort
- type Kind
- type OutWriters
- type Platform
- type PortForwardParameters
- type PortForwardResult
- type ReadFunc
- type ResourceClient
Constants ¶
This section is empty.
Variables ¶
var ErrKVStoreMeshStatusNotImplemented = errors.New("kvstoremesh-dbg status is not available")
KVStoreMeshStatusNotImplemented is a sentinel error to signal that the status command is not implemented.
Functions ¶
func NewClusterRoleBinding ¶
func NewClusterRoleBinding(name, namespace, serviceAccount string) *rbacv1.ClusterRoleBinding
func NewIngressClass ¶
func NewIngressClass(name, controllerName string) *networkingv1.IngressClass
func NewServiceAccount ¶
func NewServiceAccount(name string) *corev1.ServiceAccount
Types ¶
type Client ¶
type Client struct { Clientset kubernetes.Interface ExtensionClientset apiextensionsclientset.Interface // k8s api extension needed to retrieve CRDs DynamicClientset dynamic.Interface CiliumClientset ciliumClientset.Interface Config *rest.Config RawConfig clientcmdapi.Config RESTClientGetter genericclioptions.RESTClientGetter HelmActionConfig *action.Configuration // contains filtered or unexported fields }
func (*Client) CheckDaemonSetStatus ¶ added in v0.15.20
func (*Client) CheckDeploymentStatus ¶
func (*Client) CiliumDbgEndpoints ¶ added in v0.16.0
func (*Client) CiliumLogs ¶
func (*Client) CiliumStatus ¶
func (*Client) ClusterName ¶
ClusterName returns the name of the cluster the client is connected to
func (*Client) ContextName ¶
ContextName returns the name of the context the client is connected to
func (*Client) CopyFromPod ¶
func (c *Client) CopyFromPod(ctx context.Context, namespace, pod, container, fromFile, destFile string, retryLimit int) error
CopyFromPod is to copy srcFile in a given pod to local destFile with defaultMaxTries.
func (*Client) CreateCiliumExternalWorkload ¶
func (c *Client) CreateCiliumExternalWorkload(ctx context.Context, cew *ciliumv2.CiliumExternalWorkload, opts metav1.CreateOptions) (*ciliumv2.CiliumExternalWorkload, error)
func (*Client) CreateConfigMap ¶
func (*Client) CreateDaemonSet ¶
func (*Client) CreateDeployment ¶
func (c *Client) CreateDeployment(ctx context.Context, namespace string, deployment *appsv1.Deployment, opts metav1.CreateOptions) (*appsv1.Deployment, error)
func (*Client) CreateEphemeralContainer ¶ added in v0.12.0
func (c *Client) CreateEphemeralContainer(ctx context.Context, pod *corev1.Pod, ec *corev1.EphemeralContainer) (*corev1.Pod, error)
CreateEphemeralContainer will create a EphemeralContainer (debug container) in the specified pod. EphemeralContainers are special containers which can be added after-the-fact in running pods. They're useful for debugging, either when the target container image doesn't have necessary tools, or because the pod has no running containers due to a crash.
see https://kubernetes.io/docs/concepts/workloads/pods/ephemeral-containers/
EphemeralContainers were added in there current form (behind a feature gate) in 1.22. They are scheduled for GA in v1.25.
func (*Client) CreateIngress ¶ added in v0.14.1
func (c *Client) CreateIngress(ctx context.Context, namespace string, ingress *networkingv1.Ingress, opts metav1.CreateOptions) (*networkingv1.Ingress, error)
func (*Client) CreateNamespace ¶
func (*Client) CreateSecret ¶
func (*Client) CreateService ¶
func (*Client) CreateServiceAccount ¶
func (c *Client) CreateServiceAccount(ctx context.Context, namespace string, account *corev1.ServiceAccount, opts metav1.CreateOptions) (*corev1.ServiceAccount, error)
func (*Client) DeleteCiliumClusterwideNetworkPolicy ¶
func (*Client) DeleteCiliumEgressGatewayPolicy ¶ added in v0.14.2
func (*Client) DeleteCiliumExternalWorkload ¶
func (*Client) DeleteCiliumLocalRedirectPolicy ¶ added in v0.16.10
func (*Client) DeleteCiliumNetworkPolicy ¶
func (*Client) DeleteConfigMap ¶
func (*Client) DeleteDeployment ¶
func (*Client) DeleteKubernetesNetworkPolicy ¶ added in v0.14.0
func (*Client) DeleteNamespace ¶
func (*Client) DeletePodCollection ¶
func (c *Client) DeletePodCollection(ctx context.Context, namespace string, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
func (*Client) DeleteSecret ¶
func (*Client) DeleteService ¶
func (*Client) DeleteServiceAccount ¶
func (*Client) ExecInPodWithStderr ¶
func (*Client) ExecInPodWithWriters ¶ added in v0.12.12
func (*Client) GetAPIServerHostAndPort ¶ added in v0.12.2
func (*Client) GetCRD ¶ added in v0.14.0
func (c *Client) GetCRD(ctx context.Context, name string, opts metav1.GetOptions) (*apiextensions.CustomResourceDefinition, error)
func (*Client) GetCiliumExternalWorkload ¶
func (c *Client) GetCiliumExternalWorkload(ctx context.Context, name string, opts metav1.GetOptions) (*ciliumv2.CiliumExternalWorkload, error)
func (*Client) GetCiliumLocalRedirectPolicy ¶ added in v0.16.14
func (c *Client) GetCiliumLocalRedirectPolicy(ctx context.Context, namespace, name string, opts metav1.GetOptions) (*ciliumv2.CiliumLocalRedirectPolicy, error)
func (*Client) GetCiliumVersion ¶ added in v0.12.12
GetCiliumVersion returns a semver.Version representing the version of cilium running in the cilium-agent pod
func (*Client) GetClusterRole ¶ added in v0.13.2
func (c *Client) GetClusterRole(ctx context.Context, name string, opts metav1.GetOptions) (*rbacv1.ClusterRole, error)
func (*Client) GetConfigMap ¶
func (*Client) GetCronJob ¶ added in v0.16.5
func (*Client) GetDaemonSet ¶
func (*Client) GetDeployment ¶
func (c *Client) GetDeployment(ctx context.Context, namespace, name string, opts metav1.GetOptions) (*appsv1.Deployment, error)
func (*Client) GetEndpoints ¶ added in v0.12.7
func (*Client) GetHelmMetadata ¶ added in v0.16.5
func (c *Client) GetHelmMetadata(_ context.Context, releaseName string, namespace string) (string, error)
GetHelmMetadata is the function for cilium cli sysdump to collect the helm metadata from the release directly
func (*Client) GetHelmValues ¶ added in v0.15.7
func (c *Client) GetHelmValues(_ context.Context, releaseName string, namespace string) (string, error)
GetHelmValues is the function for cilium cli sysdump to collect the helm values from the release directly
func (*Client) GetIngress ¶ added in v0.14.1
func (c *Client) GetIngress(ctx context.Context, namespace string, name string, opts metav1.GetOptions) (*networkingv1.Ingress, error)
func (*Client) GetNamespace ¶
func (*Client) GetPodsTable ¶
func (*Client) GetRunningCiliumVersion ¶
func (*Client) GetServerVersion ¶
func (*Client) GetService ¶
func (*Client) GetServiceAccount ¶ added in v0.16.14
func (c *Client) GetServiceAccount(ctx context.Context, namespace, name string, opts metav1.GetOptions) (*corev1.ServiceAccount, error)
func (*Client) GetStatefulSet ¶ added in v0.14.8
func (c *Client) GetStatefulSet(ctx context.Context, namespace, name string, opts metav1.GetOptions) (*appsv1.StatefulSet, error)
func (*Client) KVStoreMeshStatus ¶ added in v0.16.8
func (*Client) ListCiliumBGPPeeringPolicies ¶ added in v0.12.13
func (c *Client) ListCiliumBGPPeeringPolicies(ctx context.Context, opts metav1.ListOptions) (*ciliumv2alpha1.CiliumBGPPeeringPolicyList, error)
func (*Client) ListCiliumCIDRGroups ¶ added in v0.14.4
func (c *Client) ListCiliumCIDRGroups(ctx context.Context, opts metav1.ListOptions) (*ciliumv2alpha1.CiliumCIDRGroupList, error)
func (*Client) ListCiliumClusterwideEnvoyConfigs ¶ added in v0.11.5
func (c *Client) ListCiliumClusterwideEnvoyConfigs(ctx context.Context, opts metav1.ListOptions) (*ciliumv2.CiliumClusterwideEnvoyConfigList, error)
func (*Client) ListCiliumClusterwideNetworkPolicies ¶
func (c *Client) ListCiliumClusterwideNetworkPolicies(ctx context.Context, opts metav1.ListOptions) (*ciliumv2.CiliumClusterwideNetworkPolicyList, error)
func (*Client) ListCiliumEgressGatewayPolicies ¶ added in v0.12.9
func (c *Client) ListCiliumEgressGatewayPolicies(ctx context.Context, opts metav1.ListOptions) (*ciliumv2.CiliumEgressGatewayPolicyList, error)
func (*Client) ListCiliumEndpointSlices ¶ added in v0.14.0
func (c *Client) ListCiliumEndpointSlices(ctx context.Context, options metav1.ListOptions) (*ciliumv2alpha1.CiliumEndpointSliceList, error)
func (*Client) ListCiliumEndpoints ¶
func (c *Client) ListCiliumEndpoints(ctx context.Context, namespace string, options metav1.ListOptions) (*ciliumv2.CiliumEndpointList, error)
func (*Client) ListCiliumEnvoyConfigs ¶ added in v0.11.5
func (c *Client) ListCiliumEnvoyConfigs(ctx context.Context, namespace string, options metav1.ListOptions) (*ciliumv2.CiliumEnvoyConfigList, error)
func (*Client) ListCiliumExternalWorkloads ¶
func (c *Client) ListCiliumExternalWorkloads(ctx context.Context, opts metav1.ListOptions) (*ciliumv2.CiliumExternalWorkloadList, error)
func (*Client) ListCiliumIdentities ¶
func (*Client) ListCiliumLoadBalancerIPPools ¶ added in v0.12.13
func (c *Client) ListCiliumLoadBalancerIPPools(ctx context.Context, opts metav1.ListOptions) (*ciliumv2alpha1.CiliumLoadBalancerIPPoolList, error)
func (*Client) ListCiliumLocalRedirectPolicies ¶
func (c *Client) ListCiliumLocalRedirectPolicies(ctx context.Context, namespace string, opts metav1.ListOptions) (*ciliumv2.CiliumLocalRedirectPolicyList, error)
func (*Client) ListCiliumNetworkPolicies ¶
func (c *Client) ListCiliumNetworkPolicies(ctx context.Context, namespace string, opts metav1.ListOptions) (*ciliumv2.CiliumNetworkPolicyList, error)
func (*Client) ListCiliumNodeConfigs ¶ added in v0.12.13
func (c *Client) ListCiliumNodeConfigs(ctx context.Context, namespace string, opts metav1.ListOptions) (*ciliumv2alpha1.CiliumNodeConfigList, error)
func (*Client) ListCiliumNodes ¶
func (*Client) ListCiliumPodIPPools ¶ added in v0.14.8
func (c *Client) ListCiliumPodIPPools(ctx context.Context, opts metav1.ListOptions) (*ciliumv2alpha1.CiliumPodIPPoolList, error)
func (*Client) ListDaemonSet ¶
func (c *Client) ListDaemonSet(ctx context.Context, namespace string, o metav1.ListOptions) (*appsv1.DaemonSetList, error)
func (*Client) ListEndpoints ¶ added in v0.11.1
func (c *Client) ListEndpoints(ctx context.Context, o metav1.ListOptions) (*corev1.EndpointsList, error)
func (*Client) ListEvents ¶
func (*Client) ListIngressClasses ¶ added in v0.14.4
func (c *Client) ListIngressClasses(ctx context.Context, o metav1.ListOptions) (*networkingv1.IngressClassList, error)
func (*Client) ListIngresses ¶ added in v0.11.5
func (c *Client) ListIngresses(ctx context.Context, o metav1.ListOptions) (*networkingv1.IngressList, error)
func (*Client) ListNamespaces ¶
func (c *Client) ListNamespaces(ctx context.Context, o metav1.ListOptions) (*corev1.NamespaceList, error)
func (*Client) ListNetworkPolicies ¶
func (c *Client) ListNetworkPolicies(ctx context.Context, o metav1.ListOptions) (*networkingv1.NetworkPolicyList, error)
func (*Client) ListServices ¶
func (c *Client) ListServices(ctx context.Context, namespace string, options metav1.ListOptions) (*corev1.ServiceList, error)
func (*Client) ListUnstructured ¶
func (c *Client) ListUnstructured(ctx context.Context, gvr schema.GroupVersionResource, namespace *string, o metav1.ListOptions) (*unstructured.UnstructuredList, error)
func (*Client) PatchConfigMap ¶
func (*Client) PatchDaemonSet ¶
func (*Client) PatchSecret ¶
func (*Client) PortForward ¶ added in v0.14.4
func (c *Client) PortForward(ctx context.Context, p PortForwardParameters) (*PortForwardResult, error)
PortForward executes in a goroutine a port forward command. To stop the port-forwarding, use the context by cancelling it
type CopyOptions ¶
type CopyOptions struct { // Maximum number of retries, -1 for unlimited retries. MaxTries int // ReaderFunc is the actual implementation for reading file content ReadFunc ReadFunc }
CopyOptions have the data required to perform the copy operation
type CopyPipe ¶
type CopyPipe struct { Options *CopyOptions Reader *io.PipeReader Writer *io.PipeWriter // contains filtered or unexported fields }
CopyPipe struct is simple implementation to support copy files with retry.
type ExecParameters ¶
type ForwardedPort ¶ added in v0.14.4
ForwardedPort holds the remote and local mapped port.
type OutWriters ¶ added in v0.14.4
OutWriters holds the two io.Writer needed for the port forward one for the output and for the errors.
type PortForwardParameters ¶ added in v0.14.4
type PortForwardParameters struct { Namespace string Pod string Ports []string Addresses []string OutWriters OutWriters }
PortForwardParameters are the needed parameters to call PortForward. Ports value follow the kubectl syntax: <local-port>:<remote-port> 5000 means 5000:5000 listening on 5000 port locally, forwarding to 5000 in the pod 8888:5000 means listening on 8888 port locally, forwarding to 5000 in the pod 0:5000 means listening on a random port locally, forwarding to 5000 in the pod :5000 means listening on a random port locally, forwarding to 5000 in the pod
type PortForwardResult ¶ added in v0.14.4
type PortForwardResult struct {
ForwardedPorts []ForwardedPort
}
PortForwardResult are the ports that have been forwarded.
type ReadFunc ¶
ReadFunc function is to support reading content from given offset till EOF. The content will be written to io.Writer.
type ResourceClient ¶ added in v0.16.12
type ResourceClient[T any] interface { Create(ctx context.Context, r *T, opts metav1.CreateOptions) (*T, error) Update(ctx context.Context, r *T, opts metav1.UpdateOptions) (*T, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*T, error) }
ResourceClient is a common client interface for typed k8s resource clients.