Documentation
¶
Index ¶
- Constants
- Variables
- func AddNodeLabels(ctx context.Context, nodes corev1.NodeInterface, nodeName string, ...) (*apiv1.Node, error)
- func CreateLabelSelector(key string, selector *string) string
- func DeploymentExists(ctx context.Context, deploymentsClient typedappsv1.DeploymentInterface, ...) (bool, error)
- func ExecCmdOnPod(ctx context.Context, clientset *kubernetes.Clientset, ...) ([]byte, []byte, error)
- func ExportLogsByLabelSelector(ctx context.Context, clientset *kubernetes.Clientset, ...) error
- func GetConfigmap(ctx context.Context, clientset *kubernetes.Clientset, namespace, name string) (*corev1.ConfigMap, error)
- func GetDeploymentAvailableReplicas(ctx context.Context, deploymentsClient typedappsv1.DeploymentInterface, ...) (int32, error)
- func GetKubeconfig() *string
- func GetNodeList(ctx context.Context, clientset *kubernetes.Clientset) (*corev1.NodeList, error)
- func GetNodeListByLabelSelector(ctx context.Context, clientset *kubernetes.Clientset, labelSelector string) (*corev1.NodeList, error)
- func GetPodsByNode(ctx context.Context, clientset *kubernetes.Clientset, ...) (*corev1.PodList, error)
- func GetPodsIpsByNode(ctx context.Context, clientset *kubernetes.Clientset, ...) ([]string, error)
- func GetRESTClientForMultitenantCRD(kubeconfig string) (*rest.RESTClient, error)
- func GetRESTClientForMultitenantCRDFromConfig(config *rest.Config) (*rest.RESTClient, error)
- func GetService(ctx context.Context, clientset *kubernetes.Clientset, namespace, name string) (*corev1.Service, error)
- func HasWindowsNodes(ctx context.Context, clientset *kubernetes.Clientset) (bool, error)
- func InstallCNSDaemonset(ctx context.Context, clientset *kubernetes.Clientset, logDir string) (func() error, error)
- func InstallIPMasqAgent(ctx context.Context, clientset *kubernetes.Clientset) error
- func Int32ToPtr(i int32) *int32
- func MustCreateDaemonset(ctx context.Context, daemonsets typedappsv1.DaemonSetInterface, ...)
- func MustCreateDeployment(ctx context.Context, deployments typedappsv1.DeploymentInterface, ...)
- func MustCreateNamespace(ctx context.Context, clienset *kubernetes.Clientset, namespace string)
- func MustDeleteCiliumLocalRedirectPolicy(ctx context.Context, ...)
- func MustDeleteCiliumNetworkPolicy(ctx context.Context, cnpClient typedciliumv2.CiliumNetworkPolicyInterface, ...)
- func MustDeleteConfigMap(ctx context.Context, configMaps typedcorev1.ConfigMapInterface, ...)
- func MustDeleteDaemonset(ctx context.Context, daemonsets typedappsv1.DaemonSetInterface, ...)
- func MustDeleteDeployment(ctx context.Context, deployments typedappsv1.DeploymentInterface, ...)
- func MustDeleteNamespace(ctx context.Context, clienset *kubernetes.Clientset, namespace string)
- func MustDeletePod(ctx context.Context, podI typedcorev1.PodInterface, pod corev1.Pod)
- func MustDeleteService(ctx context.Context, services typedcorev1.ServiceInterface, svc corev1.Service)
- func MustDeleteServiceAccount(ctx context.Context, serviceAccounts typedcorev1.ServiceAccountInterface, ...)
- func MustGetClientset() *kubernetes.Clientset
- func MustGetRestConfig() *rest.Config
- func MustLabelSwiftNodes(ctx context.Context, clientset *kubernetes.Clientset, ...)
- func MustParseDaemonSet(path string) appsv1.DaemonSet
- func MustParseDeployment(path string) appsv1.Deployment
- func MustRestartDaemonset(ctx context.Context, clientset *kubernetes.Clientset, ...) error
- func MustScaleDeployment(ctx context.Context, deploymentsClient typedappsv1.DeploymentInterface, ...)
- func MustSetUpClusterRBAC(ctx context.Context, clientset *kubernetes.Clientset, ...) func()
- func MustSetUpRBAC(ctx context.Context, clientset *kubernetes.Clientset, ...)
- func MustSetupCNP(ctx context.Context, clientset *cilium.Clientset, cnpPath string) (ciliumv2.CiliumNetworkPolicy, func())
- func MustSetupConfigMap(ctx context.Context, clientset *kubernetes.Clientset, configMapPath string) (corev1.ConfigMap, func())
- func MustSetupDaemonset(ctx context.Context, clientset *kubernetes.Clientset, dsPath string) (appsv1.DaemonSet, func())
- func MustSetupDeployment(ctx context.Context, clientset *kubernetes.Clientset, depPath string) (appsv1.Deployment, func())
- func MustSetupLRP(ctx context.Context, clientset *cilium.Clientset, lrpPath string) (ciliumv2.CiliumLocalRedirectPolicy, func())
- func MustSetupService(ctx context.Context, clientset *kubernetes.Clientset, servicePath string) (corev1.Service, func())
- func MustSetupServiceAccount(ctx context.Context, clientset *kubernetes.Clientset, ...) (corev1.ServiceAccount, func())
- func MustUpdateReplica(ctx context.Context, deploymentsClient typedappsv1.DeploymentInterface, ...)
- func NamespaceExists(ctx context.Context, clientset *kubernetes.Clientset, namespace string) (bool, error)
- func RestartCNSDaemonset(ctx context.Context, clientset *kubernetes.Clientset, waitForReady bool) error
- func RestartKubeProxyService(ctx context.Context, clientset *kubernetes.Clientset, ...) error
- func WaitForDeploymentToDelete(ctx context.Context, deploymentsClient typedappsv1.DeploymentInterface, ...) error
- func WaitForPodDaemonset(ctx context.Context, clientset *kubernetes.Clientset, ...) error
- func WaitForPodDeployment(ctx context.Context, clientset *kubernetes.Clientset, ...) error
- func WaitForPodsDelete(ctx context.Context, clientset *kubernetes.Clientset, ...) error
- func WaitForPodsRunning(ctx context.Context, clientset *kubernetes.Clientset, ...) error
- type CNSScenario
Constants ¶
View Source
const ( DelegatedSubnetIDLabel = "kubernetes.azure.com/podnetwork-delegationguid" SubnetNameLabel = "kubernetes.azure.com/podnetwork-subnet" // RetryAttempts is the number of times to retry a test. RetryAttempts = 90 RetryDelay = 10 * time.Second DeleteRetryAttempts = 12 DeleteRetryDelay = 5 * time.Second ShortRetryAttempts = 8 ShortRetryDelay = 250 * time.Millisecond PrivilegedDaemonSetPath = "../manifests/load/privileged-daemonset-windows.yaml" PrivilegedLabelSelector = "app=privileged-daemonset" PrivilegedNamespace = "kube-system" )
View Source
const (
EnvInstallCNS = "INSTALL_CNS"
)
Variables ¶
Functions ¶
func AddNodeLabels ¶
func AddNodeLabels(ctx context.Context, nodes corev1.NodeInterface, nodeName string, labels map[string]string) (*apiv1.Node, error)
AddNodeLabels adds or replaces labels on a node.
func CreateLabelSelector ¶
return a label selector
func DeploymentExists ¶ added in v1.5.18
func DeploymentExists(ctx context.Context, deploymentsClient typedappsv1.DeploymentInterface, deploymentName string) (bool, error)
func ExecCmdOnPod ¶
func ExecCmdOnPod(ctx context.Context, clientset *kubernetes.Clientset, namespace, podName, containerName string, cmd []string, config *rest.Config, doRetry bool) ([]byte, []byte, error)
ExecCmdOnPod runs the specified command on a particular pod and retries the command on failure if doRetry is set to true The function returns the standard output, standard error, and error (if any) in that order
func GetConfigmap ¶ added in v1.6.23
func GetDeploymentAvailableReplicas ¶ added in v1.5.18
func GetDeploymentAvailableReplicas(ctx context.Context, deploymentsClient typedappsv1.DeploymentInterface, deploymentName string) (int32, error)
func GetKubeconfig ¶ added in v1.5.29
func GetKubeconfig() *string
func GetNodeList ¶
func GetPodsByNode ¶
func GetPodsIpsByNode ¶
func GetRESTClientForMultitenantCRD ¶ added in v1.5.29
func GetRESTClientForMultitenantCRD(kubeconfig string) (*rest.RESTClient, error)
func GetRESTClientForMultitenantCRDFromConfig ¶ added in v1.5.29
func GetRESTClientForMultitenantCRDFromConfig(config *rest.Config) (*rest.RESTClient, error)
func GetService ¶ added in v1.6.23
func HasWindowsNodes ¶
func InstallCNSDaemonset ¶
func InstallIPMasqAgent ¶
func InstallIPMasqAgent(ctx context.Context, clientset *kubernetes.Clientset) error
func Int32ToPtr ¶
func MustCreateDaemonset ¶
func MustCreateDaemonset(ctx context.Context, daemonsets typedappsv1.DaemonSetInterface, ds appsv1.DaemonSet)
func MustCreateDeployment ¶
func MustCreateDeployment(ctx context.Context, deployments typedappsv1.DeploymentInterface, d appsv1.Deployment)
func MustCreateNamespace ¶
func MustCreateNamespace(ctx context.Context, clienset *kubernetes.Clientset, namespace string)
func MustDeleteCiliumLocalRedirectPolicy ¶ added in v1.6.23
func MustDeleteCiliumLocalRedirectPolicy(ctx context.Context, lrpClient typedciliumv2.CiliumLocalRedirectPolicyInterface, clrp ciliumv2.CiliumLocalRedirectPolicy)
func MustDeleteCiliumNetworkPolicy ¶ added in v1.6.24
func MustDeleteCiliumNetworkPolicy(ctx context.Context, cnpClient typedciliumv2.CiliumNetworkPolicyInterface, cnp ciliumv2.CiliumNetworkPolicy)
func MustDeleteConfigMap ¶ added in v1.6.23
func MustDeleteConfigMap(ctx context.Context, configMaps typedcorev1.ConfigMapInterface, cm corev1.ConfigMap)
func MustDeleteDaemonset ¶
func MustDeleteDaemonset(ctx context.Context, daemonsets typedappsv1.DaemonSetInterface, ds appsv1.DaemonSet)
func MustDeleteDeployment ¶
func MustDeleteDeployment(ctx context.Context, deployments typedappsv1.DeploymentInterface, d appsv1.Deployment)
func MustDeleteNamespace ¶
func MustDeleteNamespace(ctx context.Context, clienset *kubernetes.Clientset, namespace string)
func MustDeletePod ¶
func MustDeletePod(ctx context.Context, podI typedcorev1.PodInterface, pod corev1.Pod)
func MustDeleteService ¶ added in v1.6.23
func MustDeleteService(ctx context.Context, services typedcorev1.ServiceInterface, svc corev1.Service)
func MustDeleteServiceAccount ¶ added in v1.6.23
func MustDeleteServiceAccount(ctx context.Context, serviceAccounts typedcorev1.ServiceAccountInterface, svcAcct corev1.ServiceAccount)
func MustGetClientset ¶
func MustGetClientset() *kubernetes.Clientset
func MustGetRestConfig ¶
func MustLabelSwiftNodes ¶
func MustLabelSwiftNodes(ctx context.Context, clientset *kubernetes.Clientset, delegatedSubnetID, delegatedSubnetName string)
func MustParseDaemonSet ¶
func MustParseDeployment ¶
func MustParseDeployment(path string) appsv1.Deployment
func MustRestartDaemonset ¶
func MustScaleDeployment ¶
func MustScaleDeployment(ctx context.Context, deploymentsClient typedappsv1.DeploymentInterface, deployment appsv1.Deployment, clientset *kubernetes.Clientset, namespace, podLabelSelector string, replicas int, skipWait bool, )
func MustSetUpClusterRBAC ¶
func MustSetUpClusterRBAC(ctx context.Context, clientset *kubernetes.Clientset, clusterRolePath, clusterRoleBindingPath, serviceAccountPath string) func()
func MustSetUpRBAC ¶
func MustSetUpRBAC(ctx context.Context, clientset *kubernetes.Clientset, rolePath, roleBindingPath string)
func MustSetupCNP ¶ added in v1.6.24
func MustSetupConfigMap ¶
func MustSetupDaemonset ¶ added in v1.6.23
func MustSetupDaemonset(ctx context.Context, clientset *kubernetes.Clientset, dsPath string) (appsv1.DaemonSet, func())
MustSetupDaemonset is a convenience function to directly apply the daemonset at dsPath to the cluster, returning the parsed daemonset struct and a cleanup function in the process
func MustSetupDeployment ¶ added in v1.6.23
func MustSetupDeployment(ctx context.Context, clientset *kubernetes.Clientset, depPath string) (appsv1.Deployment, func())
func MustSetupLRP ¶ added in v1.6.23
func MustSetupService ¶ added in v1.6.23
func MustSetupServiceAccount ¶ added in v1.6.23
func MustSetupServiceAccount(ctx context.Context, clientset *kubernetes.Clientset, serviceAccountPath string) (corev1.ServiceAccount, func())
func MustUpdateReplica ¶
func MustUpdateReplica(ctx context.Context, deploymentsClient typedappsv1.DeploymentInterface, deploymentName string, replicas int32)
func NamespaceExists ¶
func RestartCNSDaemonset ¶
func RestartKubeProxyService ¶ added in v1.5.20
func RestartKubeProxyService(ctx context.Context, clientset *kubernetes.Clientset, privilegedNamespace, privilegedLabelSelector string, config *rest.Config) error
Restarts kubeproxy on windows nodes from an existing privileged daemonset
func WaitForDeploymentToDelete ¶
func WaitForDeploymentToDelete(ctx context.Context, deploymentsClient typedappsv1.DeploymentInterface, d appsv1.Deployment) error
func WaitForPodDaemonset ¶
func WaitForPodDeployment ¶
func WaitForPodsDelete ¶
func WaitForPodsRunning ¶
Types ¶
type CNSScenario ¶
type CNSScenario string
const ( EnvInstallAzilium CNSScenario = "INSTALL_AZILIUM" EnvInstallAzureVnet CNSScenario = "INSTALL_AZURE_VNET" EnvInstallAzureVnetStateless CNSScenario = "INSTALL_AZURE_VNET_STATELESS" EnvInstallOverlay CNSScenario = "INSTALL_OVERLAY" EnvInstallAzureCNIOverlay CNSScenario = "INSTALL_AZURE_CNI_OVERLAY" EnvInstallDualStackOverlay CNSScenario = "INSTALL_DUALSTACK_OVERLAY" EnvInstallCNSNodeSubnet CNSScenario = "INSTALL_CNS_NODESUBNET" )
Click to show internal directories.
Click to hide internal directories.