Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Support for Cloud Run for Anthos #96

Open
gvso opened this issue Aug 14, 2020 · 3 comments · May be fixed by #108, #107 or #110
Open

Support for Cloud Run for Anthos #96

gvso opened this issue Aug 14, 2020 · 3 comments · May be fixed by #108, #107 or #110

Comments

@gvso
Copy link
Contributor

gvso commented Aug 14, 2020

This is related to #78 but simpler to do since we already have most of the basics. Let's add support for Knative running on Cloud Run for Anthos to cover all the Cloud Run cases

@ahmetb
Copy link
Contributor

ahmetb commented Aug 18, 2020

Based on our discussion today: the easiest way to do this will be not use k8s.io/client-go and github.com/knative/serving/pkg/apis/serving/v1 package at all. With that, we need to have a KUBECONFIG file (or construct it in-memory) which complicates the configuration surface quite a bit.

If all we want to support is GKE, we can:

  • imitate gcloud run cli and accept --cluster-location and --cluster options
  • use those to get GKE cluster info (endpoint and server CA cert)
  • use those to construct an http client (using golang.org/x/oauth2 + /google)
  • make API calls to Knative API on the GKE cluster directly
  • the tool authenticates to the GKE master endpoint with IAM roles/container.admin role (or equivalent Kubernetes RBAC binding inside the cluster, doesn't really matter).

The only downsides I see are that:

  • potential data loss/corruption on ksvc object if knative serving APIs add something (even to fields like metadata:, and run/v1 package is not updated and picked up in this tool).
  • dealing with raw JSON and raw endpoints versus using nice client libraries (although, maybe we can actually make run/v1 work with the k8s endpoint by tweaking some options).

@gvso
Copy link
Contributor Author

gvso commented Aug 19, 2020

Thinking of the configuration from the user perspective:

./cloud_run_release_manager -platform=gke  [-clusters=<MY_CLUSTER1>,<MY_CLUSTER2>] [-cluster-locations=us-central1-a,us-central1-b] [-namespaces=default] [-project=<PROJECT_ID>]

platform is by default managed. We could add support for managing services in CRFM and CRfA at the same time later

For the first implementation of this, we might want to make the optional arguments required. Maybe support a single cluster only

@ahmetb
Copy link
Contributor

ahmetb commented Aug 19, 2020

For the first implementation of this, we might want to make the optional arguments required. Maybe support a single cluster only

I think that'll be the case forever, by design. The tool should manage (1) either FM or CRFA, not both simultaneously, (2) only one cluster at a time.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants