After updating to kube 15.0.6, no redirect working
See original GitHub issueExpected Behavior / New Feature
We had 14.0.11 installed for our gateway service running in Azure K8s, version 1.15.7. After updating to 15.0.6 no reroutes are working. There should be no regressions when doing this update.
Actual Behavior / Motivation for New Feature
Looking at the logs, it shows these errors: Unable to find service discovery provider for type: kube
Here is the Global config:
"GlobalConfiguration": { "ServiceDiscoveryProvider": { "Host": "unused", "Port": 443, "Token": "unused", "Namespace": "XXX", "Type": "kube" } }
Since we use rbac with least accessabiliy we have the following definition for the access rights.
apiVersion: v1
kind: ServiceAccount
metadata:
namespace: XXX
name: api-serviceaccount
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
namespace: XXX
name: service-reader
rules:
- apiGroups: [""] # "" indicates the core API group
resources: ["services", "endpoints", "pods"]
verbs: ["get", "watch", "list"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: read-services
namespace: XXX
subjects:
- kind: ServiceAccount
name: api-serviceaccount
namespace: XXX
apiGroup: ""
roleRef:
kind: Role #this must be Role or ClusterRole
name: service-reader
apiGroup: rbac.authorization.k8s.io
Any other information thats needed? Everything else we kept the same, its really only the nuget update and the user account changes.
Steps to Reproduce the Problem
- Build a system using 14.x.x for k8s and define a reroute.
- Update the kubernetes nuget to 15.06
- Verify that the reroute is still working
Specifications
- Version: 15.0.6
- Platform: net core 3.1
- Subsystem: kube
Issue Analytics
- State:
- Created 3 years ago
- Reactions:8
- Comments:22
The way I see it, this commit https://github.com/ThreeMammals/Ocelot/commit/6e5471a714dddb0a3a40fbb97eac2810cee1c78d renamed service discovery providers and now they are rejected here https://github.com/ThreeMammals/Ocelot/blob/master/src/Ocelot/ServiceDiscovery/ServiceDiscoveryProviderFactory.cs#L57. This should be broken for all service discovery providers as they were renamed in multiple places.
The way I got it to work was to create proxy providers with proper names, like they used to have: https://gist.github.com/molesinski/c949264d2d287e13c8c7477eb0632221
Found out the reason from https://github.com/ThreeMammals/Ocelot/commit/3439be89271bb37b170429d69ca74978c941432e It turns out that v16.0.1 has changed the ReRoutes to Routes.