Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

Commit

Permalink
Bump servleress-operator to v1.5.0 and remove istio (#412)
Browse files Browse the repository at this point in the history
This patch contains following changes:
- to remove istio related resources
- to bump servleress-operator to v1.5.0
  • Loading branch information
nak3 authored Mar 10, 2020
1 parent 8019c17 commit a6e4b7f
Show file tree
Hide file tree
Showing 7 changed files with 2,679 additions and 138 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

CGO_ENABLED=0
GOOS=linux
CORE_IMAGES=./cmd/activator ./cmd/autoscaler ./cmd/autoscaler-hpa ./cmd/controller ./cmd/queue ./cmd/webhook ./cmd/networking/istio ./cmd/networking/certmanager ./cmd/networking/nscert
CORE_IMAGES=./cmd/activator ./cmd/autoscaler ./cmd/autoscaler-hpa ./cmd/controller ./cmd/queue ./cmd/webhook ./cmd/networking/certmanager ./cmd/networking/nscert
TEST_IMAGES=$(shell find ./test/test_images -mindepth 1 -maxdepth 1 -type d)

install:
Expand Down
6 changes: 0 additions & 6 deletions openshift/ci-operator/knative-images/istio/Dockerfile

This file was deleted.

26 changes: 15 additions & 11 deletions openshift/e2e-tests-openshift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ source "$(dirname "$0")/release/resolve.sh"
set -x

readonly SERVING_NAMESPACE=knative-serving
readonly SERVICEMESH_NAMESPACE=knative-serving-ingress
readonly SERVING_INGRESS_NAMESPACE=knative-serving-ingress

# A golang template to point the tests to the right image coordinates.
# {{.Name}} is the name of the image, for example 'autoscale'.
Expand Down Expand Up @@ -92,8 +92,10 @@ function install_knative(){
export IMAGE_autoscaler=${IMAGE_FORMAT//\$\{component\}/knative-serving-autoscaler}
export IMAGE_autoscaler_hpa=${IMAGE_FORMAT//\$\{component\}/knative-serving-autoscaler-hpa}
export IMAGE_controller=${IMAGE_FORMAT//\$\{component\}/knative-serving-controller}
export IMAGE_networking_istio=${IMAGE_FORMAT//\$\{component\}/knative-serving-istio}
export IMAGE_webhook=${IMAGE_FORMAT//\$\{component\}/knative-serving-webhook}
# Kourier is not built in this project.
# export IMAGE_kourier=${IMAGE_FORMAT//\$\{component\}/kourier}
export IMAGE_kourier="quay.io/3scale/kourier:v0.3.11"
envsubst < openshift/olm/knative-serving.catalogsource.yaml | oc apply -n $OLM_NAMESPACE -f -
timeout 900 '[[ $(oc get pods -n $OLM_NAMESPACE | grep -c serverless) -eq 0 ]]' || return 1
wait_until_pods_running $OLM_NAMESPACE
Expand All @@ -106,7 +108,7 @@ function install_knative(){

# Install Knative Serving
cat <<-EOF | oc apply -f -
apiVersion: serving.knative.dev/v1alpha1
apiVersion: operator.knative.dev/v1alpha1
kind: KnativeServing
metadata:
name: knative-serving
Expand All @@ -117,8 +119,8 @@ EOF
timeout 900 '[[ $(oc get pods -n $SERVING_NAMESPACE --no-headers | wc -l) -lt 4 ]]' || return 1
wait_until_pods_running $SERVING_NAMESPACE || return 1

wait_until_service_has_external_ip $SERVICEMESH_NAMESPACE istio-ingressgateway || fail_test "Ingress has no external IP"
wait_until_hostname_resolves "$(kubectl get svc -n $SERVICEMESH_NAMESPACE istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].hostname}')"
wait_until_service_has_external_ip $SERVING_INGRESS_NAMESPACE kourier || fail_test "Ingress has no external IP"
wait_until_hostname_resolves "$(kubectl get svc -n $SERVING_INGRESS_NAMESPACE kourier -o jsonpath='{.status.loadBalancer.ingress[0].hostname}')"

header "Knative Installed successfully"
}
Expand All @@ -128,6 +130,9 @@ function deploy_serverless_operator(){
local operator_ns
operator_ns=$(kubectl get og --all-namespaces | grep global-operators | awk '{print $1}')

# Create configmap to use the latest manifest.
oc create configmap ko-data -n $operator_ns --from-file="openshift/release/knative-serving-ci.yaml"

cat <<-EOF | oc apply -f -
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
Expand All @@ -144,8 +149,6 @@ EOF

function run_e2e_tests(){
echo ">> Creating test resources for OpenShift (test/config/)"
# Removing unneeded test resources.
rm test/config/100-istio-default-domain.yaml
oc apply -f test/config

oc adm policy add-scc-to-user privileged -z default -n serving-tests
Expand All @@ -156,8 +159,9 @@ function run_e2e_tests(){
header "Running tests"
failed=0

# Needed because tests assume that istio is found in "istio-system"
export GATEWAY_NAMESPACE_OVERRIDE="$SERVICEMESH_NAMESPACE"
export GATEWAY_OVERRIDE=kourier
export GATEWAY_NAMESPACE_OVERRIDE="$SERVING_INGRESS_NAMESPACE"
export INGRESS_CLASS=kourier.ingress.networking.knative.dev

report_go_test \
-v -tags=e2e -count=1 -timeout=35m -short -parallel=3 \
Expand All @@ -171,14 +175,14 @@ function run_e2e_tests(){
./test/conformance/runtime/... \
--kubeconfig "$KUBECONFIG" \
--imagetemplate "$TEST_IMAGE_TEMPLATE" \
--resolvabledomain || failed=1
--resolvabledomain "$(ingress_class)" || failed=1

report_go_test \
-v -tags=e2e -count=1 -timeout=35m -parallel=3 \
./test/conformance/api/... \
--kubeconfig "$KUBECONFIG" \
--imagetemplate "$TEST_IMAGE_TEMPLATE" \
--resolvabledomain || failed=1
--resolvabledomain "$(ingress_class)" || failed=1

return $failed
}
Expand Down
29 changes: 29 additions & 0 deletions openshift/olm/config_map.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
diff --git a/openshift/olm/knative-serving.catalogsource.yaml b/openshift/olm/knative-serving.catalogsource.yaml
index 5af9e00a2..a9da99ee1 100644
--- a/openshift/olm/knative-serving.catalogsource.yaml
+++ b/openshift/olm/knative-serving.catalogsource.yaml
@@ -2771,12 +2771,24 @@ data:
fieldPath: metadata.namespace
- name: METRICS_DOMAIN
value: knative.dev/serving-operator
+ - name: KO_DATA_PATH
+ value: /tmp/
image: registry.svc.ci.openshift.org/openshift/knative-v0.12.1:knative-serving-operator
imagePullPolicy: IfNotPresent
name: knative-serving-operator
ports:
- containerPort: 9090
name: metrics
+ volumeMounts:
+ - mountPath: /tmp/knative-serving
+ name: release-manifest
+ volumes:
+ - name: release-manifest
+ configMap:
+ name: ko-data
+ items:
+ - key: knative-serving-ci.yaml
+ path: knative-serving-ci.yaml
serviceAccountName: knative-serving-operator
- name: knative-serving-openshift
spec:
23 changes: 23 additions & 0 deletions openshift/olm/generate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash

# NOTE:
# The initial knative-serving.catalogsource.yaml is generaed by catalog.sh in serverless-operator.
# So you need to run following command before running this script.
#
# git clone https://github.com/openshift-knative/serverless-operator.git
# cd serverless-operator && bash hack/catalog.sh > $OUTFILE

set -e

VERSION="v0.12.1"
OUTFILE="knative-serving.catalogsource.yaml"

sed -i -e "s|registry.svc.ci.openshift.org/openshift/knative-$VERSION:knative-serving-queue|$\{IMAGE_QUEUE\}|g" $OUTFILE
sed -i -e "s|registry.svc.ci.openshift.org/openshift/knative-$VERSION:knative-serving-activator|$\{IMAGE_activator\}|g" $OUTFILE
sed -i -e "s|registry.svc.ci.openshift.org/openshift/knative-$VERSION:knative-serving-autoscaler|$\{IMAGE_autoscaler\}|g" $OUTFILE
sed -i -e "s|registry.svc.ci.openshift.org/openshift/knative-$VERSION:knative-serving-autoscaler-hpa|$\{IMAGE_autoscaler_hpa\}|g" $OUTFILE
sed -i -e "s|registry.svc.ci.openshift.org/openshift/knative-$VERSION:knative-serving-controller|$\{IMAGE_controller\}|g" $OUTFILE
sed -i -e "s|registry.svc.ci.openshift.org/openshift/knative-$VERSION:knative-serving-webhook|$\{IMAGE_webhook\}|g" $OUTFILE
sed -i -e "s|registry.svc.ci.openshift.org/openshift/knative-$VERSION:kourier|$\{IMAGE_kourier\}|g" $OUTFILE

git apply config_map.patch
Loading

0 comments on commit a6e4b7f

Please sign in to comment.