From bd1978e91c0c13700dd236cf45860afb2755b962 Mon Sep 17 00:00:00 2001 From: Adam Cattermole Date: Tue, 5 Nov 2024 10:08:43 +0000 Subject: [PATCH] Install sail-operator 0.1.0 (#944) * Re-enable sail integration test Add back fail-fast removal Signed-off-by: Adam Cattermole * Install sail-operator v0.1.0 Signed-off-by: Adam Cattermole * Istio installed using Sail operator added to integration tests (#954) Additionally, istio default intallation tool in dev environments now it is Sail Operator Signed-off-by: Eguzki Astiz Lezaun * Use sail as default for quickstart Signed-off-by: Adam Cattermole * Update quickstart sail installation Signed-off-by: Adam Cattermole * Add helm to development doc Signed-off-by: Adam Cattermole --------- Signed-off-by: Adam Cattermole Signed-off-by: Eguzki Astiz Lezaun Co-authored-by: Eguzki Astiz Lezaun --- .github/workflows/test.yaml | 15 ++++++++---- .../istio/sail/deployment_patch.yaml | 11 --------- config/dependencies/istio/sail/istio.yaml | 9 +++----- .../istio/sail/kustomization.yaml | 10 -------- doc/development.md | 6 +++-- hack/quickstart-setup.sh | 11 ++++++--- make/istio.mk | 23 +++++++++++-------- 7 files changed, 39 insertions(+), 46 deletions(-) delete mode 100644 config/dependencies/istio/sail/deployment_patch.yaml delete mode 100644 config/dependencies/istio/sail/kustomization.yaml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 6d1084c34..d4aa2d1e5 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -58,8 +58,8 @@ jobs: include: - gatewayapi-provider: istio istio-type: istioctl -# - gatewayapi-provider: istio -# istio-type: sail + - gatewayapi-provider: istio + istio-type: sail - gatewayapi-provider: envoygateway fail-fast: false runs-on: ubuntu-latest @@ -203,7 +203,12 @@ jobs: name: Integration Tests for kuadrant-operator/tests/[gatewayapi-provider] strategy: matrix: - gatewayapi-provider: [istio, envoygateway] + include: + - gatewayapi-provider: istio + istio-type: istioctl + - gatewayapi-provider: istio + istio-type: sail + - gatewayapi-provider: envoygateway fail-fast: false runs-on: ubuntu-latest env: @@ -230,9 +235,9 @@ jobs: - name: Check cluster info run: | kubectl cluster-info dump - - name: Run make ${{ matrix.gatewayapi-provider }}-env-setup + - name: Run make ${{ matrix.gatewayapi-provider }}-env-setup ISTIO_INSTALL_SAIL=${{ matrix.istio-type == 'sail' && true || false }} run: | - make ${{ matrix.gatewayapi-provider }}-env-setup + make ${{ matrix.gatewayapi-provider }}-env-setup ISTIO_INSTALL_SAIL=${{ matrix.istio-type == 'sail' && true || false }} - name: Run integration tests run: | make test-${{ matrix.gatewayapi-provider }}-env-integration diff --git a/config/dependencies/istio/sail/deployment_patch.yaml b/config/dependencies/istio/sail/deployment_patch.yaml deleted file mode 100644 index ea48c7e37..000000000 --- a/config/dependencies/istio/sail/deployment_patch.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: istio-operator -spec: - template: - spec: - containers: - - name: manager - # nightly build from commit b7f5286be0bc25cb257bc439e7c18acb99dce26f - image: quay.io/maistra-dev/istio-operator:3.0-nightly-2024-01-18 diff --git a/config/dependencies/istio/sail/istio.yaml b/config/dependencies/istio/sail/istio.yaml index afe4b4480..c5ccbd704 100644 --- a/config/dependencies/istio/sail/istio.yaml +++ b/config/dependencies/istio/sail/istio.yaml @@ -1,15 +1,12 @@ -apiVersion: operator.istio.io/v1alpha1 +apiVersion: sailoperator.io/v1alpha1 kind: Istio metadata: name: default spec: - version: v1.20.0 + # Supported values for sail-operator v0.1.0 are [v1.22.4,v1.23.0] + version: v1.23.0 namespace: istio-system # Disable autoscaling to reduce dev resources values: pilot: autoscaleEnabled: false - rawValues: - gateways: - istio-ingressgateway: - autoscaleEnabled: false diff --git a/config/dependencies/istio/sail/kustomization.yaml b/config/dependencies/istio/sail/kustomization.yaml deleted file mode 100644 index e642d7ff9..000000000 --- a/config/dependencies/istio/sail/kustomization.yaml +++ /dev/null @@ -1,10 +0,0 @@ ---- -namespace: istio-system -resources: -- github.com/maistra/istio-operator/config/default?ref=b7f5286be0bc25cb257bc439e7c18acb99dce26f -# commit sha from prior to removal of kustomize manifests -patches: -- path: deployment_patch.yaml - target: - kind: Deployment - name: istio-operator diff --git a/doc/development.md b/doc/development.md index 3d81f805c..cd25a95e1 100644 --- a/doc/development.md +++ b/doc/development.md @@ -8,6 +8,7 @@ * [go] version 1.22+ * [kubernetes] version v1.19+ * [kubectl] version v1.19+ +* [helm] ## Build @@ -253,8 +254,8 @@ Multiple controller integration tests are defined | --- | --- | --- | --- | | `github.com/kuadrant/kuadrant-operator/tests/bare_k8s` | no gateway provider, no GatewayAPI CRDs. Just Kuadrant API and Kuadrant dependencies. | `make local-k8s-env-setup` | `make test-bare-k8s-integration` | | `github.com/kuadrant/kuadrant-operator/tests/gatewayapi` | no gateway provider. GatewayAPI CRDs, Kuadrant API and Kuadrant dependencies. | `make local-gatewayapi-env-setup` | `make test-gatewayapi-env-integration` | -| `github.com/kuadrant/kuadrant-operator/controllers` | at least one gatewayapi provider. It can be any: istio, envoygateway, ... | `make local-env-setup GATEWAYAPI_PROVIDER=[istio \| envoygateway]` (Default *istio*) | `make test-integration GATEWAYAPI_PROVIDER=[istio \| envoygateway]` (Default *istio*) | -| `github.com/kuadrant/kuadrant-operator/tests/istio` | GatewayAPI CRDs, Istio, Kuadrant API and Kuadrant dependencies. | `make local-env-setup GATEWAYAPI_PROVIDER=istio` | `make test-istio-env-integration` | +| `github.com/kuadrant/kuadrant-operator/controllers` | at least one gatewayapi provider. It can be any: istio, envoygateway, ... | `make local-env-setup GATEWAYAPI_PROVIDER=[istio \| envoygateway] [ISTIO_INSTALL_SAIL=false]` (Default *istio*) | `make test-integration GATEWAYAPI_PROVIDER=[istio \| envoygateway]` (Default *istio*) | +| `github.com/kuadrant/kuadrant-operator/tests/istio` | GatewayAPI CRDs, Istio, Kuadrant API and Kuadrant dependencies. | `make local-env-setup GATEWAYAPI_PROVIDER=istio [ISTIO_INSTALL_SAIL=false]` | `make test-istio-env-integration` | | `github.com/kuadrant/kuadrant-operator/tests/envoygateway` | GatewayAPI CRDs, EnvoyGateway, Kuadrant API and Kuadrant dependencies. | `make local-env-setup GATEWAYAPI_PROVIDER=envoygateway` | `make test-envoygateway-env-integration` | ### Lint tests @@ -279,3 +280,4 @@ make uninstall [kind]:https://kind.sigs.k8s.io/ [kubernetes]:https://kubernetes.io/ [kubectl]:https://kubernetes.io/docs/tasks/tools/#kubectl +[helm]:https://helm.sh/ diff --git a/hack/quickstart-setup.sh b/hack/quickstart-setup.sh index b5cb7c969..ae936be97 100755 --- a/hack/quickstart-setup.sh +++ b/hack/quickstart-setup.sh @@ -60,7 +60,8 @@ if [ -z $MGC_REF ]; then fi if [ -z $ISTIO_INSTALL_SAIL ]; then - ISTIO_INSTALL_SAIL=${ISTIO_INSTALL_SAIL:=false} + ISTIO_INSTALL_SAIL=${ISTIO_INSTALL_SAIL:=true} + SAIL_VERSION=${SAIL_VERSION:="0.1.0"} fi export TOOLS_IMAGE=quay.io/kuadrant/mgc-tools:latest @@ -402,8 +403,12 @@ success "Gateway API installed successfully." info "Installing Istio as a Gateway API provider... 🛫" if [ "$ISTIO_INSTALL_SAIL" = true ]; then info "Installing Istio via Sail" - kubectl apply -k ${KUADRANT_ISTIO_KUSTOMIZATION} - kubectl -n istio-system wait --for=condition=Available deployment istio-operator --timeout=300s + ${HELM_BIN} install sail-operator \ + --create-namespace \ + --namespace istio-system \ + --wait \ + --timeout=300s \ + https://github.com/istio-ecosystem/sail-operator/releases/download/${SAIL_VERSION}/sail-operator-${SAIL_VERSION}.tgz kubectl apply -f ${KUADRANT_REPO_RAW}/config/dependencies/istio/sail/istio.yaml else # Create CRD first to prevent race condition with creating CR diff --git a/make/istio.mk b/make/istio.mk index 9a2dc63f4..48d8cc748 100644 --- a/make/istio.mk +++ b/make/istio.mk @@ -6,11 +6,11 @@ ISTIO_INSTALL_DIR = config/dependencies/istio ISTIO_NAMESPACE = istio-system ## installs project sail vs istioctl install -ISTIO_INSTALL_SAIL ?= false -ifeq (true,$(ISTIO_INSTALL_SAIL)) -INSTALL_COMMAND=sail-install -else +ISTIO_INSTALL_SAIL ?= true +ifeq (false,$(ISTIO_INSTALL_SAIL)) INSTALL_COMMAND=istioctl-install +else +INSTALL_COMMAND=sail-install endif # istioctl tool @@ -39,16 +39,21 @@ istioctl-uninstall: istioctl ## Uninstall istio. istioctl-verify-install: istioctl ## Verify istio installation. $(ISTIOCTL) verify-install -i $(ISTIO_NAMESPACE) +SAIL_VERSION = 0.1.0 .PHONY: sail-install -sail-install: kustomize - $(KUSTOMIZE) build $(ISTIO_INSTALL_DIR)/sail | kubectl apply -f - - kubectl -n $(ISTIO_NAMESPACE) wait --for=condition=Available deployment istio-operator --timeout=300s +sail-install: helm + $(HELM) install sail-operator \ + --create-namespace \ + --namespace $(ISTIO_NAMESPACE) \ + --wait \ + --timeout=300s \ + https://github.com/istio-ecosystem/sail-operator/releases/download/$(SAIL_VERSION)/sail-operator-$(SAIL_VERSION).tgz kubectl apply -f $(ISTIO_INSTALL_DIR)/sail/istio.yaml .PHONY: sail-uninstall -sail-uninstall: kustomize +sail-uninstall: helm kubectl delete -f $(ISTIO_INSTALL_DIR)/sail/istio.yaml - $(KUSTOMIZE) build $(ISTIO_INSTALL_DIR)/sail | kubectl delete -f - + $(HELM) uninstall sail-operator .PHONY: istio-install istio-install: