-
Notifications
You must be signed in to change notification settings - Fork 241
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adding stateless CNI pipeline test (#2914)
* feat: adding stateless CNI pipeline test * feat: making change for stateless CNI pipeline * feat: addressing the comments * fix: fixing stateles cni yaml * fix: stateless CNI delete fix * Addresing the comments * addresing john's comments
- Loading branch information
1 parent
a9fccfa
commit 3a6959c
Showing
8 changed files
with
345 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
111 changes: 111 additions & 0 deletions
111
...ngletenancy/azure-cni-overlay-stateless/azure-cni-overlay-stateless-e2e-job-template.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
parameters: | ||
name: "" | ||
displayName: "" | ||
clusterType: "" | ||
clusterName: "" | ||
vmSize: "" | ||
k8sVersion: "" | ||
dependsOn: "" | ||
|
||
stages: | ||
- stage: ${{ parameters.clusterName }} | ||
displayName: Create Cluster - ${{ parameters.displayName }} | ||
dependsOn: | ||
- ${{ parameters.dependsOn }} | ||
- setup | ||
pool: | ||
name: $(BUILD_POOL_NAME_DEFAULT) | ||
variables: | ||
commitID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.commitID'] ] | ||
jobs: | ||
- template: ../../templates/create-cluster.yaml | ||
parameters: | ||
name: ${{ parameters.name }} | ||
displayName: ${{ parameters.displayName }} | ||
clusterType: ${{ parameters.clusterType }} | ||
clusterName: ${{ parameters.clusterName }}-$(commitID) | ||
vmSize: ${{ parameters.vmSize }} | ||
k8sVersion: ${{ parameters.k8sVersion }} | ||
dependsOn: ${{ parameters.dependsOn }} | ||
region: $(REGION_AKS_CLUSTER_TEST) | ||
- job: windows_nodepool | ||
displayName: Add Windows Nodepool | ||
dependsOn: ${{ parameters.name }} | ||
pool: | ||
name: $(BUILD_POOL_NAME_DEFAULT) | ||
demands: | ||
- agent.os -equals Linux | ||
- Role -equals $(CUSTOM_E2E_ROLE) | ||
steps: | ||
- task: AzureCLI@2 | ||
inputs: | ||
azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) | ||
scriptLocation: "inlineScript" | ||
scriptType: "bash" | ||
addSpnToEnvironment: true | ||
inlineScript: | | ||
set -e | ||
make -C ./hack/aks set-kubeconf AZCLI=az CLUSTER=${{ parameters.clusterName }}-$(commitID) | ||
make -C ./hack/aks windows-nodepool-up AZCLI=az SUB=$(SUB_AZURE_NETWORK_AGENT_BUILD_VALIDATIONS) CLUSTER=${{ parameters.clusterName }}-$(commitID) VM_SIZE_WIN=${{ parameters.vmSize }} | ||
echo "Windows node are successfully added to v4 Overlay Cluster" | ||
kubectl cluster-info | ||
kubectl get node -owide | ||
kubectl get po -owide -A | ||
name: "Add_Windows_Node" | ||
displayName: "Add windows node on v4 overlay cluster" | ||
|
||
- stage: ${{ parameters.name }} | ||
displayName: E2E - ${{ parameters.displayName }} | ||
dependsOn: | ||
- setup | ||
- publish | ||
- ${{ parameters.clusterName }} | ||
variables: | ||
commitID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.commitID'] ] | ||
GOPATH: "$(Agent.TempDirectory)/go" # Go workspace path | ||
GOBIN: "$(GOPATH)/bin" # Go binaries path | ||
modulePath: "$(GOPATH)/src/github.com/Azure/azure-container-networking" | ||
pool: | ||
name: $(BUILD_POOL_NAME_DEFAULT) | ||
jobs: | ||
- job: ${{ parameters.name }}_windows | ||
displayName: Azure Stateless CNI Overlay Test Suite | Windows - (${{ parameters.name }}) | ||
pool: | ||
name: $(BUILD_POOL_NAME_DEFAULT) | ||
demands: | ||
- agent.os -equals Linux | ||
- Role -equals $(CUSTOM_E2E_ROLE) | ||
steps: | ||
- template: azure-cni-overlay-stateless-e2e-step-template.yaml | ||
parameters: | ||
name: ${{ parameters.name }} | ||
clusterName: ${{ parameters.clusterName }}-$(commitID) | ||
os: windows | ||
vmSizeWin: ${{ parameters.vmSize }} | ||
|
||
- template: ../../cni/k8s-e2e/k8s-e2e-job-template.yaml | ||
parameters: | ||
sub: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) | ||
clusterName: ${{ parameters.clusterName }}-$(commitID) | ||
os: windows | ||
dependsOn: ${{ parameters.name }}_windows | ||
datapath: true | ||
dns: true | ||
portforward: true | ||
hostport: true | ||
service: true | ||
hybridWin: true | ||
|
||
- job: failedE2ELogs_windows | ||
displayName: "Windows Failure Logs" | ||
dependsOn: | ||
- ${{ parameters.name }}_windows | ||
- cni_windows | ||
condition: in(dependencies.${{ parameters.name }}_windows.result, 'Failed') | ||
steps: | ||
- template: ../../templates/log-template.yaml | ||
parameters: | ||
clusterName: ${{ parameters.clusterName }}-$(commitID) | ||
os: windows | ||
cni: cniv2 | ||
|
93 changes: 93 additions & 0 deletions
93
...gletenancy/azure-cni-overlay-stateless/azure-cni-overlay-stateless-e2e-step-template.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
parameters: | ||
name: "" | ||
clusterName: "" | ||
os: "" | ||
|
||
steps: | ||
- bash: | | ||
go version | ||
go env | ||
mkdir -p '$(GOBIN)' | ||
mkdir -p '$(GOPATH)/pkg' | ||
mkdir -p '$(modulePath)' | ||
echo '##vso[task.prependpath]$(GOBIN)' | ||
echo '##vso[task.prependpath]$(GOROOT)/bin' | ||
name: "GoEnv" | ||
displayName: "Set up the Go environment" | ||
- task: KubectlInstaller@0 | ||
inputs: | ||
kubectlVersion: latest | ||
|
||
- task: AzureCLI@2 | ||
inputs: | ||
azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) | ||
scriptLocation: "inlineScript" | ||
scriptType: "bash" | ||
addSpnToEnvironment: true | ||
inlineScript: | | ||
set -e | ||
make -C ./hack/aks set-kubeconf AZCLI=az CLUSTER=${{ parameters.clusterName }} | ||
name: "kubeconfig" | ||
displayName: "Set Kubeconfig" | ||
|
||
- script: | | ||
nodeList=`kubectl get node -owide | grep Windows | awk '{print $1}'` | ||
for node in $nodeList; do | ||
taint=`kubectl describe node $node | grep Taints | awk '{print $2}'` | ||
if [ $taint == "node.cloudprovider.kubernetes.io/uninitialized=true:NoSchedule" ]; then | ||
kubectl taint nodes $node node.cloudprovider.kubernetes.io/uninitialized=true:NoSchedule- | ||
fi | ||
done | ||
sudo -E env "PATH=$PATH" make test-load SCALE_UP=32 OS_TYPE=windows CNI_TYPE=stateless VALIDATE_STATEFILE=true INSTALL_CNS=true INSTALL_AZURE_VNET_STATELESS=true VALIDATE_V4OVERLAY=true CNS_VERSION=$(make cns-version) CNI_VERSION=$(make cni-version) CLEANUP=true | ||
name: "WindowsOverlayControlPlaneScaleTests" | ||
displayName: "Windows v4Overlay ControlPlane Scale Tests" | ||
retryCountOnTaskFailure: 2 | ||
- task: AzureCLI@2 | ||
inputs: | ||
azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) | ||
scriptLocation: "inlineScript" | ||
scriptType: "bash" | ||
addSpnToEnvironment: true | ||
inlineScript: | | ||
set -e | ||
kubectl get po -owide -A | ||
clusterName=${{ parameters.clusterName }} | ||
echo "Restarting nodes" | ||
for val in $(az vmss list -g MC_${clusterName}_${clusterName}_$(REGION_AKS_CLUSTER_TEST) --query "[].name" -o tsv); do | ||
make -C ./hack/aks restart-vmss AZCLI=az CLUSTER=${clusterName} REGION=$(REGION_AKS_CLUSTER_TEST) VMSS_NAME=${val} | ||
done | ||
displayName: "Restart Nodes" | ||
|
||
- task: AzureCLI@2 | ||
inputs: | ||
azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) | ||
scriptLocation: "inlineScript" | ||
scriptType: "bash" | ||
addSpnToEnvironment: true | ||
inlineScript: | | ||
cd test/integration/load | ||
clusterName=${{ parameters.clusterName }} | ||
make -C ./hack/aks set-kubeconf AZCLI=az CLUSTER=${clusterName} | ||
make -C ./hack/aks azcfg AZCLI=az REGION=$(REGION_AKS_CLUSTER_TEST) | ||
kubectl get pods -owide -A | ||
echo "Validating Node Restart" | ||
CNI_TYPE=stateless RESTART_CASE=true go test -timeout 30m -tags load -run ^TestValidateState$ | ||
displayName: "Validate Node Restart" | ||
retryCountOnTaskFailure: 3 | ||
|
||
- script: | | ||
echo "Run wireserver and metadata connectivity Tests" | ||
bash test/network/wireserver_metadata_test.sh | ||
retryCountOnTaskFailure: 3 | ||
name: "WireserverMetadataConnectivityTests" | ||
displayName: "Run Wireserver and Metadata Connectivity Tests" | ||
- script: | | ||
echo "IPv4 Overlay DataPath Test" | ||
cd test/integration/datapath | ||
sudo -E env "PATH=$PATH" go test -count=1 datapath_windows_test.go -timeout 3m -tags connection -restartKubeproxy true -run ^TestDatapathWin$ | ||
name: "WindowsV4OverlayDatapathTests" | ||
displayName: "Windows v4Overlay Datapath Tests" | ||
retryCountOnTaskFailure: 3 |
35 changes: 35 additions & 0 deletions
35
test/integration/manifests/cnsconfig/azurestatelesscnioverlaywindowsconfigmap.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: cns-win-config | ||
namespace: kube-system | ||
data: | ||
cns_config.json: | | ||
{ | ||
"TelemetrySettings": { | ||
"TelemetryBatchSizeBytes": 16384, | ||
"TelemetryBatchIntervalInSecs": 15, | ||
"RefreshIntervalInSecs": 15, | ||
"DisableAll": false, | ||
"HeartBeatIntervalInMins": 30, | ||
"DebugMode": false, | ||
"SnapshotIntervalInMins": 60 | ||
}, | ||
"ManagedSettings": { | ||
"PrivateEndpoint": "", | ||
"InfrastructureNetworkID": "", | ||
"NodeID": "", | ||
"NodeSyncIntervalInSeconds": 30 | ||
}, | ||
"EnableSubnetScarcity": false, | ||
"ChannelMode": "CRD", | ||
"InitializeFromCNI": false, | ||
"ManageEndpointState": true, | ||
"ProgramSNATIPTables" : false, | ||
"MetricsBindAddress": ":10092", | ||
"EnableCNIConflistGeneration": false, | ||
"CNIConflistFilepath": "C:\\k\\azurecni\\netconf\\10-azure.conflist", | ||
"CNIConflistScenario": "v4overlay", | ||
"EnableAsyncPodDelete": true, | ||
"AsyncPodDeletePath": "/var/run/azure-vnet/deleteIDs" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.