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

[release-1.6] 🌱 CI: replace metal3 ipam by CAPI in-cluster provider #2386

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
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