Skip to content
This repository has been archived by the owner on Jun 14, 2018. It is now read-only.

Commit

Permalink
add a 'manager ingress' command to launch the ingress controller
Browse files Browse the repository at this point in the history
  • Loading branch information
zcahana committed Feb 13, 2017
1 parent 0019a01 commit 28039ff
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,23 @@ Istio Manager provides management plane functionality to the Istio proxy mesh an
return nil
},
}

ingressCommand = &cobra.Command{
Use: "ingress",
Short: "Start Istio Proxy ingress controller",
RunE: func(cmd *cobra.Command, args []string) error {
controller := kube.NewController(flags.client, flags.namespace, resyncPeriod)
_, err := envoy.NewIngressWatcher(controller, controller, &model.IstioRegistry{ConfigRegistry: controller},
&flags.proxy)
if err != nil {
return err
}
stop := make(chan struct{})
go controller.Run(stop)
waitSignal(stop)
return nil
},
}
)

func init() {
Expand All @@ -138,6 +155,18 @@ func init() {
proxyCmd.PersistentFlags().StringVarP(&flags.proxy.MixerAddress, "mixer", "m", "",
"Mixer DNS address (or empty to disable Mixer)")
rootCmd.AddCommand(proxyCmd)

// TODO: Share these flags with proxyCmd (e.g., make both children of "manager envoy" command)?
ingressCommand.PersistentFlags().StringVarP(&flags.proxy.DiscoveryAddress, "sds", "s", "manager:8080",
"Discovery service DNS address")
ingressCommand.PersistentFlags().IntVarP(&flags.proxy.AdminPort, "admin_port", "a", 5000,
"Envoy admin port")
ingressCommand.PersistentFlags().StringVarP(&flags.proxy.BinaryPath, "envoy_path", "b", "/envoy_esp",
"Envoy binary location")
ingressCommand.PersistentFlags().StringVarP(&flags.proxy.ConfigPath, "config_path", "e", "/etc/envoy",
"Envoy config root location")
rootCmd.AddCommand(ingressCommand)

proxyCmd.AddCommand(egressCmd)

rootCmd.AddCommand(configCmd)
Expand Down

0 comments on commit 28039ff

Please sign in to comment.