Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

test: Disable failing kubnet tests #3436

Merged
merged 4 commits into from
Jun 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/topics/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ We are investigating possible risks & mitigations for when VMs are deprovisioned

Kubernetes 1.18 introduces alpha support for the ContainerD runtime on Windows Server 2019. This is still a work-in-progress tracked in [kubernetes/enhancements#1001](https://github.com/kubernetes/enhancements/issues/1001). This feature in AKS-Engine is for testing the in-development versions of ContainerD and Kubernetes, and is not for production use. Be sure to review [open issues](https://github.com/azure/aks-engine/issues?q=containerd+label%3Awindows+is%3Aopen) if you want to test or contribute to this effort.

Currently it only supports the `kubenet` networking model, and requires URLs to custom ContainerD and CNI plugin builds.
Currently it requires URLs to custom ContainerD and CNI plugin builds.

### Deploying multi-OS clusters with ContainerD

Expand Down
4 changes: 3 additions & 1 deletion pkg/api/vlabs/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const (

var (
// NetworkPluginValues holds the valid values for network plugin implementation
NetworkPluginValues = [...]string{"", "kubenet", "azure", NetworkPluginCilium, NetworkPluginAntrea, "flannel"}
NetworkPluginValues = [...]string{"", NetworkPluginKubenet, "azure", NetworkPluginCilium, NetworkPluginAntrea, "flannel"}

// NetworkPolicyValues holds the valid values for a network policy
// "azure" and "none" are there for backwards-compatibility
Expand Down Expand Up @@ -142,6 +142,8 @@ const (
NetworkModeBridge = "bridge"
// NetworkModeTransparent is the string expression for transparent network mode config option
NetworkModeTransparent = "transparent"
// NetworkPluginKubenet is the string expression for kubenet network plugin config option
NetworkPluginKubenet = "kubenet"
)

const (
Expand Down
4 changes: 4 additions & 0 deletions pkg/api/vlabs/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -1667,6 +1667,10 @@ func (k *KubernetesConfig) validateNetworkPlugin(hasWindows bool) error {
return errors.Errorf("networkPlugin '%s' is not supporting windows agents", networkPlugin)
}

if networkPlugin == NetworkPluginKubenet && hasWindows {
log.Warnf("Windows + Kubenet is for development and testing only, not recommended for production")
}

return nil
}

Expand Down
18 changes: 18 additions & 0 deletions pkg/api/vlabs/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,24 @@ func Test_Properties_ValidateNetworkPolicy(t *testing.T) {
}
}

func ExampleKubernetesConfig_validateNetworkPlugin() {
log.SetOutput(os.Stdout)
log.SetFormatter(&log.TextFormatter{
DisableColors: true,
DisableTimestamp: true,
})
cs := getK8sDefaultContainerService(true)

cs.Properties.OrchestratorProfile.KubernetesConfig = &KubernetesConfig{}
cs.Properties.OrchestratorProfile.KubernetesConfig.NetworkPlugin = NetworkPluginKubenet
if err := cs.Properties.OrchestratorProfile.KubernetesConfig.validateNetworkPlugin(true); err != nil {
fmt.Printf("error in ValidateNetworkPlugin: %s", err)
}

// Output:
// level=warning msg="Windows + Kubenet is for development and testing only, not recommended for production"
}

func Test_Properties_ValidateNetworkPlugin(t *testing.T) {
p := &Properties{}
p.OrchestratorProfile = &OrchestratorProfile{}
Expand Down
5 changes: 5 additions & 0 deletions test/e2e/engine/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,11 @@ func (e *Engine) HasNetworkPolicy(name string) bool {
return strings.Contains(e.ExpandedDefinition.Properties.OrchestratorProfile.KubernetesConfig.NetworkPolicy, name)
}

// HasNetworkPolicy will return true if the specified network policy is enabled
func (e *Engine) HasNetworkPlugin(name string) bool {
return strings.Contains(e.ExpandedDefinition.Properties.OrchestratorProfile.KubernetesConfig.NetworkPlugin, name)
}

// Write will write the cluster definition to disk
func (e *Engine) Write() error {
json, err := helpers.JSONMarshal(e.ClusterDefinition, false)
Expand Down
8 changes: 8 additions & 0 deletions test/e2e/kubernetes/kubernetes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1932,6 +1932,10 @@ var _ = Describe("Azure Container Cluster using the Kubernetes Orchestrator", fu

It("should be able to resolve DNS across windows and linux deployments", func() {
if eng.HasWindowsAgents() {
if eng.HasNetworkPlugin(api.NetworkPluginKubenet) {
Skip("This tests is not enabled for kubenet CNI on windows")
}

windowsImages, err := eng.GetWindowsTestImages()
Expect(err).NotTo(HaveOccurred())
r := rand.New(rand.NewSource(time.Now().UnixNano()))
Expand Down Expand Up @@ -2102,6 +2106,10 @@ var _ = Describe("Azure Container Cluster using the Kubernetes Orchestrator", fu
}
}

if eng.HasNetworkPlugin(api.NetworkPluginKubenet) {
Skip("This tests is not enabled for kubenet CNI on windows")
}

windowsImages, err := eng.GetWindowsTestImages()
Expect(err).NotTo(HaveOccurred())
r := rand.New(rand.NewSource(time.Now().UnixNano()))
Expand Down