-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Eguzki Astiz Lezaun <[email protected]>
- Loading branch information
Showing
1 changed file
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
--- | ||
name: Kuadrant Upgrade Test | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
kuadrantStartVersion: | ||
description: Kuadrant start version | ||
required: true | ||
type: string | ||
kuadrantUpgradeVersion: | ||
description: Kuadrant upgrade version | ||
required: true | ||
type: string | ||
clusterServer: | ||
description: Cluster server URL | ||
required: false | ||
type: string | ||
clusterToken: | ||
description: Cluster Server Bearer Token | ||
required: false | ||
type: string | ||
kuadrantNamespace: | ||
description: Namespace where Kuadrant is installed | ||
required: false | ||
default: kuadrant-system | ||
type: string | ||
jobs: | ||
helm-charts-upgrade-test: | ||
runs-on: ubuntu-latest | ||
name: Helm Charts Upgrade Test | ||
if: ${{ github.event_name == 'workflow_dispatch' }} | ||
env: | ||
KIND_CLUSTER_NAME: kuadrant-test | ||
K8S_USER: kuadrant-admin # can be whatever, it does not matter. | ||
CLUSTER_NAME: remote-cluster | ||
KUADRANT_START_VERSION: v${{ inputs.kuadrantStartVersion }} | ||
KUADRANT_UPGRADE_VERSION: v${{ inputs.kuadrantUpgradeVersion }} | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ env.KUADRANT_UPGRADE_VERSION }} | ||
- name: Deploy local Kind cluster | ||
if: ${{ github.event_name == 'workflow_dispatch' && inputs.clusterServer == '' }} | ||
uses: helm/[email protected] | ||
with: | ||
version: v0.23.0 | ||
config: utils/kind-cluster.yaml | ||
cluster_name: ${{ env.KIND_CLUSTER_NAME }} | ||
wait: 120s | ||
- name: Install kubectl for remote cluster | ||
if: ${{ github.event_name == 'workflow_dispatch' && inputs.clusterServer != '' }} | ||
uses: azure/setup-kubectl@v4 | ||
with: | ||
version: v1.25.3 | ||
- name: Mask cluster token | ||
if: ${{ github.event_name == 'workflow_dispatch' && inputs.clusterToken != '' }} | ||
run: | | ||
CLUSTER_TOKEN=$(jq -r '.inputs.clusterToken' $GITHUB_EVENT_PATH) | ||
echo ::add-mask::$CLUSTER_TOKEN | ||
echo CLUSTER_TOKEN=$CLUSTER_TOKEN >> $GITHUB_ENV | ||
- name: Setup kubectl for remote cluster | ||
if: ${{ github.event_name == 'workflow_dispatch' && inputs.clusterServer != '' }} | ||
run: | | ||
kubectl config set-credentials ${{ env.K8S_USER }}/${{ env.CLUSTER_NAME }} --token ${{ env.CLUSTER_TOKEN }} | ||
kubectl config set-cluster ${{ env.CLUSTER_NAME }} --insecure-skip-tls-verify=true --server=${{ inputs.clusterServer }} | ||
kubectl config set-context ${{ inputs.kuadrantNamespace }}/${{ env.CLUSTER_NAME }}/${{ env.K8S_USER }} --user=${{ env.K8S_USER }}/${{ env.CLUSTER_NAME }} --namespace=${{ inputs.kuadrantNamespace }} --cluster=${{ env.CLUSTER_NAME }} | ||
kubectl config use-context ${{ inputs.kuadrantNamespace }}/${{ env.CLUSTER_NAME }}/${{ env.K8S_USER }} | ||
## makes sure cluster is up and running | ||
- run: | | ||
kubectl cluster-info | ||
kubectl get nodes | ||
- name: Deploy pre-requisites on local Kind cluster | ||
if: ${{ github.event_name == 'workflow_dispatch' && inputs.clusterServer == '' }} | ||
run: | | ||
make install-metallb | ||
make install-cert-manager | ||
make envoy-gateway-install | ||
make deploy-eg-gateway | ||
- name: Install helm and add Kuadrant repo | ||
run: | | ||
make helm | ||
bin/helm repo add kuadrant https://kuadrant.io/helm-charts/ --force-update | ||
bin/helm search repo kuadrant | ||
- name: Install starting version of Kuadrant | ||
run: | | ||
helm install kuadrant kuadrant/kuadrant-operator \ | ||
--wait \ | ||
--timeout 2m0s \ | ||
--version ${{ inputs.kuadrantStartVersion }} \ | ||
--namespace ${{ inputs.kuadrantNamespace }} \ | ||
--create-namespace |