google / knative-gcp

GCP event implementations to use with Knative Eventing.
https://github.com/knative/eventing
Apache License 2.0
160 stars 74 forks source link

Unable to Run init_control_plane_gke.sh #2164

Closed rileyhun closed 3 years ago

rileyhun commented 3 years ago

Describe the bug I get the following error

Error from server (NotFound): namespaces "cloud-run-events" not found
Error from server (NotFound): serviceaccounts "controller" not found

I think it's failing at this part of the script

+ kubectl annotate --overwrite serviceaccount controller iam.gke.io/gcp-service-account=events-controller-gsa@project_id.gserviceaccount.com --namespace cloud-run-events

A few weeks ago, I had no issues installing knative-gcp by following your instructions in the documentation, but today encountered this issue.

Expected behavior A clear and concise description of what you expected to happen.

To Reproduce

### Install Knative Eventing + Serving
kubectl apply -f ${KNATIVE_SERVING_URL}/${SERVING_VERSION}/serving-crds.yaml
kubectl apply -f ${KNATIVE_SERVING_URL}/${SERVING_VERSION}/serving-core.yaml
kubectl apply -f https://github.com/knative-sandbox/net-istio/releases/download/${SERVING_BASE_VERSION}/release.yaml

kubectl apply --filename ${KNATIVE_EVENTING_URL}/${EVENTING_VERSION}/eventing-crds.yaml
kubectl apply --filename ${KNATIVE_EVENTING_URL}/${EVENTING_VERSION}/eventing-core.yaml

kubectl apply -f ${KNATIVE_SERVING_URL}/${SERVING_VERSION}/serving-crds.yaml
kubectl apply -f ${KNATIVE_SERVING_URL}/${SERVING_VERSION}/serving-core.yaml
kubectl apply -f https://github.com/knative-sandbox/net-istio/releases/download/${SERVING_BASE_VERSION}/release.yaml

kubectl apply --filename ${KNATIVE_EVENTING_URL}/${EVENTING_VERSION}/eventing-crds.yaml
kubectl apply --filename ${KNATIVE_EVENTING_URL}/${EVENTING_VERSION}/eventing-core.yaml

kubectl annotate --overwrite -n knative-serving service autoscaler prometheus.io/scrape=true
kubectl annotate --overwrite -n knative-serving service autoscaler prometheus.io/port=9090

kubectl annotate --overwrite -n knative-serving service activator-service prometheus.io/scrape=true
kubectl annotate --overwrite -n knative-serving service activator-service prometheus.io/port=9090

# Install Sugar Controller
kubectl apply -f "https://github.com/knative/eventing/releases/download/v${KNATIVE_EVENTING_VERSION}/eventing-sugar-controller.yaml

###  Install Knative-GCP
kubectl create namespace events-system

kubectl apply --filename https://github.com/google/knative-gcp/releases/download/${KGCP_VERSION}/cloud-run-events-pre-install-jobs.yaml

kubectl apply --selector events.cloud.google.com/crd-install=true \
--filename https://github.com/google/knative-gcp/releases/download/${KGCP_VERSION}/cloud-run-events.yaml

kubectl apply --filename https://github.com/google/knative-gcp/releases/download/${KGCP_VERSION}/cloud-run-events.yaml

#### Needed for init scripts
gcloud config set run/cluster ${CLUSTER_NAME}
gcloud config set run/cluster_location ${REGION}
gcloud config set project ${PROJECT_ID}

#### Enable workload identity
init_control_plane_gke.sh

Other Notes:

MohamedElhawaty commented 3 years ago

This might to be related to using a knative-gcp version with events-system as the system namespace (either v0.20.0 or v0.20.1) while using a version of the init_control_plane_gke.sh script that initializes cloud-run-events as the system namespace.

Note that after https://github.com/google/knative-gcp/pull/2161 we are back to using cloud-run-events as the system namespace so I would recommend trying the same steps again but with KGCP_VERSION=v0.20.2.