ThreeMammals / Ocelot

.NET API Gateway
https://www.nuget.org/packages/Ocelot
MIT License
8.38k stars 1.64k forks source link

Kubernetes provider guidelines in docs don't match available methods #1746

Closed Palisar closed 1 year ago

Palisar commented 1 year ago

Expected Behavior / New Feature

When you view the docs for K8s is shows simply to use s.AddKubernetes();

in the configure services in program.cs

Actual Behavior / Motivation for New Feature

the extension method .AddKubernetes() doesn't appear to be available to this method.

Steps to Reproduce the Problem

  1. Copy the example setup from the docs
  2. Install the package Ocelot.Provider.Kubernetes as instructed in the docs
  3. scroll down to line where we configure services and type s.AddKubernetes(); and it will show this method is not longer there.

Specifications

raman-m commented 1 year ago

@ggnaegi Could you confirm that plz?

Palisar commented 1 year ago

image Here is a screen shot for more context

ggnaegi commented 1 year ago

@Palisar @raman-m the extension method is foreseen for an IOcelotBuilder object, therefore you should write

services
      .AddOcelot(Configuration)
      .AddKubernetes()

since AddOcelot will return an IOcelotBuilder The docs for version 20.0 are fine though (and version 1.0.0 too ;-)): image

Palisar commented 1 year ago

Ah , sorry it was my mistake not overriding this. Thanks for the clarification and sorry for the misunderstanding.

raman-m commented 1 year ago

Dear Paul, We have very simple K8s demo app: OcelotKube sample Here are exact lines which should help you: OcelotKube / ApiGateway / Startup.cs Extension definition: Ocelot.Provider.Kubernetes.OcelotBuilderExtensions.AddKubernetes