Coder Social home page Coder Social logo

Comments (8)

ilackarms avatar ilackarms commented on May 14, 2024

can you give more detail on the steps you took and what went wrong? are you following the petstore tutorial?
glooctl get upstreams should return something like this:


glooctl get upstream
+--------------------------------+------------+----------+------------------------------+
|            UPSTREAM            |    TYPE    |  STATUS  |           DETAILS            |
+--------------------------------+------------+----------+------------------------------+
| default-kubernetes-443         | Kubernetes | Accepted | svc name:      kubernetes    |
|                                |            |          | svc namespace: default       |
|                                |            |          | port:          8443          |
|                                |            |          |                              |
| default-petstore-8080          | Kubernetes | Accepted | svc name:      petstore      |
|                                |            |          | svc namespace: default       |
|                                |            |          | port:          8080          |
|                                |            |          | REST service:                |
|                                |            |          | functions:                   |
|                                |            |          | - addPet                     |
|                                |            |          | - deletePet                  |
|                                |            |          | - findPetById                |
|                                |            |          | - findPets                   |
|                                |            |          |                              |
| gloo-system-gateway-proxy-8080 | Kubernetes | Accepted | svc name:      gateway-proxy |
|                                |            |          | svc namespace: gloo-system   |
|                                |            |          | port:          8080          |
|                                |            |          |                              |
| gloo-system-gloo-9977          | Kubernetes | Accepted | svc name:      gloo          |
|                                |            |          | svc namespace: gloo-system   |
|                                |            |          | port:          9977          |
|                                |            |          |                              |
+--------------------------------+------------+----------+------------------------------+

from gloo.

ilackarms avatar ilackarms commented on May 14, 2024

you can see how we're setting up rbac for gloo in https://github.com/solo-io/gloo/blob/master/install/kube.yaml

from gloo.

DaleBingham avatar DaleBingham commented on May 14, 2024

I am following the petstore tutorial, however I did not want it in "default" so I made a "petstore" project/namespace with the below and edited the YAML locally to use that namespace. I see the petstore, but the auto discovery did not work. I am using the latest minishift with OKD 3.11 FYI. I also have my own dotnet core webapi with a /swagger.json that spits out proper JSON for Swagger 2.0 for my API and it also did not discover that. So I was questioning the permissions required. I will look at that URL thank you for the quick reply.

oc new-project petstore

from gloo.

ilackarms avatar ilackarms commented on May 14, 2024

i understand. to explain, gloo (should) have the correct RBAC configuration:

kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: gloo-role
rules:
- apiGroups: [""]
  resources: ["pods", "services", "secrets", "endpoints", "configmaps"]
  verbs: ["*"]
- apiGroups: [""]
  resources: ["namespaces"]
  verbs: ["get", "list", "watch"]
- apiGroups: ["apiextensions.k8s.io"]
  resources: ["customresourcedefinitions"]
  verbs: ["get", "create"]
- apiGroups: ["gloo.solo.io"]
  resources: ["settings", "upstreams", "proxies","virtualservices"]
  verbs: ["*"]
- apiGroups: ["sqoop.solo.io"]
  resources: ["schemas"]
  verbs: ["*"]
- apiGroups: ["gateway.solo.io"]
  resources: ["virtualservices", "gateways"]
  verbs: ["*"]

applied to the gloo-system namespace.

the issue here is that Gloo maintains a whitelist of namespaces in which discovery runs.
It's on our road map to add cli support for modifying this whitelist, but right now you can do it with kubectl by running kubectl edit settings -n gloo-system default

# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
apiVersion: gloo.solo.io/v1
kind: Settings
metadata:
  clusterName: ""
  creationTimestamp: 2018-12-26T21:31:42Z
  generation: 1
  name: default
  namespace: gloo-system
  resourceVersion: "426372"
  selfLink: /apis/gloo.solo.io/v1/namespaces/gloo-system/settings/default
  uid: a3224e8e-0955-11e9-b0c6-50031de3a37c
spec:
  DevMode: true
  bindAddr: 0.0.0.0:9977
  discoveryNamespace: gloo-system
  kubernetesArtifactSource: {}
  kubernetesConfigSource: {}
  kubernetesSecretSource: {}
  refreshRate: 60s
  watchNamespaces: # <-- you'll want to edit right here
  - default
  - gloo-system
status: {}

add any/remove any namespaces in watchNamespaces to see upstreams get added / removed for services in that ns.

function discovery should then see the petstore upstream and be able to detect its functions. please let us know if this resolves your issue.

from gloo.

DaleBingham avatar DaleBingham commented on May 14, 2024

Ahhhhh that is what I was missing thank you! I will try that out.

from gloo.

rickducott avatar rickducott commented on May 14, 2024

@DaleBingham @ilackarms anything to fix here? If not I'll close the issue out.

from gloo.

DaleBingham avatar DaleBingham commented on May 14, 2024

from gloo.

rickducott avatar rickducott commented on May 14, 2024

Cheers

from gloo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.