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

e2e: Use helm to deploy on k8s cluster #704

Merged
merged 2 commits into from
Jun 28, 2024
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
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,12 @@ skopeo:
fakechroot:
if ! which fakechroot; then if [ -f /etc/redhat-release ]; then dnf -y install fakechroot; elif [ -f /etc/lsb-release ]; then sudo apt-get -y update; sudo apt-get -y install fakechroot; fi; fi

$(BIN_DIR)/helm helm:
mkdir -p $(BIN_DIR)
curl -fsSL -o $(BIN_DIR)/get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 $(BIN_DIR)/get_helm.sh
HELM_INSTALL_DIR=$(BIN_DIR) $(BIN_DIR)/get_helm.sh
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WDYT about moving the logic from above get_helm.sh here and deleting the get_helm.sh file at the end.
so we remain just with helm binary ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Cleaning

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ideally we should have a $(BIN_DIR) target which creates bin directroy then have this target depend on it.

same goes for other targets that download/install bin dependencies

that said its not related to this PR


deploy-setup: export ADMISSION_CONTROLLERS_ENABLED?=false
deploy-setup: skopeo install
hack/deploy-setup.sh $(NAMESPACE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ spec:
- name: METRICS_EXPORTER_SECRET_NAME
value: {{ .Values.operator.admissionControllers.certificates.secretNames.metricsExporter }}
- name: METRICS_EXPORTER_PORT
value: {{ .Values.operator.metricsExporter.port }}
value: "{{ .Values.operator.metricsExporter.port }}"
- name: METRICS_EXPORTER_SECRET_NAME
value: {{ .Values.operator.metricsExporter.certificates.secretName }}
- name: METRICS_EXPORTER_KUBE_RBAC_PROXY_IMAGE
Expand Down
30 changes: 20 additions & 10 deletions hack/run-e2e-conformance-virtual-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -365,19 +365,35 @@ do
done


source hack/env.sh

export ADMISSION_CONTROLLERS_ENABLED=true
export ADMISSION_CONTROLLERS_CERTIFICATES_CERT_MANAGER_ENABLED=true
export SKIP_VAR_SET=""
export NAMESPACE="sriov-network-operator"
export OPERATOR_NAMESPACE="sriov-network-operator"
export CNI_BIN_PATH=/opt/cni/bin
export OPERATOR_EXEC=kubectl
export CLUSTER_TYPE=kubernetes
export DEV_MODE=TRUE
export CLUSTER_HAS_EMULATED_PF=TRUE

echo "## deploy namespace"
envsubst< $root/deploy/namespace.yaml | ${OPERATOR_EXEC} apply -f -

HELM_VALUES_OPTS="\
--set images.operator=${SRIOV_NETWORK_OPERATOR_IMAGE} \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm ci falling.

maybe need to quote the images ? have a feeling its something with helm templating.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We actually caught a regression introduced by

this is already paying back its effort

--set images.sriovConfigDaemon=${SRIOV_NETWORK_CONFIG_DAEMON_IMAGE} \
--set images.sriovCni=${SRIOV_CNI_IMAGE} \
--set images.sriovDevicePlugin=${SRIOV_DEVICE_PLUGIN_IMAGE} \
--set images.resourcesInjector=${NETWORK_RESOURCES_INJECTOR_IMAGE} \
--set images.webhook=${SRIOV_NETWORK_WEBHOOK_IMAGE} \
--set operator.admissionControllers.enabled=${ADMISSION_CONTROLLERS_ENABLED} \
--set operator.admissionControllers.certificates.certManager.enabled=${ADMISSION_CONTROLLERS_CERTIFICATES_CERT_MANAGER_ENABLED} \
--set sriovOperatorConfig.deploy=true"

PATH=$PATH:${root}/bin
make helm
helm install -n ${NAMESPACE} --create-namespace \
$HELM_VALUES_OPTS \
--wait sriov-network-operator ./deployment/sriov-network-operator-chart


echo "## create certificates for webhook"
cat <<EOF | kubectl apply -f -
Expand Down Expand Up @@ -437,12 +453,6 @@ spec:
EOF


echo "## apply CRDs"
kubectl apply -k $root/config/crd

echo "## deploying SRIOV Network Operator"
hack/deploy-setup.sh $NAMESPACE

function cluster_info {
if [[ -v TEST_REPORT_PATH ]]; then
kubectl cluster-info dump --namespaces ${NAMESPACE},${MULTUS_NAMESPACE} --output-directory "${root}/${TEST_REPORT_PATH}/cluster-info"
Expand Down
Loading