Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import of cloud-endpoints component and support in iap-ingress component #605

Merged
merged 3 commits into from Apr 17, 2018

Conversation

danisla
Copy link
Contributor

@danisla danisla commented Apr 6, 2018

Fixes #586

  • Import of cloud-endpoints CRD and controller. Depends on kube-metacontroller which is bundled with the component.
  • Updated iap-ingress component to create the CloudEndpoint resource if the FQDN matches the form of NAME.endpoints.PROJECT.cloud.goog
  • Updated the IAP doc with steps for using Cloud Endpoints.

/cc @kunmingg
/cc @ankushagarwal
/cc @jlewi


This change is Reviewable

@jlewi
Copy link
Contributor

jlewi commented Apr 6, 2018

Awesome thanks for the quick fix.

@jlewi
Copy link
Contributor

jlewi commented Apr 6, 2018

/hold
/lgtm
/approve

/assign @ankushagarwal

Ankush any comments?

@ankushagarwal
Copy link
Contributor

@danisla : When I tried this on a new k8s cluster, I get the following error from the cloud-endpoints-controller pod

Am I missing anything during the setup?

2018/04/06 23:36:49 [INFO] Fetching Project ID from Compute metadata API...
2018/04/06 23:36:49 [INFO] Fetching Numeric Project ID from Compute metadata API...
2018/04/06 23:36:49 [INFO] Instantiating GCE client...
2018/04/06 23:36:49 [INFO] Instantiating Google Cloud Service Management Client...
2018/04/06 23:36:49 [INFO] Initialized controller on port 80
2018/04/06 23:44:16 [DEBUG][kubeflow] Changed because parent sig different
2018/04/06 23:44:17 [INFO][kubeflow] Service does not yet exist, creating: kubeflow.endpoints.agwl-kubeflow.cloud.goog
2018/04/06 23:44:17 [ERROR] Could not sync state: [ERROR] Failed to creat Cloud Endpoints service: serviceName: kubeflow.endpoints.agwl-kubeflow.cloud.goog, err: googleapi: Error 403: Request had insufficient authentication scopes., forbidden
2018/04/06 23:44:18 [DEBUG][kubeflow] Changed because parent sig different
2018/04/06 23:44:18 [INFO][kubeflow] Service does not yet exist, creating: kubeflow.endpoints.agwl-kubeflow.cloud.goog
2018/04/06 23:44:18 [ERROR] Could not sync state: [ERROR] Failed to creat Cloud Endpoints service: serviceName: kubeflow.endpoints.agwl-kubeflow.cloud.goog, err: googleapi: Error 403: Request had insufficient authentication scopes., forbidden

@ankushagarwal
Copy link
Contributor

Looks like I had not enabled Cloud Endpoints API. Just enabled it. Trying again.

@ankushagarwal
Copy link
Contributor

Still getting the same error.

@danisla
Copy link
Contributor Author

danisla commented Apr 7, 2018

I just updated the docs with the API and cluster prerequisites.

You have to enable the APIs and create the GKE cluster with the cloud-platform scope.

gcloud container clusters create kubeflow \
  --scopes cloud-platform \
  --zone us-central1-b

@k8s-ci-robot k8s-ci-robot removed the lgtm label Apr 7, 2018
@jlewi
Copy link
Contributor

jlewi commented Apr 9, 2018

I don't think we should rely on the VM scope. That gives every pod cloud-platform scope.
Instead we should use a service account stored stored as a K8s secret.

Here are some gcloud commands for creating the service account.

@jlewi
Copy link
Contributor

jlewi commented Apr 9, 2018

Is it possible for the CRD to check if cloud endpoints is enabled and if not enable it?

@jlewi
Copy link
Contributor

jlewi commented Apr 13, 2018

@danisla Ping any chance we could get support for secrets?

@danisla
Copy link
Contributor Author

danisla commented Apr 13, 2018

Yes! I'm working on it now and should have the commit in today.

@danisla
Copy link
Contributor Author

danisla commented Apr 13, 2018

@jlewi ok updated component and docs to use a service account and secret for credentials.

docs/gke/iap.md Outdated
export FQDN="kubeflow.endpoints.$(gcloud config get-value project).cloud.goog"
```

Alternatively if you already have a DNS provider (e.g. Google Domains) create a type A custom resource record that associates the host you want e.g "kubeflow"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we have our own domain then we don't need a cloud-endpoints component right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, I can separate those sections for clarity.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The IP reservation gcloud step is also optional if you are using cloud-endpoints since the endpoint is coupled to any dynamically provisioned Ingress IP. We would just have to make the annotation on the Ingress conditional on the presence of an IP name.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If both work lets document but if you have to reserve an IP I think that's fine. I think that's best practice anyway so that's what we'll probably recommend.

// @optionalParam secretKey string cloudep-sa.json Name of the key in the secret containing the JSON service account key.
// @optionalParam namespace string null Namespace to use for the components. It is automatically inherited from the environment if not set.

// TODO(https://github.com/ksonnet/ksonnet/issues/222): We have to add namespace as an explicit parameter
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete this since the issue has been resolved you are inheriting namespace below.

@ankushagarwal
Copy link
Contributor

/lgtm

@jlewi
Copy link
Contributor

jlewi commented Apr 17, 2018

Test failure looks like a flake. There was a problem talking to the GitHub API while initializing the app

Get https://api.github.com/repos/ksonnet/parts/commits/master: dial tcp: lookup api.github.com on 10.39.240.10:53: read udp 10.36.10.19:54866->10.39.240.10:53: i/o timeout

@jlewi
Copy link
Contributor

jlewi commented Apr 17, 2018

/test all
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ankushagarwal, jlewi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [ankushagarwal,jlewi]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jlewi
Copy link
Contributor

jlewi commented Apr 17, 2018

/hold cancel

@k8s-ci-robot k8s-ci-robot merged commit e5b911b into kubeflow:master Apr 17, 2018
saffaalvi pushed a commit to StatCan/kubeflow that referenced this pull request Feb 11, 2021
…ent (kubeflow#605)

* import of cloud-endpoints component and support in iap-ingress component

* removed namespace TODO from prototypes

* update to IAP docs
yanniszark pushed a commit to arrikto/kubeflow that referenced this pull request Feb 15, 2021
surajkota pushed a commit to surajkota/kubeflow that referenced this pull request Jun 13, 2022
* update metadata tag to v0.1.10

* fix test

* rm cherry_pick_pull.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants