-
Notifications
You must be signed in to change notification settings - Fork 228
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: [CNI] replace aks engine cluster with aks cluster creation
- Loading branch information
Showing
5 changed files
with
240 additions
and
21 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
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,40 @@ | ||
parameters: | ||
name: "" | ||
displayName: "" | ||
arch: "" | ||
os: "" | ||
clusterType: "" | ||
clusterName: "" | ||
k8sVersion: "" | ||
windowsOsSku: "" | ||
|
||
stages: | ||
- stage: ${{ parameters.name }} | ||
displayName: E2E - ${{ parameters.displayName }} | ||
dependsOn: | ||
- setup | ||
- publish | ||
jobs: | ||
- job: ${{ parameters.name }} | ||
displayName: Singletenancy AKS - (${{ parameters.name }}) | ||
pool: | ||
name: $(BUILD_POOL_NAME_DEFAULT) | ||
demands: | ||
- agent.os -equals Linux | ||
- Role -equals $(CUSTOM_E2E_ROLE) | ||
variables: | ||
GOPATH: "$(Agent.TempDirectory)/go" # Go workspace path | ||
GOBIN: "$(GOPATH)/bin" # Go binaries path | ||
modulePath: "$(GOPATH)/src/github.com/Azure/azure-container-networking" | ||
dropgzVersion: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.dropgzVersion'] ] | ||
steps: | ||
- template: e2e-step-template.yaml | ||
parameters: | ||
name: ${{ parameters.name }} | ||
clusterType: ${{ parameters.clusterType }} | ||
clusterName: ${{ parameters.clusterName }} | ||
arch: ${{ parameters.arch }} | ||
os: ${{ parameters.os }} | ||
k8sVersion: ${{ parameters.k8sVersion }} | ||
version: $(dropgzVersion) | ||
windowsOsSku: ${{ parameters.windowsOsSku}} |
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,61 @@ | ||
parameters: | ||
name: "" | ||
clusterType: "" | ||
clusterName: "" | ||
nodeCount: "" | ||
vmSize: "" | ||
windowsVMSize: "" | ||
k8sVersion: "" | ||
version: "" | ||
os: "" | ||
windowsOsSku: "" | ||
|
||
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: AzureCLI@1 | ||
inputs: | ||
azureSubscription: $(AZURE_TEST_AGENT_SERVICE_CONNECTION) | ||
scriptLocation: "inlineScript" | ||
scriptType: "bash" | ||
addSpnToEnvironment: true | ||
inlineScript: | | ||
mkdir -p ~/.kube/ | ||
echo "Create AKS cluster" | ||
make -C ./hack/aks azcfg AZCLI=az REGION=$(REGION_AKS_CLUSTER_TEST) | ||
make -C ./hack/aks ${{ parameters.clusterType }} AZCLI=az REGION=$(REGION_AKS_CLUSTER_TEST) SUB=$(SUB_AZURE_NETWORK_AGENT_TEST) CLUSTER=${{ parameters.clusterName }}-$(make revision) K8S_VER=${{ parameters.k8sVersion }} \ | ||
WINDOWS_OS_SKU=${{parameters.windowsOsSku}} WINDOWS_USERNAME=${WINDOWS_USERNAME} WINDOWS_PASSWORD=${WINDOWS_PASSWORD} | ||
echo "Cluster successfully created" | ||
displayName: Create test cluster | ||
- script: | | ||
echo "Upload CNI" | ||
export DROP_GZ_URL=$( make cni-dropgz-image-name-and-tag OS=${{parameters.os}} ARCH=${{parameters.arch}} CNI_DROPGZ_VERSION=${{parameters.version}}) | ||
envsubst < ./test/integration/manifests/cni/cni-installer-v1.yaml | kubectl apply -f - | ||
if [ "${{parameters.os}}" == "windows" ]; then | ||
export CNI_IMAGE=$(make acncli-image-name-and-tag OS=${{parameters.os}} ARCH=${{parameters.arch}} ARCH=${{parameters.arch}}) | ||
envsubst < ./hack/manifests/windows-update.yaml | kubectl apply -f - | ||
fi | ||
name: "UploadCni" | ||
displayName: "Upload CNI" | ||
- task: AzureCLI@2 | ||
inputs: | ||
azureSubscription: $(AZURE_TEST_AGENT_SERVICE_CONNECTION) | ||
scriptLocation: "inlineScript" | ||
scriptType: "bash" | ||
addSpnToEnvironment: true | ||
inlineScript: | | ||
echo "Deleting cluster" | ||
make -C ./hack/aks azcfg AZCLI=az REGION=$(REGION_AKS_CLUSTER_TEST) | ||
make -C ./hack/aks down AZCLI=az REGION=$(REGION_AKS_CLUSTER_TEST) SUB=$(SUB_AZURE_NETWORK_AGENT_TEST) CLUSTER=${{ parameters.clusterName }}-$(make revision) | ||
echo "Cluster and resources down" | ||
name: "Cleanupcluster" | ||
displayName: "Cleanup cluster" | ||
condition: always() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: azure-cni | ||
namespace: kube-system | ||
labels: | ||
app: azure-cni | ||
spec: | ||
selector: | ||
matchLabels: | ||
k8s-app: azure-cni | ||
template: | ||
metadata: | ||
labels: | ||
k8s-app: azure-cni | ||
annotations: | ||
cluster-autoscaler.kubernetes.io/daemonset-pod: "true" | ||
spec: | ||
affinity: | ||
nodeAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
nodeSelectorTerms: | ||
- matchExpressions: | ||
- key: type | ||
operator: NotIn | ||
values: | ||
- virtual-kubelet | ||
- key: kubernetes.io/os | ||
operator: In | ||
values: | ||
- linux | ||
priorityClassName: system-node-critical | ||
tolerations: | ||
- key: CriticalAddonsOnly | ||
operator: Exists | ||
- operator: "Exists" | ||
effect: NoExecute | ||
- operator: "Exists" | ||
effect: NoSchedule | ||
initContainers: | ||
- name: azure-cni | ||
image: ${DROP_GZ_URL} | ||
imagePullPolicy: Always | ||
command: ["/dropgz"] | ||
args: | ||
- deploy | ||
- azure-vnet | ||
- -o | ||
- /opt/cni/bin/azure-vnet | ||
- azure-vnet-ipam | ||
- -o | ||
- /opt/cni/bin/azure-vnet-ipam | ||
- azure-vnet-telemetry | ||
- -o | ||
- /opt/cni/bin/azure-vnet-telemetry | ||
- azure.conflist | ||
- -o | ||
- /etc/cni/net.d/10-azure.conflist | ||
volumeMounts: | ||
- name: cni-bin | ||
mountPath: /opt/cni/bin | ||
- name: cni-conflist | ||
mountPath: /etc/cni/net.d | ||
containers: | ||
- name: pause | ||
image: mcr.microsoft.com/oss/kubernetes/pause:3.6 | ||
hostNetwork: true | ||
volumes: | ||
- name: cni-conflist | ||
hostPath: | ||
path: /etc/cni/net.d | ||
type: Directory | ||
- name: cni-bin | ||
hostPath: | ||
path: /opt/cni/bin | ||
type: Directory |