-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18658 from smarterclayton/ingress_to_route
Replace router support for ingress with an ingress-to-route controller
- Loading branch information
Showing
31 changed files
with
2,925 additions
and
1,461 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
pkg/cmd/openshift-controller-manager/controller/ingress.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package controller | ||
|
||
import ( | ||
coreclient "k8s.io/client-go/kubernetes/typed/core/v1" | ||
|
||
routeclient "github.com/openshift/client-go/route/clientset/versioned/typed/route/v1" | ||
"github.com/openshift/origin/pkg/cmd/server/bootstrappolicy" | ||
"github.com/openshift/origin/pkg/route/controller/ingress" | ||
) | ||
|
||
type IngressToRouteControllerConfig struct{} | ||
|
||
func (c *IngressToRouteControllerConfig) RunController(ctx ControllerContext) (bool, error) { | ||
clientConfig := ctx.ClientBuilder.ConfigOrDie(bootstrappolicy.InfraIngressToRouteControllerServiceAccountName) | ||
coreClient, err := coreclient.NewForConfig(clientConfig) | ||
if err != nil { | ||
return false, err | ||
} | ||
routeClient, err := routeclient.NewForConfig(clientConfig) | ||
if err != nil { | ||
return false, err | ||
} | ||
|
||
controller := ingress.NewController( | ||
coreClient, | ||
routeClient, | ||
ctx.ExternalKubeInformers.Extensions().V1beta1().Ingresses(), | ||
ctx.ExternalKubeInformers.Core().V1().Secrets(), | ||
ctx.ExternalKubeInformers.Core().V1().Services(), | ||
ctx.RouteInformers.Route().V1().Routes(), | ||
) | ||
|
||
go controller.Run(5, ctx.Stop) | ||
|
||
return true, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.