Skip to content

Commit

Permalink
Merge pull request #2388 from k8s-infra-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…2382-to-release-1.8

[release-1.8] 🌱 CI: replace metal3 ipam by CAPI in-cluster provider
  • Loading branch information
k8s-ci-robot authored Sep 25, 2023
2 parents 4134f1a + e8904f3 commit 8056f75
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
10 changes: 5 additions & 5 deletions hack/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ source "${REPO_ROOT}/hack/ensure-kubectl.sh"
on_exit() {
# release IPClaim
echo "Releasing IP claims"
kubectl --kubeconfig="${KUBECONFIG}" delete "ipclaim.ipam.metal3.io" "${CONTROL_PLANE_IPCLAIM_NAME}" || true
kubectl --kubeconfig="${KUBECONFIG}" delete "ipclaim.ipam.metal3.io" "${WORKLOAD_IPCLAIM_NAME}" || true
kubectl --kubeconfig="${KUBECONFIG}" delete "ipaddressclaim.ipam.cluster.x-k8s.io" "${CONTROL_PLANE_IPCLAIM_NAME}" || true
kubectl --kubeconfig="${KUBECONFIG}" delete "ipaddressclaim.ipam.cluster.x-k8s.io" "${WORKLOAD_IPCLAIM_NAME}" || true

# kill the VPN
docker kill vpn
Expand Down Expand Up @@ -80,7 +80,7 @@ function kubectl_get_jsonpath() {
local JSON_PATH="${3}"
local n=0
until [ $n -ge 30 ]; do
OUTPUT=$(kubectl --kubeconfig="${KUBECONFIG}" get "${OBJECT_KIND}.ipam.metal3.io" "${OBJECT_NAME}" -o=jsonpath="${JSON_PATH}")
OUTPUT=$(kubectl --kubeconfig="${KUBECONFIG}" get "${OBJECT_KIND}.ipam.cluster.x-k8s.io" "${OBJECT_NAME}" -o=jsonpath="${JSON_PATH}")
if [[ "${OUTPUT}" != "" ]]; then
break
fi
Expand All @@ -101,8 +101,8 @@ function claim_ip() {
IPCLAIM_NAME="$1"
export IPCLAIM_NAME
envsubst < "${REPO_ROOT}/hack/ipclaim-template.yaml" | kubectl --kubeconfig="${KUBECONFIG}" create -f - 1>&2
IPADDRESS_NAME=$(kubectl_get_jsonpath ipclaim "${IPCLAIM_NAME}" '{@.status.address.name}')
kubectl --kubeconfig="${KUBECONFIG}" get "ipaddresses.ipam.metal3.io" "${IPADDRESS_NAME}" -o=jsonpath='{@.spec.address}'
IPADDRESS_NAME=$(kubectl_get_jsonpath ipaddressclaim "${IPCLAIM_NAME}" '{@.status.addressRef.name}')
kubectl --kubeconfig="${KUBECONFIG}" get "ipaddresses.ipam.cluster.x-k8s.io" "${IPADDRESS_NAME}" -o=jsonpath='{@.spec.address}'
}

export KUBECONFIG="/root/ipam-conf/capv-services.conf"
Expand Down
8 changes: 5 additions & 3 deletions hack/ipclaim-template.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
apiVersion: ipam.metal3.io/v1alpha1
kind: IPClaim
apiVersion: ipam.cluster.x-k8s.io/v1alpha1
kind: IPAddressClaim
metadata:
name: ${IPCLAIM_NAME}
annotations:
prow.k8s.io/build-id: "${BUILD_ID}"
prow.k8s.io/job: "${JOB_NAME}"
spec:
pool:
poolRef:
apiGroup: ipam.cluster.x-k8s.io
kind: InClusterIPPool
name: capv-e2e-ippool

0 comments on commit 8056f75

Please sign in to comment.