Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated cherry pick of #3700: Determine conformance container image version at runtime #3701: Use default dnsPolicy for AKS #3718

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 build/yamls/antrea-aks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4272,7 +4272,7 @@ spec:
- mountPath: /var/log/openvswitch
name: host-var-log-antrea
subPath: openvswitch
dnsPolicy: ClusterFirstWithHostNet
dnsPolicy: ClusterFirst
hostNetwork: true
initContainers:
- command:
Expand Down
8 changes: 8 additions & 0 deletions build/yamls/patches/aks/dnsPolicy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: antrea-agent
spec:
template:
spec:
dnsPolicy: ClusterFirst
11 changes: 5 additions & 6 deletions ci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ This directory includes all the scripts required to run CI on Antrea.
For information about our Jenkins CI jobs and how to run the same tests locally,
see [here](jenkins/README.md).

File [k8s-conformance-image-version](k8s-conformance-image-version) stores the
version number of the K8s conformance container image we currently use to run
tests.
For K8s conformance upstream tests, the version of the K8s conformance container
image will be determined at runtime according to the Kubernetes server's version.

## Antrea test suite

Expand Down Expand Up @@ -36,8 +35,8 @@ We run 4 different categories of tests as part of CI:
components can be deployed successfully, check end-to-end connectivity for
different types of traffic (e.g. Pod-to-Pod, Pod-to-Service), validate the
implementation of Antrea-speicifc APIs
(e.g. [ClusterNetworkPolicy](/docs/network-policy.md),
[Traceflow](/docs/traceflow-guide.md), ...).
(e.g. [ClusterNetworkPolicy](../docs/antrea-network-policy.md),
[Traceflow](../docs/traceflow-guide.md), ...).
* **Kubernetes upstream tests**: our CI relies on Kubernetes community tests to
ensure conformance and validate the implementation of the NetworkPolicy API.

Expand Down Expand Up @@ -78,7 +77,7 @@ You can run the linters locally with `make golangci` from the root of the
repository. Some issues can be fixed automatically for you if you run `make
golangci-fix`.

See our [golangci-lint configuration file](/.golangci.yml) for more details.
See our [golangci-lint configuration file](../.golangci.yml) for more details.

You can also run the `golint` linter with `make lint` to see suggestions about
how to improve your code, and we encourage you to do so when submitting a
Expand Down
1 change: 0 additions & 1 deletion ci/k8s-conformance-image-version

This file was deleted.

14 changes: 7 additions & 7 deletions ci/run-k8s-e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ DEFAULT_E2E_NETWORKPOLICY_FOCUS="\[Feature:NetworkPolicy\]"
DEFAULT_E2E_NETWORKPOLICY_SKIP=""
MODE="report"
THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
KUBE_CONFORMANCE_IMAGE=""
KUBE_CONFORMANCE_IMAGE_VERSION="$(head -n1 $THIS_DIR/k8s-conformance-image-version)"
KUBE_CONFORMANCE_IMAGE_OPTION=""
KUBE_CONFORMANCE_IMAGE_VERSION_OPTION=""
IMAGE_PULL_POLICY="Always"
CONFORMANCE_IMAGE_CONFIG_PATH="${THIS_DIR}/conformance-image-config.yaml"
SONOBUOY_IMAGE="projects.registry.vmware.com/sonobuoy/sonobuoy:v0.19.0"
SYSTEMD_LOGS_IMAGE="projects.registry.vmware.com/sonobuoy/systemd-logs:v0.3"
SONOBUOY_IMAGE="projects.registry.vmware.com/sonobuoy/sonobuoy:v0.56.4"
SYSTEMD_LOGS_IMAGE="projects.registry.vmware.com/sonobuoy/systemd-logs:v0.4"

