diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3ae1fda..18b953f 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -123,6 +123,11 @@ jobs: fi test-knative: + strategy: + matrix: + knative_version: + - v0.24.0 + - v1.0.0 runs-on: ubuntu-latest steps: - name: Checkout @@ -131,9 +136,9 @@ jobs: - name: Create kind cluster uses: ./ with: - knative_serving: v0.24.0 - knative_kourier: v0.24.0 - knative_eventing: v0.24.0 + knative_serving: "${{ matrix.knative_version }}" + knative_kourier: "${{ matrix.knative_version }}" + knative_eventing: "${{ matrix.knative_version }}" - name: Test run: | diff --git a/README.md b/README.md index f263c5d..2bef296 100644 --- a/README.md +++ b/README.md @@ -25,9 +25,9 @@ For more information on inputs, see the [API Documentation](https://developer.gi - `log_level`: The log level for KinD - `registry`: Configures an insecure registry on `kind-registry:5000` to be used with KinD (default: `true`) - `kubectl_version`: The kubectl version to use (default: `v1.21.1`) -- `knative_serving`: The version of Knative Serving to install on the Kind cluster (not installed by default - example: `v0.24.0`) -- `knative_kourier`: The version of Knative Net Kourier to install on the Kind cluster (not installed by default - example: `v0.24.0`) -- `knative_eventing`: The version of Knative Eventing to install on the Kind cluster (not installed by default - example: `v0.24.0`) +- `knative_serving`: The version of Knative Serving to install on the Kind cluster (not installed by default - example: `v1.0.0`) +- `knative_kourier`: The version of Knative Net Kourier to install on the Kind cluster (not installed by default - example: `v1.0.0`) +- `knative_eventing`: The version of Knative Eventing to install on the Kind cluster (not installed by default - example: `v1.0.0`) ### Example Workflow @@ -67,9 +67,9 @@ jobs: - name: Kubernetes KinD Cluster uses: container-tools/kind-action@v1 with: - knative_serving: v0.24.0 - knative_kourier: v0.24.0 - knative_eventing: v0.24.0 + knative_serving: v1.0.0 + knative_kourier: v1.0.0 + knative_eventing: v1.0.0 ``` This will install Knative Serving, Eventing and a Kourier Ingress on your Kind cluster. To make Knative run on Kind, resource request and limits are removed from the original Knative descriptors. diff --git a/action.yml b/action.yml index 3698ae2..a32415b 100644 --- a/action.yml +++ b/action.yml @@ -22,11 +22,11 @@ inputs: kubectl_version: description: "The version of kubectl to use (default: v1.20.0)" knative_serving: - description: "The version of Knative Serving to install on the Kind cluster (not installed by default - example: v0.24.0)" + description: "The version of Knative Serving to install on the Kind cluster (not installed by default - example: v1.0.0)" knative_kourier: - description: "The version of Knative Net Kourier to install on the Kind cluster (not installed by default - example: v0.24.0)" + description: "The version of Knative Net Kourier to install on the Kind cluster (not installed by default - example: v1.0.0)" knative_eventing: - description: "The version of Knative Eventing to install on the Kind cluster (not installed by default - example: v0.24.0)" + description: "The version of Knative Eventing to install on the Kind cluster (not installed by default - example: v1.0.0)" runs: using: "node12" main: "main.js" diff --git a/knative.sh b/knative.sh index 98c04a6..478bd93 100755 --- a/knative.sh +++ b/knative.sh @@ -111,10 +111,14 @@ install_prerequisites() { install_serving() { # TODO find alternative to sleep echo "Installing Knative Serving $serving_version..." - kubectl apply --filename https://github.com/knative/serving/releases/download/$serving_version/serving-crds.yaml + base=https://github.com/knative/serving/releases/download/$serving_version + if [[ $serving_version = v1* ]]; then + base=https://github.com/knative/serving/releases/download/knative-$serving_version + fi + kubectl apply --filename $base/serving-crds.yaml echo "Waiting for resources to be initialized..." sleep 5 - curl -L -s https://github.com/knative/serving/releases/download/$serving_version/serving-core.yaml | yq 'del(.spec.template.spec.containers[]?.resources)' -y | yq 'del(.metadata.annotations."knative.dev/example-checksum")' -y | kubectl apply -f - + curl -L -s $base/serving-core.yaml | yq 'del(.spec.template.spec.containers[]?.resources)' -y | yq 'del(.metadata.annotations."knative.dev/example-checksum")' -y | kubectl apply -f - echo "Waiting for resources to be initialized..." sleep 60 kubectl get pod -n knative-serving @@ -123,7 +127,11 @@ install_serving() { install_kourier() { # TODO find alternative to sleep echo "Installing Knative Net Kourier $kourier_version..." - kubectl apply --filename https://github.com/knative-sandbox/net-kourier/releases/download/$kourier_version/kourier.yaml + base=https://github.com/knative-sandbox/net-kourier/releases/download/$kourier_version + if [[ $serving_version = v1* ]]; then + base=https://github.com/knative-sandbox/net-kourier/releases/download/knative-$kourier_version + fi + kubectl apply --filename $base/kourier.yaml kubectl patch configmap/config-network \ --namespace knative-serving \ --type merge \ @@ -136,20 +144,24 @@ install_kourier() { install_eventing() { # TODO find alternative to sleep echo "Installing Knative Eventing $eventing_version..." - kubectl apply --filename https://github.com/knative/eventing/releases/download/$eventing_version/eventing-crds.yaml + base=https://github.com/knative/eventing/releases/download/$eventing_version + if [[ $serving_version = v1* ]]; then + base=https://github.com/knative/eventing/releases/download/knative-$eventing_version + fi + kubectl apply --filename $base/eventing-crds.yaml echo "Waiting for resources to be initialized..." sleep 5 - curl -L -s https://github.com/knative/eventing/releases/download/$eventing_version/eventing-core.yaml | yq 'del(.spec.template.spec.containers[]?.resources)' -y | yq 'del(.metadata.annotations."knative.dev/example-checksum")' -y | kubectl apply -f - + curl -L -s $base/eventing-core.yaml | yq 'del(.spec.template.spec.containers[]?.resources)' -y | yq 'del(.metadata.annotations."knative.dev/example-checksum")' -y | kubectl apply -f - # Eventing channels set +e - curl -L -s https://github.com/knative/eventing/releases/download/$eventing_version/in-memory-channel.yaml | yq 'del(.spec.template.spec.containers[]?.resources)' -y | yq 'del(.metadata.annotations."knative.dev/example-checksum")' -y | kubectl apply -f - + curl -L -s $base/in-memory-channel.yaml | yq 'del(.spec.template.spec.containers[]?.resources)' -y | yq 'del(.metadata.annotations."knative.dev/example-checksum")' -y | kubectl apply -f - if [ $? -ne 0 ]; then set -e - curl -L -s https://github.com/knative/eventing/releases/download/$eventing_version/in-memory-channel.yaml | kubectl apply -f - + curl -L -s $base/in-memory-channel.yaml | kubectl apply -f - fi set -e # Eventing broker - curl -L -s https://github.com/knative/eventing/releases/download/$eventing_version/mt-channel-broker.yaml | yq 'del(.spec.template.spec.containers[]?.resources)' -y | yq 'del(.metadata.annotations."knative.dev/example-checksum")' -y | kubectl apply -f - + curl -L -s $base/mt-channel-broker.yaml | yq 'del(.spec.template.spec.containers[]?.resources)' -y | yq 'del(.metadata.annotations."knative.dev/example-checksum")' -y | kubectl apply -f - echo "Waiting for resources to be initialized..." sleep 30 kubectl get pod -n knative-eventing