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) ApplyGeneric(ctx context.Context, obj Object) (*unstructured.Unstructured, error)
- 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) CiliumStatus(ctx context.Context, namespace, pod string) (*models.StatusResponse, error)
- func (c *Client) ClusterName() (name string)
- func (c *Client) ContainerLogs(ctx context.Context, namespace, pod, containerName string, since time.Time, ...) (string, error)
- func (c *Client) ContextName() (name string)
- func (c *Client) CopyFromPod(ctx context.Context, namespace, pod, container, fromFile, destFile string, ...) 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) 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) DeleteGeneric(ctx context.Context, obj Object) 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) Describe(obj runtime.Object) (gvk schema.GroupVersionKind, resource schema.GroupVersionResource, err 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) 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) GetGeneric(ctx context.Context, namespace, name string, obj Object) (*unstructured.Unstructured, 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, ...) 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) ListCiliumBGPAdvertisements(ctx context.Context, opts metav1.ListOptions) (*ciliumv2alpha1.CiliumBGPAdvertisementList, error)
- func (c *Client) ListCiliumBGPClusterConfigs(ctx context.Context, opts metav1.ListOptions) (*ciliumv2alpha1.CiliumBGPClusterConfigList, error)
- func (c *Client) ListCiliumBGPNodeConfigOverrides(ctx context.Context, opts metav1.ListOptions) (*ciliumv2alpha1.CiliumBGPNodeConfigOverrideList, error)
- func (c *Client) ListCiliumBGPNodeConfigs(ctx context.Context, opts metav1.ListOptions) (*ciliumv2alpha1.CiliumBGPNodeConfigList, error)
- func (c *Client) ListCiliumBGPPeerConfigs(ctx context.Context, opts metav1.ListOptions) (*ciliumv2alpha1.CiliumBGPPeerConfigList, 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) 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) ListDeployment(ctx context.Context, namespace string, options metav1.ListOptions) (*appsv1.DeploymentList, error)
- func (c *Client) ListEndpointSlices(ctx context.Context, o metav1.ListOptions) (*discoveryv1.EndpointSliceList, 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 k8s.PortForwardParameters) (*k8s.PortForwardResult, error)
- func (c *Client) PortForwardService(ctx context.Context, namespace, name string, localPort, svcPort int32) (*k8s.PortForwardServiceResult, 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 Flavor
- type Kind
- type Object
- type Platform
- 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.
var StderrAsError stderrAsError
StderrAsError, when given as stderr parameter of the ExecInPodWithWriters function, causes any stderr message to be returned as an error.
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) ApplyGeneric ¶
func (c *Client) ApplyGeneric(ctx context.Context, obj Object) (*unstructured.Unstructured, error)
ApplyGeneric uses server-side apply to merge changes to an arbitrary object. Returns the applied object.
func (*Client) CheckDaemonSetStatus ¶
func (*Client) CheckDeploymentStatus ¶
func (*Client) CiliumDbgEndpoints ¶
func (*Client) CiliumStatus ¶
func (*Client) ClusterName ¶
ClusterName returns the name of the cluster the client is connected to
func (*Client) ContainerLogs ¶
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) 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 ¶
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 ¶
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 ¶
func (*Client) DeleteCiliumLocalRedirectPolicy ¶
func (*Client) DeleteCiliumNetworkPolicy ¶
func (*Client) DeleteConfigMap ¶
func (*Client) DeleteDeployment ¶
func (*Client) DeleteGeneric ¶
func (*Client) DeleteKubernetesNetworkPolicy ¶
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) Describe ¶
func (c *Client) Describe(obj runtime.Object) (gvk schema.GroupVersionKind, resource schema.GroupVersionResource, err error)
Describe returns the Kubernetes type and resource information for an object
func (*Client) ExecInPodWithStderr ¶
func (*Client) ExecInPodWithWriters ¶
func (*Client) GetAPIServerHostAndPort ¶
func (*Client) GetCRD ¶
func (c *Client) GetCRD(ctx context.Context, name string, opts metav1.GetOptions) (*apiextensions.CustomResourceDefinition, error)
func (*Client) GetCiliumLocalRedirectPolicy ¶
func (c *Client) GetCiliumLocalRedirectPolicy(ctx context.Context, namespace, name string, opts metav1.GetOptions) (*ciliumv2.CiliumLocalRedirectPolicy, error)
func (*Client) GetCiliumVersion ¶
GetCiliumVersion returns a semver.Version representing the version of cilium running in the cilium-agent pod
func (*Client) GetClusterRole ¶
func (c *Client) GetClusterRole(ctx context.Context, name string, opts metav1.GetOptions) (*rbacv1.ClusterRole, error)
func (*Client) GetConfigMap ¶
func (*Client) GetCronJob ¶
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 ¶
func (*Client) GetGeneric ¶
func (c *Client) GetGeneric(ctx context.Context, namespace, name string, obj Object) (*unstructured.Unstructured, error)
func (*Client) GetHelmMetadata ¶
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 ¶
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 ¶
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 ¶
func (c *Client) GetServiceAccount(ctx context.Context, namespace, name string, opts metav1.GetOptions) (*corev1.ServiceAccount, error)
func (*Client) GetStatefulSet ¶
func (c *Client) GetStatefulSet(ctx context.Context, namespace, name string, opts metav1.GetOptions) (*appsv1.StatefulSet, error)
func (*Client) KVStoreMeshStatus ¶
func (*Client) ListCiliumBGPAdvertisements ¶
func (c *Client) ListCiliumBGPAdvertisements(ctx context.Context, opts metav1.ListOptions) (*ciliumv2alpha1.CiliumBGPAdvertisementList, error)
func (*Client) ListCiliumBGPClusterConfigs ¶
func (c *Client) ListCiliumBGPClusterConfigs(ctx context.Context, opts metav1.ListOptions) (*ciliumv2alpha1.CiliumBGPClusterConfigList, error)
func (*Client) ListCiliumBGPNodeConfigOverrides ¶
func (c *Client) ListCiliumBGPNodeConfigOverrides(ctx context.Context, opts metav1.ListOptions) (*ciliumv2alpha1.CiliumBGPNodeConfigOverrideList, error)
func (*Client) ListCiliumBGPNodeConfigs ¶
func (c *Client) ListCiliumBGPNodeConfigs(ctx context.Context, opts metav1.ListOptions) (*ciliumv2alpha1.CiliumBGPNodeConfigList, error)
func (*Client) ListCiliumBGPPeerConfigs ¶
func (c *Client) ListCiliumBGPPeerConfigs(ctx context.Context, opts metav1.ListOptions) (*ciliumv2alpha1.CiliumBGPPeerConfigList, error)
func (*Client) ListCiliumBGPPeeringPolicies ¶
func (c *Client) ListCiliumBGPPeeringPolicies(ctx context.Context, opts metav1.ListOptions) (*ciliumv2alpha1.CiliumBGPPeeringPolicyList, error)
func (*Client) ListCiliumCIDRGroups ¶
func (c *Client) ListCiliumCIDRGroups(ctx context.Context, opts metav1.ListOptions) (*ciliumv2alpha1.CiliumCIDRGroupList, error)
func (*Client) ListCiliumClusterwideEnvoyConfigs ¶
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 ¶
func (c *Client) ListCiliumEgressGatewayPolicies(ctx context.Context, opts metav1.ListOptions) (*ciliumv2.CiliumEgressGatewayPolicyList, error)
func (*Client) ListCiliumEndpointSlices ¶
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 ¶
func (c *Client) ListCiliumEnvoyConfigs(ctx context.Context, namespace string, options metav1.ListOptions) (*ciliumv2.CiliumEnvoyConfigList, error)
func (*Client) ListCiliumIdentities ¶
func (*Client) ListCiliumLoadBalancerIPPools ¶
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 ¶
func (c *Client) ListCiliumNodeConfigs(ctx context.Context, namespace string, opts metav1.ListOptions) (*ciliumv2alpha1.CiliumNodeConfigList, error)
func (*Client) ListCiliumNodes ¶
func (*Client) ListCiliumPodIPPools ¶
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) ListDeployment ¶
func (c *Client) ListDeployment(ctx context.Context, namespace string, options metav1.ListOptions) (*appsv1.DeploymentList, error)
func (*Client) ListEndpointSlices ¶
func (c *Client) ListEndpointSlices(ctx context.Context, o metav1.ListOptions) (*discoveryv1.EndpointSliceList, error)
func (*Client) ListEndpoints ¶
func (c *Client) ListEndpoints(ctx context.Context, o metav1.ListOptions) (*corev1.EndpointsList, error)
func (*Client) ListEvents ¶
func (*Client) ListIngressClasses ¶
func (c *Client) ListIngressClasses(ctx context.Context, o metav1.ListOptions) (*networkingv1.IngressClassList, error)
func (*Client) ListIngresses ¶
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 ¶
func (c *Client) PortForward(ctx context.Context, p k8s.PortForwardParameters) (*k8s.PortForwardResult, error)
PortForward executes in a goroutine a port forward command. To stop the port-forwarding, use the context by cancelling it
func (*Client) PortForwardService ¶
func (c *Client) PortForwardService(ctx context.Context, namespace, name string, localPort, svcPort int32) (*k8s.PortForwardServiceResult, error)
PortForwardService executes in a goroutine a port forward command towards one of the pod behind a service. If `localPort` is 0, a random port is selected. If `svcPort` is 0, uses the first port configured on the service.
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 ReadFunc ¶
ReadFunc function is to support reading content from given offset till EOF. The content will be written to io.Writer.
type ResourceClient ¶
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.