_usage="Usage: $0 [--e2e-conformance] [--e2e-network-policy] [--e2e-focus <TestRegex>] [--e2e-skip <SkipRegex>]
[--kubeconfig <Kubeconfig>] [--kube-conformance-image-version <ConformanceImageVersion>]
Expand Down Expand Up @@ -91,7 +91,7 @@ case $key in
shift 2
;;
--kube-conformance-image-version)
KUBE_CONFORMANCE_IMAGE_VERSION="$2"
KUBE_CONFORMANCE_IMAGE_VERSION_OPTION="--kube-conformance-image-version $2"
shift 2
;;
--e2e-conformance)
Expand Down Expand Up @@ -172,14 +172,14 @@ function run_sonobuoy() {
$SONOBUOY run --wait \
$KUBECONFIG_OPTION \
$KUBE_CONFORMANCE_IMAGE_OPTION \
--kube-conformance-image-version $KUBE_CONFORMANCE_IMAGE_VERSION \
$KUBE_CONFORMANCE_IMAGE_VERSION_OPTION \
--mode "certified-conformance" --image-pull-policy ${IMAGE_PULL_POLICY} \
--sonobuoy-image ${SONOBUOY_IMAGE} --systemd-logs-image ${SYSTEMD_LOGS_IMAGE} --e2e-repo-config ${CONFORMANCE_IMAGE_CONFIG_PATH}
else
$SONOBUOY run --wait \
$KUBECONFIG_OPTION \
$KUBE_CONFORMANCE_IMAGE_OPTION \
--kube-conformance-image-version $KUBE_CONFORMANCE_IMAGE_VERSION \
$KUBE_CONFORMANCE_IMAGE_VERSION_OPTION \
--e2e-focus "$focus_regex" --e2e-skip "$skip_regex" --image-pull-policy ${IMAGE_PULL_POLICY} \
--sonobuoy-image ${SONOBUOY_IMAGE} --systemd-logs-image ${SYSTEMD_LOGS_IMAGE} --e2e-repo-config ${CONFORMANCE_IMAGE_CONFIG_PATH}
fi
Expand Down
2 changes: 1 addition & 1 deletion ci/test-conformance-aks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ RUN_CLEANUP_ONLY=false
KUBECONFIG_PATH="$HOME/jenkins/out/aks"
TEST_SCRIPT_RC=0
MODE="report"
KUBE_CONFORMANCE_IMAGE_VERSION=v1.19.4
KUBE_CONFORMANCE_IMAGE_VERSION=auto

_usage="Usage: $0 [--cluster-name <AKSClusterNameToUse>] [--kubeconfig <KubeconfigSavePath>] [--k8s-version <ClusterVersion>]\
[--azure-app-id <AppID>] [--azure-tenant-id <TenantID>] [--azure-password <Password>] \
Expand Down
2 changes: 1 addition & 1 deletion ci/test-conformance-eks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ RUN_CLEANUP_ONLY=false
KUBECONFIG_PATH="$HOME/jenkins/out/eks"
MODE="report"
TEST_SCRIPT_RC=0
KUBE_CONFORMANCE_IMAGE_VERSION=v1.18.5
KUBE_CONFORMANCE_IMAGE_VERSION=auto

_usage="Usage: $0 [--cluster-name <EKSClusterNameToUse>] [--kubeconfig <KubeconfigSavePath>] [--k8s-version <ClusterVersion>]\
[--aws-access-key <AccessKey>] [--aws-secret-key <SecretKey>] [--aws-region <Region>] [--ssh-key <SSHKey] \
Expand Down
2 changes: 1 addition & 1 deletion ci/test-conformance-gke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ RUN_ALL=true
RUN_SETUP_ONLY=false
RUN_CLEANUP_ONLY=false
TEST_SCRIPT_RC=0
KUBE_CONFORMANCE_IMAGE_VERSION=v1.18.5
KUBE_CONFORMANCE_IMAGE_VERSION=auto

_usage="Usage: $0 [--cluster-name <GKEClusterNameToUse>] [--kubeconfig <KubeconfigSavePath>] [--k8s-version <ClusterVersion>] \
[--svc-account <Name>] [--user <Name>] [--gke-project <Project>] [--gke-zone <Zone>] [--log-mode <SonobuoyResultLogLevel>] \
Expand Down
2 changes: 1 addition & 1 deletion ci/verify-sonobuoy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

_SONOBUOY_BINDIR="/tmp/antrea"
_SONOBUOY_TARBALL="/tmp/sonobuoy.tar.gz"
_MIN_SONOBUOY_VERSION="v0.19.0"
_MIN_SONOBUOY_VERSION="v0.56.4"

install_sonobuoy() {
local ostype=""
Expand Down
10 changes: 10 additions & 0 deletions hack/generate-manifest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,16 @@ if [[ $ENCAP_MODE == "networkPolicyOnly" ]] ; then
cd ..
fi

if [[ $CLOUD == "AKS" ]]; then
mkdir aks && cd aks
cp ../../patches/aks/*.yml .
touch kustomization.yml
$KUSTOMIZE edit add base $BASE
$KUSTOMIZE edit add patch --path dnsPolicy.yml
BASE=../aks
cd ..
fi

if [[ $CLOUD == "GKE" ]]; then
mkdir gke && cd gke
cp ../../patches/gke/*.yml .
Expand Down