Skip to content

Commit

Permalink
Fix windows cni-plugin fv to use correct apiserver port number (#8955)
Browse files Browse the repository at this point in the history
  • Loading branch information
song-jiang authored Jun 28, 2024
1 parent 122aca9 commit e592387
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion process/testing/winfv-cni-plugin/aso/config-minikube
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
clusters:
- cluster:
certificate-authority: c:\k\minikube\ca.crt
server: https://{{.Env.LINUX_PIP}}:32769
server: https://{{.Env.LINUX_PIP}}:{{.Env.APISERVER_PORT}}
name: minikube
contexts:
- context:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@ set -x

LINUX_PIP=$1

curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
curl -LO https://github.com/kubernetes/minikube/releases/download/v1.33.0/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube && rm minikube-linux-amd64

minikube start --listen-address=0.0.0.0 --apiserver-ips=$LINUX_PIP

docker port minikube | grep 8443
PORT_INFO=$(docker port minikube | grep 8443)

port=$(echo $PORT_INFO | grep -oE '[0-9]{5}' | tail -1)
echo "apiserver listening at port $port"
echo $port > $HOME/port_info
5 changes: 3 additions & 2 deletions process/testing/winfv-cni-plugin/aso/run-fv-cni-plugin.ps1
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
Param(
[parameter(Mandatory = $true)] $Backend,
[parameter(Mandatory = $false)] $LinuxPIP="{{.Env.LINUX_PIP}}"
[parameter(Mandatory = $false)] $LinuxPIP="{{.Env.LINUX_PIP}}",
[parameter(Mandatory = $false)] $LinuxAPIServerPort="{{.Env.APISERVER_PORT}}"
)

#Setting up Environment Variable
Set-Item -Path env:KUBECONFIG -Value "C:\\k\\config"
Set-Item -Path env:KUBERNETES_MASTER -Value "https://${LinuxPIP}:32769"
Set-Item -Path env:KUBERNETES_MASTER -Value "https://${LinuxPIP}:${LinuxAPIServerPort}"
Set-Item -Path env:ETCD_ENDPOINTS -Value "http://${LinuxPIP}:2389"
Set-Item -Path env:BIN -Value "C:\\k"
Set-Item -Path env:PLUGIN -Value "calico"
Expand Down
3 changes: 3 additions & 0 deletions process/testing/winfv-cni-plugin/aso/setup-fv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ function setup_minikube_cluster() {
${MASTER_CONNECT_COMMAND} sudo chmod +x /home/winfv/create-minikube-cluster.sh
${MASTER_CONNECT_COMMAND} bash /home/winfv/create-minikube-cluster.sh ${LINUX_PIP}

APISERVER_PORT=$(${MASTER_CONNECT_COMMAND} cat /home/winfv/port_info)
export APISERVER_PORT

#create etcd manually with http protocol
LOCAL_IP_ENV=${LINUX_PIP}
ETCD_CONTAINER=quay.io/coreos/etcd:v3.4.6
Expand Down

0 comments on commit e592387

Please sign in to comment.