Documentation
¶
Overview ¶
* Copyright The Kmesh Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
Index ¶
- func AnnotationEnabled(annotation string) bool
- func AtomicCopy(srcFilepath, targetDir, targetFilename string) error
- func AtomicWrite(path string, data []byte, mode os.FileMode) error
- func DelKmeshRedirectAnnotation(client kubernetes.Interface, pod *corev1.Pod) error
- func Execute(cmd string, args []string) error
- func ExecuteWithRedirect(cmd string, args []string, stdout io.Writer) error
- func GetKernelVersion() string
- func GetMapByName(name string) (*ebpf.Map, error)
- func GetProgramByName(name string) (*ebpf.Program, error)
- func GetVethPeerIndexFromInterface(iface net.Interface) (uint64, error)
- func GetVethPeerIndexFromName(ifaceName string) (uint64, error)
- func HandleKmeshManage(ns string, enroll bool) error
- func IfaceContainIPs(iface net.Interface, IPs []string) (bool, error)
- func KernelVersionLowerThan5_13() bool
- func ManageTCProgram(link netlink.Link, tc *ebpf.Program, mode int) error
- func ManageTCProgramByFd(link netlink.Link, tcFd int, mode int) error
- func PatchKmeshRedirectAnnotation(client kubernetes.Interface, pod *corev1.Pod) error
- func ShouldEnroll(pod *corev1.Pod, ns *corev1.Namespace) bool
- type HashName
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnnotationEnabled ¶ added in v1.0.0
func AtomicCopy ¶
AtomicCopy copies file by reading the file then writing atomically into the target directory
func AtomicWrite ¶
create a temp file and rename to path
func DelKmeshRedirectAnnotation ¶ added in v0.5.0
func DelKmeshRedirectAnnotation(client kubernetes.Interface, pod *corev1.Pod) error
func ExecuteWithRedirect ¶
func GetKernelVersion ¶ added in v0.5.0
func GetKernelVersion() string
GetKernelVersion return part of the result of 'uname -a' like '5.15.153.1-xxxx'
func GetVethPeerIndexFromInterface ¶ added in v1.0.0
func GetVethPeerIndexFromName ¶ added in v1.0.0
func HandleKmeshManage ¶ added in v0.5.0
func IfaceContainIPs ¶ added in v1.0.0
func KernelVersionLowerThan5_13 ¶ added in v0.5.0
func KernelVersionLowerThan5_13() bool
KernelVersionLowerThan5_13 return whether the current kernel version is lower than 5.13, and will fallback to less BPF log ability(return true) if error
func ManageTCProgram ¶ added in v1.0.0
func ManageTCProgramByFd ¶ added in v1.0.0
func PatchKmeshRedirectAnnotation ¶ added in v0.5.0
func PatchKmeshRedirectAnnotation(client kubernetes.Interface, pod *corev1.Pod) error
func ShouldEnroll ¶ added in v0.5.0
ShouldEnroll checks whether a pod should be managed by kmesh. Kmesh manages a pod if a pod has "istio.io/dataplane-mode: kmesh" label or the namespace where it resides has the label while pod have no "istio.io/dataplane-mode: none" label Excluding cases: a pod has sidecar injected, or the pod is istio managed waypoint https://github.com/istio/istio/blob/33539491628fe5f3ad4f5f1fb339b0da9455c028/manifests/charts/istio-control/istio-discovery/files/waypoint.yaml#L35
Types ¶
type HashName ¶ added in v1.0.0
type HashName struct {
// contains filtered or unexported fields
}
HashName converts a string to a uint32 integer as the key of bpf map
func NewHashName ¶ added in v1.0.0
func NewHashName() *HashName