Skip to content

Commit

Permalink
Use default dnsPolicy for AKS
Browse files Browse the repository at this point in the history
AKS overrides KUBERNETES_SERVICE_HOST with a FQDN value. Using
ClusterFirstWithHostNet would lead to antrea-agent start failure.

Signed-off-by: Quan Tian <qtian@vmware.com>
  • Loading branch information
tnqn committed Apr 29, 2022
1 parent 888fe53 commit 7fd921f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
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
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

0 comments on commit 7fd921f

Please sign in to comment.